search
HomeBackend DevelopmentPHP TutorialAPP创业项目后端语言选择

对于刚创业的团队,资金和人才配备没有成型的大公司充分,因此在技术选型上须充分思考。本文针对后端语言选择问题作出分析,不会涉及到语言优劣问题,笔者认为语言遵循优胜劣汰规则,能够继续生存下来的语言都是好的语言,只是各自适合解决不同的问题。

APP项目的后端语言通常有:JAVA、PHP、Python、Ruby、.NET、JS等。笔者在项目中只接触过JAVA、PHP、Python和JS,对于Ruby和.NET没有实践方面的认知,那么首先排除一下他们俩。据说Ruby以敏捷著称,但是它还是太年轻了,在创业项目上我更愿意选择一个成熟稳健的技术。.NET出自微软,从asp开始微软在WEB后端开发就非常优秀,但是一直不是互联网公司的首选,正如服务器领域Windows一直不是首选一样。NodeJS在JS风靡全栈的潮流下,也成为了很多团队的选择之一,但是不选择它的原因跟Ruby一样。那么就剩下JAVA、PHP和Python了。

JAVA作为一个全栈语言,WEB后端、Android、数据分析、机器学习、桌面软件等都是手到擒来,特别是一些体制内政府部门的项目,他们会指定使用JAVA和Oracle。

如果团队有JAVA的成手,那么它是不二的选择。但是我们团队一直不使用JAVA作为后端开发,只有一个原因,JAVA编译调试太慢了,当你修改了一些程序后,想测试下,你必须重新编译并且重启服务器,虽然这些IDE都自动帮你做了,但这仍然是需要时间的。

PHP作为后端的老牌语言,百度、微博等公司的很多大小项目都是基于它。

后端你要用到的它都有,兼顾幼儿园到大学各个级别的开发人员。也正因为此,一些程序员觉得PHP写的程序不上档次,实际上PHP跟JAVA语言一样,也可以写得很高大上。

PHP是脚本语言,编写后测试只需刷新浏览器即可,这也带来了一个问题,软件没法打包成商业软件销售,一旦销售出去,源代码就出去了。然而近年出现的Phalcon框架,其开发团队推出的Zephir语言,可以跟PHP语言一样编写C代码,最后可以编译为二进制的PHP扩展,不但保护了源代码,还提升了运行性能。

PHP拥有各种优秀的框架,Phalcon、Laravel、Yii、CakePHP、CodeIgnitor、Yaf、Zend Framework,有的组件丰富,有的仅实现了MVC,轻重灵活。

但PHP离开了后端开发几乎没有什么作为了。

Python作为一个无比灵活的语言,凭借其脚本语言的灵活性和不错的性能优势,近年来也成为后端开发的选择之一。

它具有PHP脚本语言的优势,又几乎是全栈的,可以写桌面软件、数据分析、机器学习,甚至有人用它写APP客户端。

Python不是为后端开发而生的,但是Django、Flask、Webpy等框架让它在后端开发方面成为可能,而且还非常出色。Django框架虽然优秀,但是有点过了,帮助开发者实现的过多了,将开发者限死在一个框框中,常常会让你觉得进退两难。例如ORM机制,简单写些数据读写还不错,涉及到复杂的关联查询就费劲了;还有它的用户模块,直接帮开发者实现了用户、组、权限管理、认证登录等一系列功能,小项目上手就不用做用户模块了,但是大项目用户模块需要非常灵活,例如微信、微博等第三方登陆,以及跨项目共享Session。

Python的服务端程序依赖于uwsgi和nginx,uwsgi作为python的服务器软件来处理Http请求,由于其功能、性能和稳定性问题,通常会使用nginx作为其前端服务器,两层服务器架构对于小网站来讲,增加了维护困难。

既然是脚本语言,源代码就难以保护。

是否使用框架?

一定要使用框架,为了便于项目合作和项目交接,基于框架编写的代码更具有规范性和可读性。

是否需要自己开发框架?

如果团队水平已经到了自己编写框架的程度,本文也就不需要看了。能写成一个优秀的框架可以写,如果只是刚刚学习写,那么还是不要在创业项目上尝试了。

简要说明了三种语言适用性,具体选择首要根据业务和团队客观因素,已有成熟技术体系则无需刻意更改,对于刚组建的创业团队,如果项目较大,我推荐使用PHP,框架推荐Laravel或者Phalcon,调试能力较强的推荐Phalcon,服务器软件使用Nginx;如果项目较小,我推荐使用Python,框架推荐Django,充分遵守Django的规则,服务器软件用uwsgi和Nginx。

——————————————–

本站除标注[FW]和资讯文章外都为原创文章,转载请注:

转载来源:Coming X

原文链接: APP创业项目后端语言选择

——————————————–

Statement
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
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools