博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
web后端开发需要会前端吗_前端和后端Web开发之间的区别
阅读量:2506 次
发布时间:2019-05-11

本文共 7367 字,大约阅读时间需要 24 分钟。

web后端开发需要会前端吗

In this post I want to help you conceptually make the move from frontend to backend, in the context of Web development.

在本文中,我想帮助您在Web开发的背景上从前端到后端进行概念上的转变。

Let’s first define what is frontend. Frontend is the term that we use to identify programming inside the browser. We also call it client-side Web development.

首先定义什么是前端。 前端是我们用来识别浏览器内部程序的术语。 我们也称其为客户端Web开发。

In the frontend side you worry about creating and distributing an application that runs on your clients machine, which can be a laptop, a desktop computer or a mobile device. You build something that you distribute and then runs inside each client browser.

在前端,您担心创建和分发在客户端计算机上运行的应用程序,该计算机可以是便携式计算机,台式计算机或移动设备。 您构建要分发的内容,然后在每个客户端浏览器中运行。

In the backend side you architect and build an application that runs on a single server (in the beginning), and every client accesses that application. The application runs in the server, an environment you control, and then you either send to the browser an application using server-side rendering of the app, or you create an API that just distributes JSON data to the clients (something pretty common lately, especially paired with frontend frameworks/libraries like React, Vue and others).

在后端,您可以设计和构建在单个服务器上运行的应用程序(在一开始),每个客户端都可以访问该应用程序。 该应用程序在服务器(您控制的环境)中运行,然后使用该应用程序的服务器端呈现将其发送给浏览器,或者您创建一个仅将JSON数据分发给客户端的API(最近很常见,特别是与诸如React,Vue等前端框架/库配对。

You can already see there’s an overlap here. The backend can be used to serve the frontend-facing application that will run in the browser.

您已经可以看到这里有一个重叠部分。 后端可用于服务将在浏览器中运行的面向前端的应用程序。

HTML, CSS, JavaScript, images, animations, React, Vue, Svelte, CSS-in-JS, state management in the frontend, performance optimization, all of those topics (and many more!) are linked to frontend programming.

HTML,CSS,JavaScript,图像,动画,React,Vue,Svelte,CSS-in-JS,前端状态管理,性能优化,所有这些主题(还有更多!)都与前端编程相关联。

Some kinds of applications just need the frontend part. My website, for example, does not have a backend. It’s a static website generated using Hugo, and all the work I do on it is considered frontend programming: the CSS, the markup, the JavaScript I use to power search, for example.

某些应用程序只需要前端部分。 例如,我的网站没有后端。 这是一个使用Hugo生成的静态网站,我在该网站上所做的所有工作都被视为前端编程:例如CSS,标记以及我用来增强搜索功能JavaScript。

Frontend programming has its own unique set of challenges: the browser support of features, for example. Or performance of an application on a low-end device. Building single-page applications.

前端编程有其独特的挑战集:例如,浏览器对功能的支持。 或低端设备上应用程序的性能。 构建单页应用程序。

Backend development is completely different from the frontend. First, you exit the browser environment, which is freeing on one hand, but can also be overwhelming.

后端开发与前端开发完全不同。 首先,您退出浏览器环境,该环境一方面正在释放,但也可能不堪重负。

Why? Well, you have more choices.

为什么? 好吧,您还有更多选择。

In the browser, the programming language choice is always JavaScript. Or a language that compiles to JavaScript, like TypeScript, Elm and others.

在浏览器中,编程语言选择始终是JavaScript。 或者是编译为JavaScript的语言,例如TypeScript,Elm等。

In the backend you can use anything you want. My usual choice is Node.js, because being JavaScript based I can be an expert in one single language, and work in both the frontend and the backend with JavaScript.

在后端,您可以使用任何您想要的东西。 我通常的选择是Node.js,因为基于JavaScript,我可以成为一种语言的专家,并且可以使用JavaScript在前端和后端工作。

But you can use frameworks like:

但是您可以使用如下框架:

  • Django which is based on Python

    基于Python的Django
  • Laravel which is based on PHP

    基于PHP的Laravel
  • Rails which is based on Ruby

    基于Ruby的Rails
  • Phoenix which is based on Elixir

    基于Elixir的Phoenix
  • Deno which is based on TypeScript

    基于TypeScript的Deno

and many others, including more enterprise-oriented ecosystems like Java and .NET.

以及其他许多方面,包括Java和.NET等面向企业的生态系统。

And I’m not even mentioning Go and Rust, two great choices.

而且我什至没有提到Go和Rust,这是两个不错的选择。

This is probably the greatest strength of backend programming: you have lots of choices in the language you can use, so you can use the one you prefer. But it can also lead to “analysis paralysis” if you’re not sure what you prefer, yet.

这可能是后端编程的最大优势:您可以使用多种语言选择,因此可以使用自己喜欢的语言。 但是,如果您不确定自己喜欢什么,也可能导致“分析瘫痪”。

On the backend we don’t have the problems we need to face on the frontend. One thing I often hear is that frontend development goes too fast. New things pop up every day and the best tool change from month to month. Which is not a false statement. The backend in comparison looks more a low-paced ecosystem, especially in well-known and mature environments and tools, and a well-written backend can feel modern for years, while we can’t say the same thing in the frontend.

在后端,我们没有在前端需要面对的问题。 我经常听到的一件事是前端开发太快了。 每天都会弹出新事物,并且最好的工具每月都在变化。 这不是虚假陈述。 相比之下,后端看起来更像是一个节奏较慢的生态系统,尤其是在众所周知且成熟的环境和工具中,而且编写良好的后端可以感觉很现代了很多年,而我们在前端不能说同样的话。

In the backend we have its own set of issues, of course. For example, how to store data in a database. How to choose the right database. SQL vs NoSQL. Microservices vs monoliths. How to deploy our application, and where. How to handle more traffic. How to securely deal with data and requests. How to test and handle error handling. How to choose the right architecture.

当然,在后端,我们有自己的问题。 例如,如何在数据库中存储数据。 如何选择合适的数据库。 SQL与NoSQL。 微服务与整体。 如何在哪里部署我们的应用程序。 如何处理更多流量。 如何安全地处理数据和请求。 如何测试和处理错误处理。 如何选择正确的架构。

Then we have topics that overlap with DevOps like how to use Docker and Kubernetes, how to set up a Continuous Integration and Continuous Delivery workflow, how to deal with Linux, infrastructure and server-level networking. We need to face choices like using our own VPS servers or using a PAAS like Heroku, or going serverless with AWS Lambda. Depending on the company and team you work in, you might need to be ready to tackle those topics, too.

然后,我们将讨论与DevOps重叠的主题,例如如何使用Docker和Kubernetes,如何设置持续集成和持续交付工作流程,如何处理Linux,基础架构和服务器级网络。 我们需要面对各种选择,例如使用我们自己的VPS服务器或使用诸如Heroku之类的PAAS,或者使用AWS Lambda进行无服务器化。 根据您工作的公司和团队的不同,您可能还需要准备解决这些主题。

And we need to figure out how to connect the backend to the frontend, of course. How to build an API. GraphQL vs REST. How to handle authentication. How to make the API fast at scale. Those are topics that involve both frontend and backend in the quest to make them talk to each other.

当然,我们需要弄清楚如何将后端连接到前端。 如何构建API。 GraphQL与REST。 如何处理身份验证。 如何快速扩展API。 这些主题涉及前端和后端,以使他们彼此交谈。

It’s a lot of stuff and you can find entire books on those topics, and this is why we have the separation between frontend and backend developers, and why being a full-stack developer that can navigate through all those problems is a valuable skill to have.

有很多东西,您可以找到关于这些主题的整本书,这就是为什么我们将前端开发人员和后端开发人员区分开来,为什么成为一个能够解决所有这些问题的全栈开发人员是一项有价值的技能。

And of course you don’t have to know all of those things to be qualified as a frontend or backend developer. You need to know those things at a high level, to get an idea of what you don’t know (yet). But it’s a great idea also to specialize in one particular niche and become great at that.

当然,您不必知道所有这些内容就可以成为前端或后端开发人员。 您需要全面了解这些内容,以了解您尚不了解的内容(尚未)。 但是,专注于一个特定的细分市场并做到这一点也是一个好主意。

For example you can be a backend developer that does not know how to deal with advanced Linux configuration, and rely on a PAAS like Heroku to do that for you. Or use AWS Lambda to avoid that altogether.

例如,您可以是不知道如何处理高级Linux配置的后端开发人员,而可以依靠诸如Heroku之类的PAAS来为您执行此操作。 或使用AWS Lambda完全避免这种情况。

The important thing I think is to know when it’s best to learn and do-it-yourself versus using tools that support your work.

我认为重要的是要知道什么时候最好学习和自己动手,而不是使用支持您工作的工具。

翻译自:

web后端开发需要会前端吗

转载地址:http://pomgb.baihongyu.com/

你可能感兴趣的文章
最初的动机
查看>>
ARM的44binit.s文件的详细注释
查看>>
MSR和MRS 指令
查看>>
ads1.2下的scatter文件的理解
查看>>
scatter file--ARM中的RO、RW和ZI DATA说明(1)
查看>>
非常了不起的工具INET,实现.NET跨平台!
查看>>
自定义控件Anchor
查看>>
自定义控件Img
查看>>
自定义控件Span
查看>>
自定义控件Pager
查看>>
微信weixin小程序开发源码资源学习教程汇总
查看>>
网页Javascript潜入HTML页面方法
查看>>
【原创】去掉微信登录二维码中的微信登录几个字的解决方法
查看>>
浏览器ie/firefox/chrome阻止 ajax window.open a.click form.submit弹出新窗口被拦截解决方法
查看>>
百度PC电脑端搜索和移动搜索结果显示熊掌号内容源
查看>>
一个人企业可以申请几个百度熊掌号?
查看>>
Struts logic 标签
查看>>
Struts Spring Hibernate 面试题
查看>>
nvarchar与varchar的区别
查看>>
Hibernate之中inverse与cascade的异同
查看>>