PHP 是最好的语言?关于 PHP 研发将来的 6 点意见
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/dkwuWwLoRKibsOl5cFwAxljiafKzno3KAiaex9Me5mXVptJ3THxXfV8uM1LPcibjfbjbibZ2cbTiaaXpOPESc3vUTdYg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP <span style="color: black;">为何</span>是最好的语言?你肯定听过这个段子:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">女子</span>:“你能让这个论坛的人都吵起来, 我今晚就跟你走。” </span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">程序员: “PHP是最好的语言!”</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">论坛炸锅了, <span style="color: black;">各样</span>吵架…</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">女子</span>:“ 服了你了, <span style="color: black;">咱们</span>走吧你想干啥都行。”</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">程序员: “今天不行, 我<span style="color: black;">必定</span>要说服<span style="color: black;">她们</span>, PHP必须是最好的语言。”</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">上面虽然是程序员的玩笑梗,但“PHP 是最好的语言” 这句话最早可能出自 2001 年 7 月的 PHP 官方文档。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP is the best languages for web programming , but what about other languages ?</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP 是最好的网络编程语言,<span style="color: black;">那样</span>其他语言呢?</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">—— PHP and other languages</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">抛开玩笑梗,认真<span style="color: black;">来讲</span>,PHP 的确<span style="color: black;">叫作</span>得上最好的语言之一。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">首要</span>,PHP 入门简单,容易<span style="color: black;">把握</span>,对新手友好,<span style="color: black;">况且</span>程序健壮性好,<span style="color: black;">不易</span><span style="color: black;">显现</span>像 Java 、 C++ 等其他语言那样<span style="color: black;">繁杂</span>的问题,如内存泄漏和 Crash ,跟踪调试相对<span style="color: black;">容易</span><span style="color: black;">非常多</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">再者,功能函数应有尽有,不需要重新造轮子。PHP 官方<span style="color: black;">供给</span>的标准库非常强大,<span style="color: black;">各样</span>功能函数<span style="color: black;">包含</span>MySQL、Memcache、Redis、GD图形库、CURL、XML、JSON等等都能找到,免除了<span style="color: black;">研发</span>者到处找库的<span style="color: black;">懊恼</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">另一</span>,PHP 文档<span style="color: black;">仔细</span>易懂,<span style="color: black;">每一个</span>函数都有仔细的说明和<span style="color: black;">运用</span>示例。第三方类库和工具、代码、项目<span style="color: black;">亦</span>很丰富。开发者<span style="color: black;">能够</span>快速、<span style="color: black;">有效</span>地<span style="color: black;">运用</span> PHP 编写<span style="color: black;">研发</span>各类软件。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">能够</span>说,<span style="color: black;">日前</span>为止市面上仍然<span style="color: black;">无</span><span style="color: black;">显现</span>比 PHP 更简单易用的编程语言。然而,自 PHP 诞生到<span style="color: black;">此刻</span>的 20 <span style="color: black;">数年</span>间,从 Web 时代兴起到移动互联网退潮,互联网<span style="color: black;">行业</span><span style="color: black;">各样</span>编程语言和技术层出不穷, Node.js 、 GO 、 Python <span style="color: black;">持续</span>地在挑战 PHP 的地位。PHP 语言的局限<span style="color: black;">亦</span><span style="color: black;">起始</span>凸显,PHP 语言<span style="color: black;">将来</span>在哪里?PHP 程序员当<span style="color: black;">怎样</span>应对<span style="color: black;">将来</span>的变革?</span></p>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">性能问题</span></strong></span></p>
</h2>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP 最令人诟病的一点非性能莫属,<span style="color: black;">做为</span>一门动态脚本语言,PHP 的优点是<span style="color: black;">研发</span>方便效率高,缺点<span style="color: black;">便是</span>性能差。在密集运算的场景下比 C 、 C++ 相差几十倍<span style="color: black;">乃至</span>上百倍。<span style="color: black;">另一</span> PHP 不<span style="color: black;">能够</span>直接操作底层,需要依赖扩展库来<span style="color: black;">供给</span> API 实现。</span></p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">运用</span> PHP7</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP7 版本对 Zend 引擎做了<span style="color: black;">海量</span>修改,大幅<span style="color: black;">提高</span>了 PHP 语言的性能,<span style="color: black;">运用</span> PHP7 <span style="color: black;">能够</span>使程序性能瞬间翻倍。即使是 WordPress <span style="color: black;">这般</span>重量级的软件运行在 PHP7 都能有上千 QPS ,相当于一台服务器<span style="color: black;">每日</span>就能处理 8000 万次请求。<span style="color: black;">运用</span> PHP7 ,做好 MySQL 优化,<span style="color: black;">运用</span> Memcache 和 Redis 进行加速,这套技术架构完全<span style="color: black;">能够</span>应对相当大规模的系统。除了某些亿级用户的平台之外,<span style="color: black;">通常</span>规模的系统完全<span style="color: black;">无</span>压力。</span></p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">学习 C/C++/GO</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP 程序员<span style="color: black;">能够</span>学习一门静态编译语言<span style="color: black;">做为</span><span style="color: black;">弥补</span>实现动静互补,C/C++/Go 都是不错的<span style="color: black;">选取</span>。<span style="color: black;">况且</span>静态语言的编程体验与动态语言完全<span style="color: black;">区别</span>,学习过程<span style="color: black;">能够</span>让你得到更大的<span style="color: black;">提高</span>。<span style="color: black;">把握</span> C/C++ 语言后,还<span style="color: black;">能够</span>阅读 PHP 、 Swoole 、 Nginx 、Redis 、 Linux内核 等开源软件的源码,<span style="color: black;">认识</span>其底层运行原理。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">此刻</span>最新版本的Swoole<span style="color: black;">供给</span>了C++扩展模块的支持,封装了Zend API,用C++操作PHP变得很简单,<span style="color: black;">能够</span>用C++实现PHP扩展函数和类。</span></p>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">管理规范</span></strong></span></p>
</h2>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">Composer</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Composer <span style="color: black;">显现</span>后,PHP 的依赖管理<span style="color: black;">能够</span>变得非常简单。程序内依赖<span style="color: black;">有些</span>类库和框架,直接<span style="color: black;">运用</span> Composer 引入<span style="color: black;">就可</span>,<span style="color: black;">经过</span><span style="color: black;">运用</span> composer update 安装依赖的包。<span style="color: black;">处理</span>了过去加载<span style="color: black;">外边</span>库的<span style="color: black;">各样</span><span style="color: black;">困难</span>。Composer <span style="color: black;">亦</span>有国内镜像,速度非常快。<span style="color: black;">此刻</span>绝大部分PHP开源的项目都<span style="color: black;">供给</span>了 Composer 的支持,<span style="color: black;">意见</span><span style="color: black;">大众</span>在项目中<span style="color: black;">运用</span> Composer 来<span style="color: black;">处理</span> PHP 代码包管理的问题,不要再<span style="color: black;">运用</span>下载源码、手工 include 的原始<span style="color: black;">办法</span>。</span></p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">PSR</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PSR 是 http://www.php-fig.org/ 组织制定的PHP语言<span style="color: black;">研发</span>规范,约定了<span style="color: black;">非常多</span>方面的规则,如命名空间、类名规范、编码风格标准、Autoload、公共接口等。<span style="color: black;">此刻</span><span style="color: black;">已然</span><span style="color: black;">作为</span>PHP技术社区事实上的标准了。<span style="color: black;">非常多</span>知名的 PHP 框架和类库都遵守了 PSR 规范。PHP <span style="color: black;">研发</span>者应当学习<span style="color: black;">把握</span> PSR 规范,在<span style="color: black;">研发</span>程序时应当<span style="color: black;">尽可能</span>遵循 PSR 规范。</span></p>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">应用扩展</span></strong></span></p>
</h2>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">Vue.js</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP 程序员除了写后台程序之外,还有很大一部分工作在展现层,和浏览器前端打交道。2017 年你还在用 jQuery 操作 DOM 实现界面渲染吗?<span style="color: black;">已然</span>完全 out 了。<span style="color: black;">此刻</span>用 Vue.js <span style="color: black;">能够</span>非常方便地实现数据和 DOM 元素的绑定。<span style="color: black;">经过</span> Ajax 请求后台接口返回数据后,更新前端数据自动实现界面渲染。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">倘若</span>你<span style="color: black;">不但</span>要写 Web 程序,<span style="color: black;">同期</span>还<span style="color: black;">期盼</span>兼顾 Android 、IOS 、PC 客户端等平台,React Native 是一个不错的<span style="color: black;">选取</span>。</span></p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">Swoole</span></strong></p>
</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP 还局限于做 Web 网站吗?Swoole 是一个异步并行的通信引擎,<span style="color: black;">做为</span> PHP 的扩展来运行。Node.js 的异步回调 Swoole 有,Go语言的协程 Swoole <span style="color: black;">亦</span>有,这完全颠覆了对 PHP 的认知。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">运用</span> Swoole PHP <span style="color: black;">能够</span>实现常驻内存的 Server 程序,<span style="color: black;">能够</span>实现 TCP 、 UDP 异步网络通信的编程<span style="color: black;">研发</span>。过去PHP只能做一个 Web 网站,<span style="color: black;">此刻</span><span style="color: black;">运用</span> Swoole <span style="color: black;">能够</span>做 Java 、C++ <span style="color: black;">才可</span>实现的通信服务,<span style="color: black;">例如</span> WebSocket 即使通信、聊天、推送服务器、RPC 远程调用服务、网关、代理、游戏服务器等。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">能够</span>说,Swoole 是每位 PHPer 都需<span style="color: black;">把握</span>的<span style="color: black;">必须</span>技能。但 Swoole 的<span style="color: black;">运用</span>门槛对新手<span style="color: black;">来讲</span>相对较高,需要付出<span style="color: black;">必定</span>的精力成本。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">因此</span>这一次,<span style="color: black;">咱们</span>邀请了 Swoole 开源项目的创始人 —— 韩天峰参加「上海源创会」,为<span style="color: black;">咱们</span>介绍 Swoole 3.0 全新的 PHP 协程编程模式,以及 Swoft 协程框架的<span style="color: black;">运用</span>,基于 Swoft Cloud <span style="color: black;">供给</span>的各类组件实现 PHP 微服务架构。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">除此之外,5 月 27 日(周日)上海源创会 还邀请了黄励博(又拍云系统<span style="color: black;">研发</span>高级工程师)、曲骏(安畅混合云服务架构团队负责人)、朱明智(个推B2D<span style="color: black;">开发</span>部平台<span style="color: black;">开发</span>专家)、许雪里(XXI系列开源软件作者,美团点评工程师)四位行业大牛。以架构为核心,与你进行一场关于面对面的技术对话。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">扫码报名,与业内大咖和<span style="color: black;">更加多</span>小伙伴当面交流。(<span style="color: black;">微X</span>)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">注:以上内容有引用和参考 2017年PHP程序员<span style="color: black;">将来</span>路在何方 韩天峰</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">链接:https://segmentfault.com/a/1190000008888700?utm_source=tuicool&utm_medium=referral</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_gif/dkwuWwLoRKicLMSBQwMJh2CAFYq0Vic0Q8Z7oicWvA5lqA69VOhOjbu7pOMw2wl4j2HgzQ65l8PGXmaciatDUJT95w/640?wx_fmt=gif&tp=webp&wxfrom=5&wx_lazy=1" style="width: 50%; margin-bottom: 20px;"></p><span style="color: black;"><span style="color: black;">举荐</span>阅读</span>
<h2 style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;">被 Oracle 玩弄于股掌,Java 会<span style="color: black;">因此呢</span>被 Kotlin 取代吗?</a></h2>
<h2 style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;">微软<span style="color: black;">最终</span>修复了 Notepad 长达 33 年的换行“Bug”</a></h2>
<h2 style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;">没想到吧!Intellij IDEA 神器还有这些小技巧</a></h2>
<h2 style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;">ARM 授权<span style="color: black;">花费</span>太贵</span></a><span style="color: black;">,</span><a style="color: black;"><span style="color: black;">科技巨头欲转向开源架构 RISC-V</span></a></h2>
<h2 style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;">谷歌<span style="color: black;">最终</span>开放 ".app" 顶级域名注册</a></h2>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></p><span style="color: black;">点击<strong style="color: blue;">“阅读原文”</strong>查看<span style="color: black;">更加多</span>精彩内容</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></p>
你字句如珍珠,我珍藏这份情。 期待与你深入交流,共探知识的无穷魅力。 网站建设seio论坛http://www.fok120.com/ 期待你更多的精彩评论,一起交流学习。
页:
[1]