Why do we separate the front and back ends

The front and back end separate languages

The opening show,

Some of the distance is very long, and walking will be very tiring. However, do not go, will regret. 【 sour sour 】

The story begins

End of small talk, start today’s topic

What are the front and back ends:

As the name implies, the front end refers to the client side, which is the program that the browser can operate, and the back end is the program that runs on the server to provide software services. Only these two programs can be combined to form a complete software operation. For example, when you shop on Taobao, all you can see belongs to the front end of Taobao. What you can’t see is the back end. Can’t see? What the hell?

Here’s an example:

Take TV, for example. The TV is the browser, the program is the front end, and you can imagine the back end. Yes, the process by which the programme makers make the programme. Then turn around and watch the same truth, mou young girl why is mou young girl, because the backstage director plot set up well, mou young girl play well. Mou girl is the front end, mou director is the back end.

So in software engineering why is this part separated, how was it done before? Don’t worry. Let’s take our time.

Shadow puppetry remember, my impression of shadow puppetry is 1 or 2 people, one of the shadow puppetry waving behind the scenes, one of them playing Musical Instruments according to the plot. Several people matched to complete the shadow play program. When there’s not a lot of people around, you can probably do it all by yourself. Later, we have movies. Some people perform, some people set the background music, prelude and so on. There is a clear division of labor, so a movie is not something that one person can finish from beginning to end. Shadow puppetry is like when the front and back ends are not separated, and the film is the product of the separation of the front and back ends.

History – Front and rear ends are not separated

Let me start with something historical: Take JavaWeb development as an example. In the old days, artists just designed graphics, cut images, wrote CSS, converted them into static HTML, and gave HTML files to Java developers. Java developers need to return HTML content to the browser in different business outputs in a specific format to complete the business. In other words, the front end cuts the map and gives it to the Java developer, and the Java developer takes care of the rest. This is also the origin of the front end.

As you can imagine, Java developers need to spread the static interface between their business code and their business code in different businesses. You know, there’s Java, CSS, javascript, HTML, and even a few pieces of SQL in a class file,

As shown in figure:

As an example, JSP files contain all the file formats of current front-end development and Java code

Imagine if you had a loop in the code above, and you had SQL in the loop.

So at that time Java development is full stack god, but problems debugging is also a severe headache, style business alone, browser compatibility alone can kill half of Java developers.

The new world

Angular

It was Google’s Angular framework that first proposed the separation of the front and back ends, while the front-end gods were also looking for direction, AMD, CMD, etc.

Angular first came up with the concept of MVVM, and of course Angular wasn’t born a giant. It became a giant by serving tea to the giant.

Those of you who have used Angular1 should feel like death when upgrading to Angular2. Now, of course, higher versions of Angular also spawn well.

React

One that Facebook came up with the idea of writing once and running across the platform. Mark Zuckerberg, the company founded by the Internet addict who dropped out of school. Mark Zuckerberg, our foreign son-in-law.

Vue

Vue uses Angular and React to combine the best of both frameworks.

Dysphoria

A wonderful experience

The project above has previously used Angular and Vue

Angular does compare systems, and the system itself provides the components and mechanisms available to each process

Vue is a shuttle, fast, accurate and ruthless. Hit it where you want it. What? Many components in the business need to be written? Don’t worry, the wheels may have been built.

I insist on writing wheels myself, but look them up before using them. There are plenty of great open source projects on Github and Gitee.

Before and after the front and back ends are separated

The end of the

Welcome to pay attention to wechat public number Northwest Zongzi continue to update 1-2 original content every week, in the study and life on the road to make trouble together.