淘宝资深架构师微博的一句话,小弟我来问问
淘宝资深架构师微博的一句话,我来问问
淘宝资深架构师在微博上说了这么一句话,内容如下
“做Web,前端还是PHP(或者Ruby, Python,Perl)起步快,发展到一定阶段后再分层,中间层再用C/C++, Java,Go这类的语言实现高性能,分布式服务。所以学好两门语言还是有必要的。”
链接在此
请问这个前端是怎么定义的?或者这个前端指的是什么?
因为就我目前的水平,我理解的前端是html css js之类的
------解决方案--------------------
N,应该更广义一些,泛指直接面对使用者的表现/接收层
------解决方案--------------------
一般把与用户交互的层称为前端,php这类脚本也是在与用户打交道。后端是指数据存储或计算的层。比如db,比如日志,日志分析等等。
不过我个人认为php这类脚本的定位也应该是中间层,就像mvc模型中的c属于前端与后端的桥梁。
------解决方案--------------------
淘宝的前端不是php做的吗?底层可能就是c,c++,java
------解决方案--------------------
当涉及到 高性能 分布式的前提下 PHP就到了前端了...这里说的前端可能泛指了一些,因为在一些项目里PHP很多时候也在处理输出,而不是抛出数据.大约才有这么一说吧.
这个东西没有科学标准,所以楼主也不需要纠结,怎么说都对。
------解决方案--------------------
他说的前端不是我们平时所理解的前端,同5楼意见
DAO以下据说一般是C++或者JAVA了
------解决方案--------------------
不一定要跨语言的,用接口就可以,把数据传到其他语言的接口,就像接力赛,各自跑一段
我做这个事情已经多年,只要格式化一段数据在最短时间扔给下家接收,所以有很长时间没”接触“数据库了
------解决方案--------------------
DAO还是可以用PHP来写的,跨语言的时候换一个DAO类就可以,这个DAO类实现REST模式的数据操作,而JAVA那边就提供REST服务
我也没实际玩过,但手上的项目已经准备进入这一阶段了.然而其实由于我不精通JAVA,当然不会用JAVA搞REST,还是用PHP做REST服务平台的(主要是为了做分离,不是为了实现跨语言),以后再看情况要不要换JAVA吧...公司也没有意思请PHP以外的技术人员的样子,比如员工抽空学一下,了解一下.NET都表现出不高兴呢

------解决方案--------------------
不同语言的交互,最简单的方法可以采用i/o输出的接口来进行。比如java请求一个php的接口返回一段json,java拿到这个json然后去做自己的处理,得到结果后再post给.net。
不过也有别的办法,比如Apache Thrift。先前是facebook开发的,这个东西充当一个翻译的角色。它会把源语言的数据结构转换为自己的一种中间语言(DSL),然后再转换为目标语言可以识别的数据类型。不过这个东西有点庞大,需要一定的学习成本。
也有一些比较轻量级的,google的protocolbuf。
------解决方案--------------------
他说的没有错,那并不算跨语言。那就是我说的第一种方法。
真正的跨语言,需要php可以读取或引用java或.net的数据类型,这需要一定的转换工作。再比如c要读取c++的class数据时,需要将其转换为struct,因为c没有class。Thrift和protocolbuf就是类似这样工作的。
第一种方法所有语言使用的都是第三方的数据类型:json、xml等。
------解决方案--------------------
嗯,不是真正的跨语言,除了JSON,XML,还有BSON,要求不是非常非常高的话相信这些数据格式通过REST就已经能满足了.但是REST是基于http协议的,一般用于Web开发领域
非Web开发或者Web底层模块可能就是真正的跨语言翻译数据与对象了吧.
------解决方案--------------------
淘宝网的主页,商品页面等等一些 用户常用的web应用用php来做。效率比java,c++要高。
淘宝中中和支付有关的功能,用c++或php去做。
因为涉及到钱,这样的功能实在太重要了。考虑到安全性等等因素。所以不用php。
还有,php中可以调用java 手册中有
这是我的理解

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Java is a popular programming language that can be learned by both beginners and experienced developers. This tutorial starts with basic concepts and progresses through advanced topics. After installing the Java Development Kit, you can practice programming by creating a simple "Hello, World!" program. After you understand the code, use the command prompt to compile and run the program, and "Hello, World!" will be output on the console. Learning Java starts your programming journey, and as your mastery deepens, you can create more complex applications.

Java Made Simple: A Beginner's Guide to Programming Power Introduction Java is a powerful programming language used in everything from mobile applications to enterprise-level systems. For beginners, Java's syntax is simple and easy to understand, making it an ideal choice for learning programming. Basic Syntax Java uses a class-based object-oriented programming paradigm. Classes are templates that organize related data and behavior together. Here is a simple Java class example: publicclassPerson{privateStringname;privateintage;
