科技爱好者周刊(第 413 期):再见了,React Native – 阮一峰的网络日志

科技爱好者周刊(第 413 期):再见了,React Native – 阮一峰的网络日志


Here is a record of technology content worth sharing every week, published on Fridays. ([通知] Weekly will be closed during the Mid-Autumn Festival and National Day holidays starting next Friday.)

This magazine is open source and submissions are welcome. There is also a “Who’s Recruiting” service that publishes programmer recruitment information. Please contact via email for cooperation ([email protected])。

cover image

科技爱好者周刊(第 413 期):再见了,React Native – 阮一峰的网络日志

The newly opened West Gate of East China Normal University Minhang Campus is modeled after the gate of Guanghua University, one of its predecessors. (via)

Goodbye, React Native

Shopify announced that it will abandon React Native and use Swift and Kotlin to develop its mobile version.

In other words, it decided to use native languages ​​to develop iOS and Android clients instead of using Web technology to develop an intermediate version and then compile it into clients for each platform.

This can’t help but remind people that six years ago in 2020, it also wrote an article, announcing in a high profile that it would abandon native languages, fully switch to React Native, and embrace Web technology.

This was big news at the time, and many people agreed with Shopify’s three reasons for choosing Web technology.

  • No need to re-develop the same functionality for each platform.
  • Allow developers to work across technology stacks.
  • The extra time and energy can be used to create more value.

To be honest, these three reasons are just pretentious, and there is only one real reason: saving money.

In order to save money, it chose React Native, which only required one team. Compared with two teams for Android and iOS, it could save costs significantly.

Giving up React Native now is also to save money. Now with AI, it doesn’t matter what language you use. AI can translate languages ​​easily, so why not use the native language with better performance and skip the intermediate version.

Of course, React Native itself is not up to par. It has been more than 10 years since it was released in 2015. Some basic technical problems have not been solved well, and it is not very convenient to use. It was replaced by someone else. To be honest, it was not unfair at all.

In short, AI is an omnipotent automatic translator. Once it comes out, intermediate languages ​​​​or translation layers like React Native will be sentenced to death. At this moment, it will begin to withdraw from the stage of history and become an inevitable outcome.

New projection method for world maps

A big thing happened last week, the United Nations voted to abolish the Mercator projection.

This decision is not binding on countries and is simply a sign that the Mercator projection is truly outdated and may need to be phased out.

We know that the earth is round and the map is flat. This determines that some kind of transformation method must be used to convert the spherical landform projection into a flat map. This also shows from one side that there must be distortion in flat maps.

The above is the current world map, using the Mercator projection.

This kind of projection is equivalent to stretching the globe directly into a rectangle. The consequence is that high latitude areas will be greatly stretched and the area will appear to be too large.

In the picture above, equatorial Africa looks the same size as high-latitude Greenland. In fact, the former is 14 times larger than the latter.

The United Nations recommends that the Mercator projection be abolished,Use the new Equal Earth Projection to draw world maps。

The core principle of the Equal Earth projection method is not to change the area proportions. If a piece of land occupies 1% of the earth’s area, then it should also occupy 1% of the map area, so its area ratio will not be distorted.

The trade-off is that it stretches based on the area. For the equatorial and low latitude areas, the north-south direction is appropriately stretched longitudinally, and the east-west direction is appropriately contracted; for the poles and high latitude areas, the east-west direction is greatly widened, and the north-south direction is greatly flattened.

Therefore, this projection method will cause the shape of the land to be distorted, and the length and width may be deformed, making it impossible to use this kind of map for accurate navigation.

The picture above is a world map in the Equal Earth projection. Africa has become larger.

Below are Europe and Africa in the Mercator and Equal Earth projections. You can compare the differences.

Technology trends

1. Hidden camera detector

Are you worried that there are hidden cameras watching you?

South Korean scientists have invented a device that can quickly detect whether there are such hidden cameras around.

This kind of device is just a circuit board with multiple light-emitting diodes on it, which will light up in sequence. It can be used when connected to a mobile phone, and the cost is very low.

Its principle is that the light emitted by the light-emitting diode will be reflected by the hidden camera. As long as normal mirrors are excluded from the received reflected light, the position of the camera can be determined.

So, how can we exclude other reflected light? This device uses a very clever method, which is to light up LEDs in different positions in sequence.

All other reflected light comes from plane mirrors. Only the mirror of the camera is a convex lens, and the reflected light will be shifted in position. Using light sources at different positions, it is possible to determine which reflected light has shifted position, and then determine the position of the reflection point.

2、one sentence news

(1) The Houthis recently won a major victory and are said to have used the most incredible method of victory in history.

They faked an audio recording of an opposing commander ordering troops to retreat. They asked an Internet celebrity to spread this fake audio on Twitter. As a result, the opponent’s army actually fell into chaos. They successfully marched in and occupied the opponent’s territory at a very small cost.

(2) Laptops begin to use solid-state cooling technology, which no longer requires fans and dissipates heat through graphene/copper foil patches.

Therefore, notebooks can be made extremely thin and lightweight. Lenovo recently released a 14-inch concept notebook that weighs only 830 grams. Huawei’s 14-inch notebook MateBook Pro S weighs only 798 grams.

(3) Chengdu City plans to implement “Ciyuan Vouchers”. Enterprises and institutions can apply for them for free. For the Tokens you consume, the government can subsidize no more than 30% of the consumption amount.

In addition, Chengdu City has also planned “Ciyuan Loan”, which allows you to borrow tokens from banks for consumption.

article

1. My HTML template file (English)

The author introduces in detail what the web page HTML template should look like in 2026 and what each line does.

2. How to cancel CSS using JavaScript (English)

An elementary tutorial to teach you to use JS to cancel the CSS style sheet of a web page.

3. Container management tools and reverse proxy tools (English)

The author introduces how he uses container technology to build servers, the technology stack and various tools he uses.

4. The weirdness of JavaScript (English)

A popular science article about JavaScript, introducing some of the little-noticed weirdness of JS syntax.

5. Google search udm parameters (English)

A udm parameter can be added to the Google search URL to access specific types of results. For example, udm=2 returns image results.

6. Explanation of entropy (English)

This long article uses popular language to explain the concept of “entropy”, with many illustrations.

tool

1、Great Tables

A Python library that can generate complex tables.

2、ghostty-web

This project compiles the terminal emulator Ghostty into WASM code, so that a full-featured terminal can be used in web pages.

3、Infant

A command line tool to set the default opening method for files with different suffixes on Mac computers.

4、mini-img-editor

An online image editor using WebGL, as a prototype demonstration, the interface is very simple.

5、CryptPad

The free online Office suite supports end-to-end encryption, see the introductory article.

6、Lyrimuse

macOS desktop lyrics tool, find and display the lyrics of the song being played in real time. (Contributed by @Yudaotor)

7、capcut-cli

Capcut is an unofficial command line tool for creating/editing videos in the terminal. (Contributed by @renezander030)

8、by levels

A Go language binary file implements a self-hosted email system, sends and receives emails on web pages, and supports four protocols: SMTP / IMAP / POP3 / ManageSieve. (Contributed by @lianguan)

9、Status Trio

A three-in-one Mac status bar icon inspired by the iPhone Duo design, integrating Wi‑Fi, battery and volume. (Contributed by @lingyired)

10、Polycompiler

An interesting project can package JS scripts and Python scripts into one script, which can run in both JS environment and Python environment.

resource

1、gpcb.net

Web design tool for network device topology diagrams. (Contributed by @abpyu)

2. Visual style illustration

Use an apple to display more than 100 visual styles. For example, the picture above is a neon-style apple. (Contributed by @jerrymakes)

3. AI IP detection

This website displays the actual IP address you are connecting to when connecting to Claude, ChatGPT, Grok, Perplexity, and Cloudflare. (Contributed by @MuduiClaw)

4. Gravity

A web-based multimedia tutorial that introduces the audience to the knowledge of gravity.

picture

1. F-35 helmet

The most expensive helmet in the world is the pilot helmet of the American fighter jet F-35, worth US$400,000 (approximately RMB 3 million).

The reason it is so expensive is that it can connect to aircraft sensors and receive and process various data.

It has a built-in 360-degree display to provide pilots with night vision and flight data (picture below).

Each helmet is custom-made from 3D scans and made from carbon fiber, Kevlar and various optics.

2. Soviet Mi-6 helicopter

Soviet airlines once envisioned using helicopters to transport passengers.

In the 1960s, they produced the Mi-6, the largest helicopter in the world at the time, which could seat 80 passengers.

It is about 33 meters long and 10 meters high. Each row inside can seat 5 people, and there is even a toilet.

Only one of this aircraft was ever built and was used to transport passengers to the eastern part of the Soviet Union for oil and gas work.

abstract

1. Pasty lasagna

Let’s be honest, in reality, most programmers’ code is actually terrible.

But there are also levels of bad trash. One situation is that the code is like spaghetti code, a mess that is impossible to understand.

A better situation is “slop lasagna”. This kind of code is also lumped together, but divided into many layers. At least it can be separated by layer.

Even if you can’t write excellent code,You should also try to avoid spaghetti code and strive to write lasagna code。

An example is the React framework, which splits the code into components. The advantage of this is that even if each component is junk code, at least one component can be replaced individually.

Deleting components, copying components, inlining components, and rewriting components are all easy operations. Because the components are separated, it allows you to focus only onsingle componentinternal code.

As long as your component tree is well designed, the exact code inside a single component doesn’t matter. It doesn’t matter if someone writes a 10,000-line garbage component, eventually someone will rewrite it and it won’t affect the rest of the code base.

As long as the code has a lasagna structure, then a single layer is bad and does not affect the overall situation.。

What really matters is what’s underneath.

(1) How data flows in the system, where the current data is input from, what is output, and what data you store.

(2) How is the user experience? Are there any obvious loopholes, poor performance, or inconsistent behavior?

(3) Whether the basic abstract concepts are correct and whether they have been misused.

As long as the above three points are OK and the code has a component-like and interchangeable structure, then there will be no major problems with the program.. At this time, whether a certain component is lengthy, well-written, concise and reasonable, and whether there are small bugs actually has nothing to do with the overall situation.

speech

1、

Satellites consume the planet’s rotational energy, thus accelerating its destruction.

— “Did Venus Devour Its Satellites?”

2、

Imagine two very similar software companies, with similar revenues and similar software products. The only difference between them is that Company A uses 1 million lines of code, while Company B uses 100,000 lines of code. Which company will perform better?

Obviously, companies that have one-tenth as many lines of code as others will perform better. With fewer lines of code, code can be understood and modified faster.

— “Code is Debt”

3、

Big models transform you from a programmer writing code to a programmer managing context, weeding out irrelevant information, and writing detailed prompts.

— Liz Fong-Jones

4、

If a founder builds the right team in 2024 but builds the wrong product, then by 2027 his team will have become a battle-hardened team that is likely to build the right product.

The experience brought by failure is like the nutrients in the root system being stored, waiting for the arrival of the next spring, instead of wasting it in vain.

— “AI won’t collapse, but it will go through a storm”

5、

Many technical errors are not a big problem. If my GPS goes wrong, I quickly realize I’m in the wrong place; if Netflix recommends a movie that doesn’t look good, I won’t watch it.

But AI is different. The more advanced it is, the harder it is to know whether it is wrong, because we will use AI to complete tasks that we cannot complete or verify ourselves.

Once the AI ​​goes wrong, we can only keep summoning stronger AI and hope the spell works. Welcome to the age of wizards.

— “AI is working with magicians”

Review of previous years

Crazy AI ads in San Francisco (#366)

The story of your life (#316)

Make your own bilingual EPUB e-book (#266)

The Triumph of Minimalism (#216)

(over)





Source link

Leave a Reply

Your email address will not be published. Required fields are marked *