ruby与python

(Ruby vs Python)

If we talk about Ruby and Python, they both are high-level programming languages. They both have some similarities and dissimilarities

Ruby和Python ,它们都是高级编程语言。 另一方面,它们都有一些相似之处和不同之处。 让我们先谈谈它们的相似之处。

(Similarities of Ruby and Python)

  • You can develop software from both of them and distribute them without paying any kind of license fees.
    您可以使用它们两者来开发软件并进行分发,而无需支付任何许可费用。
  • Both the languages are high-level scripting language which means you don’t need to compile their programs.
    两种语言都是高级脚本语言,这意味着您无需编译它们的程序。
  • Both the language provides you to use any variable without declaring it first, it means that they are dynamically typed or it can be said that the data type of variable is decided by the data it contains.
    两种语言都提供您使用变量而不先声明它的意思,这意味着它们是动态类型的,或者可以说变量的数据类型由它包含的数据决定。
  • Ruby and Python are easy to use by the distributed teams where few people might be working on Linux and some may be working with Windows. They both provide the feature of "Cross-platform".
    分布式团队易于使用Ruby和Python,在分布式团队中,可能很少有人在Linux上工作,而有些人可能在Windows上工作。 它们都提供“跨平台”功能。
  • Both the languages are used for developing web applications and are a server-side scripting language.
    两种语言都用于开发Web应用程序,并且都是服务器端脚本语言。

(Dissimilarities of Ruby and Python)

  • Learning the languages: If we talk about, how fast one can grasp the concepts of Ruby and Python, then one can find that Python is easy to learn in comparison with Ruby. Python is quicker to learn.
    学习语言
  • Object-Oriented: When it comes to Python, it is not fully object-oriented but in Ruby, everything is considered as an object. So we can conclude that Ruby is a fully object-oriented programming language.
    面向对象
  • IDEs: You can write a python program in multiple Integrated development environments but You can only use ExclipseIDE to write and run a Ruby code.
    IDE
  • Mixins: Ruby supports the concept of mixins whereas it is not supported in Python.
    Mixins
  • Frameworks for Web development: Ruby uses Ruby on Rails for developing web applications whereas Python uses Django.
    Web开发框架
  • Library: Python is rich in the library in comparison with Ruby. You get more predefined functions in Python’s library. Ruby does have methods but they are less in numbers.
  • Unset a variable: In python, as long as the variable is in scope, it is present in the symbol table, whereas, in Ruby, a variable cannot be unset if it is set for once.
    取消设置变量
  • Anonymous method: In Ruby, blocks, procs, and lambdas are supported whereas in Python only lambdas are supported in the form of anonymous methods.
    匿名方法
  • Modification: In Ruby, you can modify the built-in classes as per your requirements whereas this is not the case of Python.
    修改
  • Usage: Google, Dropbox, Instagram, Mozilla, Yahoo, Venom, YouTube are some application which works through python whereas applications like Apple, GitHub and Twitter use Ruby.
    用法

翻译自: https://www.includehelp.com/ruby/ruby-vs-python-similarities-and-dissimilarities.aspx

ruby与python