我应该学什么? Python还是Ruby?

时间:2021-01-31 07:10:44

I am a PHP developer so, mainly a web developer, and I'm used to work with MVC. I use CakePHP, which is a powerful PHP framework to develop web apps and such.

我是一名PHP开发人员,主要是一名Web开发人员,我习惯使用MVC。我使用CakePHP,它是一个功能强大的PHP框架,用于开发Web应用程序等。

I'm comming from the web scene and I really want to keep my work on the web but I also would like to learn a new programming language to apply there. Not only that, but I also would like that this language would enable me to work offline with stand alone applications.

我是从网络场景出来的,我真的想把我的工作留在网上,但我也想学习一种新的编程语言。不仅如此,我还希望这种语言能让我在独立应用程序中脱机工作。

I really like Python and already know some stuff about it. The problem is that I don't see a really good tool to work with it on the web. Django, for me, has a terrible API and although we can find some other really cool projects like web.py, when I compare that to what I get with PHP and CakePHP, I don't get that excited.

我非常喜欢Python并且已经了解了一些关于它的东西。问题是我没有看到一个非常好的工具在网络上使用它。对我来说,Django有一个糟糕的API,虽然我们可以找到一些其他非常酷的项目,比如web.py,但当我将它与PHP和CakePHP相比时,我并没有那么兴奋。

On the other hand, we have Ruby which is a scripting language just like Python. I don't know how far you can go with desktop development with Ruby compared with Python. But I know that Rails is a extremely cool tool to use on webdev...

另一方面,我们使用Ruby,它就像Python一样是一种脚本语言。我不知道与Python相比,使用Ruby进行桌面开发有多远。但我知道Rails是一个非常酷的工具,可以在webdev上使用...

So my question is: should I learn Python or Ruby? If one or other, why? Thanks!

所以我的问题是:我应该学习Python还是Ruby?如果是其中一个,为什么?谢谢!

P.S.: My english can be a little bit confusing, but I guess you can understand [hopefully]

P.S。:我的英语有点令人困惑,但我想你可以理解[希望]

3 个解决方案

#1


This is a choice I had to make (also moving from php), and I chose ruby for its more elegant syntax, such as built-in literal regexps and hashes (Dicts in python?), as well as its powerful iterators.

这是我必须做出的选择(也是从php移动),我选择ruby来获得更优雅的语法,例如内置的文字正则表达式和散列(python中的Dicts?),以及它强大的迭代器。

I also did not like the extensive use of __name__ type method names, and don't like the whitespace restrictions.

我也不喜欢大量使用__name__类型的方法名,并且不喜欢空白限制。

As you can see, it was a 100% personal decision, I don't think there is a right answer here though, choosing what feels right is a safe choice!

正如你所看到的,这是一个100%的个人决定,我不认为这里有正确的答案,选择合适的选择是一个安全的选择!

#2


Don't like Django? Python has a lot of choices for working on the web. Some of them are listed at Fred's Shack.

不喜欢Django? Python在Web上有很多选择。其中一些列在Fred's Shack。

#3


Yahoo employee, Jeremy Zawodny, has asked the same question here. You can get a good insight of both languages from comments for his question.

雅虎员工Jeremy Zawodny在这里提出了同样的问题。您可以从他的问题的评论中获得对这两种语言的良好洞察力。

#1


This is a choice I had to make (also moving from php), and I chose ruby for its more elegant syntax, such as built-in literal regexps and hashes (Dicts in python?), as well as its powerful iterators.

这是我必须做出的选择(也是从php移动),我选择ruby来获得更优雅的语法,例如内置的文字正则表达式和散列(python中的Dicts?),以及它强大的迭代器。

I also did not like the extensive use of __name__ type method names, and don't like the whitespace restrictions.

我也不喜欢大量使用__name__类型的方法名,并且不喜欢空白限制。

As you can see, it was a 100% personal decision, I don't think there is a right answer here though, choosing what feels right is a safe choice!

正如你所看到的,这是一个100%的个人决定,我不认为这里有正确的答案,选择合适的选择是一个安全的选择!

#2


Don't like Django? Python has a lot of choices for working on the web. Some of them are listed at Fred's Shack.

不喜欢Django? Python在Web上有很多选择。其中一些列在Fred's Shack。

#3


Yahoo employee, Jeremy Zawodny, has asked the same question here. You can get a good insight of both languages from comments for his question.

雅虎员工Jeremy Zawodny在这里提出了同样的问题。您可以从他的问题的评论中获得对这两种语言的良好洞察力。