为什么人们想要使用ruby而不是python,反之亦然?

时间:2022-05-23 05:30:13

I wanted to know, while deciding which language or technology to use for implementing an idea; a design, what are the factors involved in making a decision? Specifically talking about popular scripting languages, why would one choose to use ruby over python or perl or vice-versa? All these scripting languages have proved their worth, so how does one decide?

我想知道,同时决定使用哪种语言或技术来实现一个想法;设计,做出决定涉及哪些因素?特别是谈论流行的脚本语言,为什么选择使用ruby而不是python或perl,反之亦然?所有这些脚本语言都证明了它们的价值,那么一个人如何决定呢?

4 个解决方案

#1


I just came across this comparison, b/w Ruby and Python, which is in terms of performance and memory management.

我刚刚遇到了这个比较,不管是Ruby还是Python,它在性能和内存管理方面都是如此。

A fair comparison can be found here. Further, I tend to agree with all the three answers above.

可以在这里找到公平的比较。此外,我倾向于同意上述所有三个答案。

#2


Besides any hype that one language receives and the other doesn't, I think two factors play a role: mastership of the language, and availability of libraries. If you know Ruby already, you are more likely to use it again, and also to recommend it when asked; likewise for Python. Wrt. libraries: if you want to use Ruby-on-Rails (which you may have chosen for some reason), you have to use Ruby; likewise, if you want to use Django, you have to use Python. Etc.

除了一种语言所接受的炒作而另一种语言没有,我认为有两个因素起作用:语言的掌握和图书馆的可用性。如果您已经了解Ruby,那么您更有可能再次使用它,并在被问及时推荐它;同样适用于Python。 WRT。库:如果你想使用Ruby-on-Rails(你可能因某些原因选择了它),你必须使用Ruby;同样,如果你想使用Django,你必须使用Python。等等。

#3


It's going to depend a lot on what you want to do (the stock answer).

这将取决于你想做什么(股票回答)。

There aren't huge differences between Ruby and Python - both are object oriented languages with more similarities than differences, really. I'd suggest you try each of them out for a moderate sized programming project - say something that might take 2 or 3 hours. You'll notice some things about each of them that will perhaps rub you the wrong way (indentation as syntax puts some people off when it comes to Python, for example.) A lot of the choice is going to come down to your personal tastes.

Ruby和Python之间没有太大的区别 - 两者都是面向对象的语言,它们之间的相似性比差异更大。我建议你尝试一下中等规模的编程项目 - 说一些可能需要2到3个小时的事情。你会注意到有关它们的一些内容可能会以错误的方式使用(例如,缩进因为语法会让一些人关注Python)。很多选择都取决于你的个人品味。

If this is a standalone project you're thinking of implementing then it probably doesn't matter which of the two languages you choose. If you need to interact with some existing infrastructure then it may matter a great deal - for example, if you need to work with some Rails related infrastructure then you'll probably want to go with Ruby, if it's Django, then you'll want Python.

如果这是一个你想要实现的独立项目,那么你选择哪两种语言可能并不重要。如果你需要与一些现有的基础设施进行交互,那么它可能很重要 - 例如,如果你需要使用一些与Rails相关的基础设施,那么你可能想要使用Ruby,如果它是Django,那么你会想要蟒蛇。

#4


I would look at these factors when making a decision -

我在做出决定时会考虑这些因素 -

Your Comfort Level and your teams

您的舒适程度和您的团队

Your Ability and your teams

你的能力和你的团队

Your Resources

Requirements

Platform Maturity

Support

#1


I just came across this comparison, b/w Ruby and Python, which is in terms of performance and memory management.

我刚刚遇到了这个比较,不管是Ruby还是Python,它在性能和内存管理方面都是如此。

A fair comparison can be found here. Further, I tend to agree with all the three answers above.

可以在这里找到公平的比较。此外,我倾向于同意上述所有三个答案。

#2


Besides any hype that one language receives and the other doesn't, I think two factors play a role: mastership of the language, and availability of libraries. If you know Ruby already, you are more likely to use it again, and also to recommend it when asked; likewise for Python. Wrt. libraries: if you want to use Ruby-on-Rails (which you may have chosen for some reason), you have to use Ruby; likewise, if you want to use Django, you have to use Python. Etc.

除了一种语言所接受的炒作而另一种语言没有,我认为有两个因素起作用:语言的掌握和图书馆的可用性。如果您已经了解Ruby,那么您更有可能再次使用它,并在被问及时推荐它;同样适用于Python。 WRT。库:如果你想使用Ruby-on-Rails(你可能因某些原因选择了它),你必须使用Ruby;同样,如果你想使用Django,你必须使用Python。等等。

#3


It's going to depend a lot on what you want to do (the stock answer).

这将取决于你想做什么(股票回答)。

There aren't huge differences between Ruby and Python - both are object oriented languages with more similarities than differences, really. I'd suggest you try each of them out for a moderate sized programming project - say something that might take 2 or 3 hours. You'll notice some things about each of them that will perhaps rub you the wrong way (indentation as syntax puts some people off when it comes to Python, for example.) A lot of the choice is going to come down to your personal tastes.

Ruby和Python之间没有太大的区别 - 两者都是面向对象的语言,它们之间的相似性比差异更大。我建议你尝试一下中等规模的编程项目 - 说一些可能需要2到3个小时的事情。你会注意到有关它们的一些内容可能会以错误的方式使用(例如,缩进因为语法会让一些人关注Python)。很多选择都取决于你的个人品味。

If this is a standalone project you're thinking of implementing then it probably doesn't matter which of the two languages you choose. If you need to interact with some existing infrastructure then it may matter a great deal - for example, if you need to work with some Rails related infrastructure then you'll probably want to go with Ruby, if it's Django, then you'll want Python.

如果这是一个你想要实现的独立项目,那么你选择哪两种语言可能并不重要。如果你需要与一些现有的基础设施进行交互,那么它可能很重要 - 例如,如果你需要使用一些与Rails相关的基础设施,那么你可能想要使用Ruby,如果它是Django,那么你会想要蟒蛇。

#4


I would look at these factors when making a decision -

我在做出决定时会考虑这些因素 -

Your Comfort Level and your teams

您的舒适程度和您的团队

Your Ability and your teams

你的能力和你的团队

Your Resources

Requirements

Platform Maturity

Support