坚持使用PHP还是学习Go语言?

huangapple go评论102阅读模式
英文:

Stick with PHP or learn Go-lang?

问题

我在大学期间学习了PascalCRedHat Linux/Unix

为了尽快找到工作,我开始学习Microsoft Visual Basic 6.0以提高开发速度等。那时候,使用C会更耗时,而且我对于工作目的不太自信,因为大多数公司都要求快速开发。

之后,我在公司遇到了问题,因为他们需要Web应用程序,于是我开始使用PHP,这也很好,因为客户需要Web项目,并且他们希望在短时间内获得类似Google的应用程序,而PHP可以提供这种速度,并且有庞大的社区支持。

我需要Go语言的原因如下:

  • PHP的语法与C/Pascal相比更友好。

  • 我很高兴学习Python,但它的语法与C非常不同。
    这对我来说不太能接受,也无法更好地学习它。

  • 我尝试学习Ruby,至少可以了解Python的语法,但我因为比PHP慢2倍而放弃了Ruby。

因此,

对于Web开发+Gtk,Go语言是速度与PHP和Ruby的完美选择吗?

英文:

I have learned in my University time Pascal and C and RedHat Linux/Unix .

To get quickly one job, i started learning Microsoft Visual Basic 6.0 for speed in development etc. In that time, with C its like more time consuming and i was not confident to use it for job purpose, where most of the companies demand fast/rapid development.

After that i had problems with my companies because they want web applications, then i started using PHP which is also great, because customers demand web projects and they expect Google like applications in short time frame, which is doable because PHP gives that speed and its huge community.

To explain my need for Go-lang is following:

  • PHP the syntax is friendly compared to C/Pascal.

  • I was very happy to learn Python, but its syntax is very much different then C.
    Which just not gonna work with me to accept and really learn it better and better.

  • I have tried to learn Ruby, at-least so that i can have the knowledge of Python
    like syntax, but i really skipped Ruby because of 2x time slower then PHP

Therefore,

Is Go-lang is the perfect choice for SPEED vs PHP vs Ruby, for Web development + Gtk?

答案1

得分: 3

哎呀,我很想拥有一个可以在所有情况下使用的资产,但在计算机世界中这是不可能的。你将不得不学习两种或更多的语言。

PHP被广泛使用,所以你可以继续使用它。如果你能够使用它创建出不错的Web应用程序,那就继续使用吧。我建议你也学习C/C++,这样你就可以使用它编写任何高性能模块,并从你的PHP代码中调用它们。对于你的Web应用程序来说,这可能是最好的选择。

如果你想要编写桌面应用程序,我认为学习C++和Qt(并且看看Wt)会是最好的选择(因为你似乎是一个Linux开发者),或者学习C# / VB.NET用于Windows。

对于移动设备,学习C/C++是必要的,因为你可以使用它编写应用程序,无论使用哪个平台,即使你不得不使用一些平台相关的扩展 - 你要么学习Android的Java,要么学习iOS的Objective-C,或者(我们还不确定微软为Windows Phone 8计划了什么,但我听说他们再次喜欢本地代码,也就是C++/CX)。你可以看出我要说什么了吧!

总之,如果你对PHP满意,就继续使用它吧。有很多运行PHP的代码,所以你不像使用一些前沿或很少使用的语言。

英文:

Alas, I'd love to have 1 asset that I could use for all conditions but it's just not available in the world of computing. You're going to have to learn 2 or more.

PHP is very widely used, so you might as well stick with it. If you can create decent webapps using it, go for it. I would suggest learning C/C++ too so you can write any high-performance modules using that and call them from your PHP code. That's probably the best of all worlds for your webapps.

If you wanted to write for desktops, I think you'll be best off learning C++ with Qt (and look at Wt) (as it appears you're a Linux dev), or C#/VB.NET for Windows.

For mobiles, learn C/C++ as you can write apps in that no matter which platform even if you have to put up with some platform-dependant extensions - you either have to learn Java for Android, Objective-C for iOS, or (well we're not quite sure what MS has planned for Windows Phone 8, but I hear they like native code again, that means C++/CX). You can see where I'm going with this!

so anyway, if you're happy with PHP then keep with it. There is a ton of code out there that runs PHP so it's not like you're working with some bleeding-edge or hardly-used obscure language.

答案2

得分: 1

好的,这个问题显然是非常主观的,但我发现PHP总是可以尽可能快。我花了很多时间研究如何进一步优化我的代码。

一些好的优化提示:http://labs.phurix.net/posts/50-php-optimisation-tips-revisited

当然,最终一切都取决于你为了额外的速度愿意做什么,以及什么是实际可行的。

英文:

Well, this question is obviously quite subjective, but I find PHP can always be as fast as it needs to be. I spend a lot of time looking up on how my code can be optimised further.

Some good optimisation tips: http://labs.phurix.net/posts/50-php-optimisation-tips-revisited

Of course, in the end, everything depends on what you're willing to do for extra speed and what's practical or not.

huangapple
  • 本文由 发表于 2012年2月11日 22:48:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/9241091.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定