Table of Contents
回复内容:
Home Backend Development PHP Tutorial x经问题: Why choose Ruby or Python over PHP for web development?

x经问题: Why choose Ruby or Python over PHP for web development?

Jun 06, 2016 pm 08:40 PM
php python ruby

昨天整了一天的环境,想学习下django or sinatra.

结果整到最后,我问自己为什么要这样做? php不也挺好的?

框架要开发效率, 我会laravel啊.

有人说laravel的代码很乱,搞了半天,愣是没弄懂它那个facade是啥回事... 在图书馆里看了一整年的j2ee的我,倒是觉得laravel很熟悉. 于是,我抛弃掉20多年历史的MVC, 借助namespace弄个package, 各种services, validators, repositories,events,etc,.全部分开来, 注册ServiceProvider,通过ioc注入实例,再搞搞phpunit. 看着自己的代码, 觉得好有成就感. 这才是高聚合低耦合! 就是操作起来比较麻烦, 要创建很多文件, 貌似这样就不算是效率了...

还有, laravel这东西本身就是一个个包组成的. 比如我用自己的前端替代wordpress前端时,就是只用他的router和database.

框架要性能, 我可以搞phalcon. 这个没用过就不扯了.

包管理,有composer. 多亏了FIG这个非官方小组, 出了psr标准! 我觉得composer算是php的一个里程碑吧. 只有一个问题, 国内的速度........

php本身很慢!! 前有hhvm, 后有hippyvm, 官方又要搞个PHPNG. 哦, 5.5还自带了个opcache.

需要non-blocking? reactphp

......


为什么startup,尤其国外, 会选择python或ruby作为开发语言呢? 我个人觉得就是因为php太流行, 程序员良莠不齐. php命名不规范,我反而觉得,不是个多大的问题.

你们的想法呢?

我左思右想, 如果给我一个理由放弃php, 而以python或ruby为生, 那就是php程序员工资低......


开放性问题,靠谱都会给赞.

回复内容:

昨天整了一天的环境,想学习下django or sinatra.

结果整到最后,我问自己为什么要这样做? php不也挺好的?

框架要开发效率, 我会laravel啊.

有人说laravel的代码很乱,搞了半天,愣是没弄懂它那个facade是啥回事... 在图书馆里看了一整年的j2ee的我,倒是觉得laravel很熟悉. 于是,我抛弃掉20多年历史的MVC, 借助namespace弄个package, 各种services, validators, repositories,events,etc,.全部分开来, 注册ServiceProvider,通过ioc注入实例,再搞搞phpunit. 看着自己的代码, 觉得好有成就感. 这才是高聚合低耦合! 就是操作起来比较麻烦, 要创建很多文件, 貌似这样就不算是效率了...

还有, laravel这东西本身就是一个个包组成的. 比如我用自己的前端替代wordpress前端时,就是只用他的router和database.

框架要性能, 我可以搞phalcon. 这个没用过就不扯了.

包管理,有composer. 多亏了FIG这个非官方小组, 出了psr标准! 我觉得composer算是php的一个里程碑吧. 只有一个问题, 国内的速度........

php本身很慢!! 前有hhvm, 后有hippyvm, 官方又要搞个PHPNG. 哦, 5.5还自带了个opcache.

需要non-blocking? reactphp

......


为什么startup,尤其国外, 会选择python或ruby作为开发语言呢? 我个人觉得就是因为php太流行, 程序员良莠不齐. php命名不规范,我反而觉得,不是个多大的问题.

你们的想法呢?

我左思右想, 如果给我一个理由放弃php, 而以python或ruby为生, 那就是php程序员工资低......


开放性问题,靠谱都会给赞.

初创公司需要快速做出可用的产品,ROR在速度上有绝对的优势。

仅此而已。

如果现在这个时间点来选,个人觉得Ruby和Python不是一个好选择。既不如PHP使用广泛,也不如GO/NodeJS革新。顺便说句,我们拍卖的PHP程序员工资可一点都不低……

如果搞web,继续php吧。从不觉得php性能是个问题,以后更不会。

写了两个月的laravel,发现很强大。。。入门比较高。。搞起来还是不错得。。

诚然php有好的代码,但是Rails更鼓励人们写好的代码,php不是。拍黄片这个名字不是白叫。

首先:
任何一个做web开发3年以上的人员,都可以轻松将php替换为如下:python,ruby,go,node...
其次:
如果学习过其它语言,会发现php这门语言很混乱,不光是表面的函数调用,而且内部机制没有一个明显的对象模型,无法给人一种:"我只要了解了这个语言的对象模型,任何代码都能看得懂",这种自信的感觉,没错,我说的就是js或者ruby的对象模型...
最后:
写php真的不会想写出好代码,而ror的DRY原则,则是最基本的提醒,有总比没有好,更不用说写单元测试了

喜欢python不喜欢ruby,学了挺长时间的python 3,后来学了一点框架,webpy,django,tornado都入门了,然后后来发现国内好多公司用的都是python 2.× ,但是我想写2.x的代码,所以后来决定学了nodejs。。。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

Is the conversion speed fast when converting XML to PDF on mobile phone? Is the conversion speed fast when converting XML to PDF on mobile phone? Apr 02, 2025 pm 10:09 PM

The speed of mobile XML to PDF depends on the following factors: the complexity of XML structure. Mobile hardware configuration conversion method (library, algorithm) code quality optimization methods (select efficient libraries, optimize algorithms, cache data, and utilize multi-threading). Overall, there is no absolute answer and it needs to be optimized according to the specific situation.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

How to convert XML files to PDF on your phone? How to convert XML files to PDF on your phone? Apr 02, 2025 pm 10:12 PM

It is impossible to complete XML to PDF conversion directly on your phone with a single application. It is necessary to use cloud services, which can be achieved through two steps: 1. Convert XML to PDF in the cloud, 2. Access or download the converted PDF file on the mobile phone.

What is the function of C language sum? What is the function of C language sum? Apr 03, 2025 pm 02:21 PM

There is no built-in sum function in C language, so it needs to be written by yourself. Sum can be achieved by traversing the array and accumulating elements: Loop version: Sum is calculated using for loop and array length. Pointer version: Use pointers to point to array elements, and efficient summing is achieved through self-increment pointers. Dynamically allocate array version: Dynamically allocate arrays and manage memory yourself, ensuring that allocated memory is freed to prevent memory leaks.

Is there any mobile app that can convert XML into PDF? Is there any mobile app that can convert XML into PDF? Apr 02, 2025 pm 08:54 PM

An application that converts XML directly to PDF cannot be found because they are two fundamentally different formats. XML is used to store data, while PDF is used to display documents. To complete the transformation, you can use programming languages ​​and libraries such as Python and ReportLab to parse XML data and generate PDF documents.

How to convert xml into pictures How to convert xml into pictures Apr 03, 2025 am 07:39 AM

XML can be converted to images by using an XSLT converter or image library. XSLT Converter: Use an XSLT processor and stylesheet to convert XML to images. Image Library: Use libraries such as PIL or ImageMagick to create images from XML data, such as drawing shapes and text.

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

See all articles