csdn ruby语言入门

Ruby is unique among object-oriented scripting languages. In a sense, it's a purist's language for those who love object-oriented languages. Everything, without exception, is automatically an object, whereas in other programming languages this isn't true.

在面向对象的脚本语言中, Ruby是独一无二的。 从某种意义上说,对于那些喜欢面向对象语言的人来说,这是一种纯粹主义者的语言。 所有内容无一例外都会自动成为对象,而在其他编程语言中,情况并非如此。

What is an object? Well, in a sense you can think of it in terms of building a car. If you have a blueprint for it, then an object is what's built from that blueprint. It contains all the attributes that the object holds (i.e. make, model, color) and the actions it can perform. But, even as a pure object-oriented language, Ruby doesn't sacrifice any usability or flexibility by leaving out features that aren't expressly related to object-oriented programming.

什么是物体? 好吧,从某种意义上讲,您可以从制造汽车的角度来考虑它。 如果您有一个蓝图,那么一个对象就是根据该蓝图构建的。 它包含对象拥有的所有属性(即品牌,型号,颜色)以及它可以执行的操作。 但是,即使作为纯粹的面向对象的语言,Ruby也不会通过遗漏与面向对象的编程没有明确关系的功能而牺牲任何可用性或灵活性。

设计Ruby ( Designing Ruby )

Ruby's architect Yukihiro Matsumoto (known simply as "Matz" on the web) designed the language to be simple enough for beginning programmers to use while also powerful enough for experienced programmers to have all the tools they'd need. It sounds contradictory, but this dichotomy is owed to Ruby's pure object-oriented design and Matz's careful selection of features from other languages such as Perl, Smalltalk, and Lisp.

Ruby的建筑师Yukihiro Matsumoto(在网络上简称为“ Matz”)设计的语言足够简单,适合初学者使用,同时也足够强大,适合经验丰富的程序员使用所需的所有工具。 这听起来是矛盾的,但是这种二分法归因于Ruby的纯面向对象设计以及Matz从其他语言(如Perl ,Smalltalk和Lisp)中精心选择的功能。

There are libraries for building all types of applications with Ruby: XML parsers, GUI bindings, networking protocols, game libraries and more. Ruby programmers also have access to the powerful RubyGems program. Comparable to Perl's CPAN, RubyGems makes it easy to import other programmers' libraries into your own programs.

有一些库可以使用Ruby构建所有类型的应用程序:XML解析器,GUI绑定,网络协议,游戏库等。 Ruby程序员还可以访问功能强大的RubyGems程序。 与Perl的CPAN相比 ,RubyGems可以轻松地将其他程序员的库导入到您自己的程序中。

Ruby 不是什么? ( What Is Ruby Not? )

Like any programming language, Ruby has its downsides. It's not a high-performance programming language. In that regard, Python's virtual machine design has a huge advantage. Also, if you're not a fan of the object-oriented methodology then Ruby isn't for you.

像任何编程语言一样,Ruby也有缺点。 它不是一种高性能的编程语言。 在这方面, Python的虚拟机设计具有巨大的优势。 另外,如果您不喜欢面向对象方法,那么Ruby就不适合您。

Though Ruby does have some features that fall outside the realm of object-oriented languages, it's not possible to create a non-trivial Ruby program without using the object-oriented features. Ruby doesn't always perform as well as other similar scripting languages in raw computing tasks. That being said, future versions will address these problems and alternate implementations, such as JRuby, are available as a workaround for these issues.

尽管Ruby的某些功能确实超出了面向对象语言的范围,但如果不使用面向对象的功能,就不可能创建一个平凡的Ruby程序。 在原始计算任务中,Ruby并不总是像其他类似的脚本语言那样表现出色。 话虽这么说,将来的版本将解决这些问题,并且可以使用替代实现(例如JRuby)作为这些问题的解决方法。

Ruby是如何使用的? ( How Is Ruby Used? )

Ruby is used in typical scripting language applications such as text processing and "glue" or middleware programs. It's suitable for small, ad-hoc scripting tasks that, in the past, may have been solved with Perl. Writing small programs with Ruby is as easy as importing the modules you need and writing an almost BASIC-like "sequence of events" type of program.

Ruby用于典型的脚本语言应用程序,例如文本处理和“胶水”或中间件程序。 它适用于过去可能已经用Perl解决的小型临时脚本任务。 使用Ruby编写小型程序就像导入所需的模块并编写几乎类似于BASIC的“事件序列”类型的程序一样容易。

Like Perl, Ruby also has first-class regular expressions, which makes text processing scripts a snap to write. The flexible syntax also aides in small scripts. With some object-oriented languages, you can get bogged down with verbose and bulky code, but Ruby leaves you free to simply worry about your script.

像Perl一样,Ruby也具有一流的正则表达式,这使得文本处理脚本易于编写。 灵活的语法还可以辅助小型脚本。 使用某些面向对象的语言,您可能会陷入冗长而笨拙的代码中,但是Ruby让您可以随意担心脚本。

Ruby is also suitable for larger software systems. Its most successful application is in the Ruby on Rails web framework, software which has five major subsystems, numerous minor pieces and a plethora of support scripts, database backends, and libraries.

Ruby也适用于大型软件系统。 它最成功的应用程序在Ruby on Rails Web框架中 ,该软件具有五个主要子系统,许多次要部分以及过多的支持脚本,数据库后端和库。

To aid the creation of larger systems, Ruby offers several layers of compartmentalization, including the class and module. Its lack of superfluous features allows programmers to write and use large software systems without any surprises.

为了帮助创建更大的系统,Ruby提供了几层分隔,包括类和模块。 它缺乏多余的功能,使程序员可以编写和使用大型软件系统而不会感到惊讶。

哪些技能对学习Ruby有帮助? ( What Skills Would Be Helpful for Learning Ruby? )

  • A solid understanding of object-oriented concepts. Ruby is an object-oriented language and the object-oriented features are used throughout. Without this critical skill, you'll be struggling as a Ruby programmer.

    对面向对象的概念有扎实的理解。 Ruby是一种面向对象的语言,并且始终使用面向对象的功能。 没有这项关键技能,您将很难成为一名Ruby程序员。

  • A bit of functional programming knowledge. This is a plus as Ruby uses the block or "closure" extensively. Not having this ability isn't insurmountable, though. Creating blocks is a feature that can be learned easily enough while learning Ruby.

    有点函数式编程知识。 这是一个加号,因为Ruby广泛使用块或“闭包”。 但是,没有这种能力并不是无法克服的。 创建块是一项在学习Ruby时可以很容易地学习的功能。

  • A bit of navigational know-how. The primary way of running a Ruby script is from the command-line. Knowing how to navigate directories, run scripts and redirect input and output are essential skills to Ruby programmers.

    一点导航知识。 运行Ruby脚本的主要方法是从命令行开始。 知道如何导航目录,运行脚本以及重定向输入和输出是Ruby程序员的基本技能。

Ruby所需的应用程序和工具 ( Applications and Tools Needed for Ruby )

  • The Ruby interpreter

    Ruby 解释器

  • A text editor such as Notepad++, Scite, or Vim. Word processors such as Wordpad or Microsoft Word are not suitable.

    文本编辑器,例如Notepad ++ , Scite或Vim。 不适合使用写字板或Microsoft Word等文字处理器。

  • Command-line access. Though the details of this differ from platform to platform, Linux, Windows, and OSX all have this available without any extra downloads or software installation.

    命令行访问。 尽管各个平台的详细信息有所不同,但Linux,Windows和OSX都可以使用此功能,而无需任何额外的下载或安装软件。

翻译自: https://www.thoughtco.com/what-is-ruby-2907828

csdn ruby语言入门

csdn ruby语言入门_Ruby编程语言入门指南相关推荐

  1. 火了,挡不住了:Facebook Move编程语言入门

    火了,挡不住了:Facebook Move编程语言入门 Facebook区块链项目Libra的其中一个技术亮点,就是它使用了一种称为Move的新编程语言,那么这种语言是怎样的呢,今天我们就从其官方的概 ...

  2. [易学易懂系列|golang语言|零基础|快速入门|(一)]

    golang编程语言,是google推出的一门语言. 主要应用在系统编程和高性能服务器编程,有广大的市场前景,目前整个生态也越来越强大,未来可能在企业应用和人工智能等领域占有越来越重要的地位. 本文章 ...

  3. “易语言.飞扬”十分钟入门教程(修订版1,update for EF1.1.0)

    "易语言.飞扬"十分钟入门教程 (修订版1,update for EF1.1.0) 作者:liigo,2007.8.12 本文地址:http://blog.csdn.net/lii ...

  4. 极速入门Gamemaker编程语言

    极速入门Gamemaker编程语言 开篇废话 这文档适合已经会使用其他编程语言(C#.C\C++.java.python等)的游戏开发爱好者学习 (逛CSDN怎么会有不会编程的人呢) ,如果不会其他语 ...

  5. “易语言.飞扬”十分钟入门教程

    "易语言.飞扬"十分钟入门教程 作者:liigo 2007.1.1 原文链接:http://blog.csdn.net/liigo/archive/2007/01/01/14720 ...

  6. 视频教程-2020新版C语言程序设计零基础入门小白自学编程-C/C++

    2020新版C语言程序设计零基础入门小白自学编程 7年的开发架构经验,曾就职于国内一线互联网公司,开发工程师,现在是某创业公司技术负责人, 擅长语言有node/java/python,专注于服务端研发 ...

  7. R语言 echarts4r 不显示图形_9本R语言书,从入门到进阶都在这了

    近期异步社区最新上架了两本R语言,小编带大家了解一下R语言书,从入门到进阶,都在这了.因为夏季即将到来,小编字体用了绿色,嘿嘿!最新上架 R语言之书:编程与统计 作者:[新西兰]蒂尔曼·M. 戴维斯( ...

  8. ruby网站部署到服务器,入门知识: 把代码部署到服务器, SSH

    入门知识: 把代码部署到服务器, SSH 2015-07-28 16:28 访问量: 2868 分类: 技术 如何登陆远程服务器呢? $ ssh root@your.server.com -p 334 ...

  9. Python语言学习:python语言的特点、入门、基础用法之详细攻略

    Python语言学习:python语言的特点.入门.基础用法之详细攻略 相关内容 Python 基础教程 目录 python语言的特点 python语言的入门 python语言的基础用法 python ...

  10. Dart编程语言入门

    Dart基础入门语法介绍,详细说明可以查看相关视频<Dart编程语言入门>. 变量与常量 变量 1.使用 var 声明变量,默认值为 null var a;//null a = 10; 2 ...

最新文章

  1. 图像处理-仿射变换 AffineTransform
  2. 转 LIST INCARNATION OF DATABASE
  3. 雪城大学信息安全讲义 3.3 提升 Set-UID 程序的安全性
  4. Session 过期问题处理
  5. PLSQL_海量数据处理系列3_索引
  6. mysql5.6配置semi_sync
  7. GIT 源码管理-简介
  8. 复盘 | 听全民K歌体验设计师聊聊歌房项目完整设计历程
  9. wxWidgets:wxStaticBoxSizer类用法
  10. ORA-20000: ORU-10027: 执行存储过程的错误
  11. Oracle 发布基于 VS Code 的开发者工具,轻松连接 Oracle 数据库
  12. linux 进程与锁,linux 中的进程与锁
  13. 计算机科学速成课36:自然语言处理
  14. 云效发布策略指南|滚动、分批、灰度怎么选?
  15. UDK控制台命令概览
  16. html5页脚最低下,页面底部或内容的页脚,以较低者为准
  17. Broker 的 Heap Size 如何设置?
  18. Arduino-1602-LiquidCrystal库
  19. 免积分下载与PDF转换
  20. L0到L4超全介绍!30+自动驾驶方案汇总

热门文章

  1. ftp服务器的创建文件夹,ftp服务器创建文件夹命令
  2. Python数据处理041:数据分析之时间序列
  3. python各种源码下载
  4. pytest_03_pycharm运行pytest (转:上海悠悠)
  5. java设计模式案例及使用
  6. 消息队列以及非常牛的kafka
  7. 金蝶移动bos开发教程_移动BOS开发 -- 移动表单
  8. Spotfire 常用数据类型
  9. 如何卸载Edge/如何降Edge版本
  10. 苹果电脑mac系统空间不足怎么清理内存优化?最详细的教程分享