I like Ruby's 37 reasons
It is object-oriented. What does that mean the point? If you ask 10 programmers, you might get 12 kinds of results, do you have your opinion, I will not try to change your views. But there is one point, Ruby provides a package of data and methods to allow the type of inheritance, polymorphism object. Unlike other languages (C + +, Perl, etc.), Ruby from the design time is an object-oriented language.
It is a pure object-oriented language. Is it because I redundant? This is not the case, why say so, because all objects in Ruby, including primitive data types (primitive data types), such as string, integer, that is an object without the need to provide Java as wrapper class ( wrapper classes). In addition, even the constant will be treated as objects to deal with, so the recipient a way, could be a number of constants.
It is a dynamic language. The only familiar with, like C + +, Java static languages such people, this concept is a major difference. Dynamic means that the methods and variables can be added at run time and re-definition. As it reduced the C language compiler, as the conditions (# ifdef), and easy to implement reflection API (reflection API). Makes dynamic process of self-perception (self-aware), such as run-time type information to detect the loss of the methods, methods used to detect the hook, such as an increase. Ruby in these areas and some of Lisp and Smalltalk have a relationship.
It is an interpreted language. This is a negative miscellaneous problems, the focus should be to explain, perhaps because of this feature causes performance advantages into disadvantages from the debate. For this, I have a few ideas: 1. The first: the rapid development cycle is a huge benefit, it should be proud of in the interpretation of the implementation of Ruby. 2. More really slow so slow? Before it slowly in a slow baseline. 3. Maybe some people want to criticize me, but I would also like to say: every processor in the original become sooner. 4. If you really care about your speed, you can be part of your C code development. 5. Finally, in a sense, this is a still controversial issue, there is no natural language is interpreted, and the world, there is no law to develop a band from Ruby compiler.
Its understanding of regular expressions. Many years ago, just use regular expressions in UNIX tools such as sed or grep, or carried out in a number of vi find some - such as the replacement. The emergence of Perl to solve these problems, and now, Ruby can do the same. More and more people have come to realize that the string and text processing technology, the ability of incredible, if you doubt it, then please take a look Jeffrey Friedl's book Mastering Regular Expressions, then you should not have What is questionable.
It is a multi-platform. Ruby can run on Linux, UNIX, Windows, BeOS, and even MS-DOS. If I remember correctly, and even a version of the Amiga
It is derived from the past. This is a good thing right? Around like book knowledge, it is useful. Newton once said "If I am away than others, it is by standing on the shoulders of giants." Ruby is also standing on the shoulders of giants, it draws on Smalltalk, CLU, Lisp, C, C + +, Perl, Kornshell and other advantages. It seems to me that its principles are: 1. Do not repeat the manufacture of wheels. 2. Do not fix what is not broken. 3. The last is quite special, it can balance (Leverage) of the knowledge you have. You understand UNIX files and pipes, all right, you can continue to use Ruby, you spent two years learning the printf indicator, do not worry, Ruby you can also use printf. Do you know Perl regular expressions to deal with, you will learn the Ruby regular expressions.
It is innovative. And feel that this is the seventh article of the contradictions? Contradiction may be part of, every coin has two sides. Ruby features a number of things that are innovative, such as a very useful Mix-in, perhaps later this feature will be the language of drawing. (Note: A reader pointed out that the Lisp as early as 1979, there is a mix-in, this is my negligence; I should find a better example, and am confident that it can.)
It is a very high-level language. (Very High-Level Language: VHLL) This is a controversial topic, because the term has not yet widely used. And it is the meaning of OOP than there's room for discussion. I may say so, Ruby refers to the complex structure to support these structures and the operation of miscellaneous negative, and need very little instruction, which is the principle of minimum effort (Principle of Least Effort) line.
It has a smart garbage collector. Like malloc and free routines this is the nightmare of yesterday, and what you do not need to recall the memory of the operation, or even call the garbage collector.
It is a scripting language. Not because it is not strong enough on that, it is not a toy. It is a full-fledged language, it can easily be completed with the traditional operation of the script, such as external procedures run to check system resources, the use of pipes, catch the output and so on.
It is commonly used. Kornshell to do things it can do, C language to do things it can do well. You can write it to run only once and only 10 firms, or some remnants of the packaging process, you write a web server, or a CGI, can be used to write Ruby.
It is a multi-threaded. Y You can use some simple API to write multi-threaded process, even on MS-DOS can be.
It is the open source. You want to see its source code? Yes, you can submit a patch, to participate in the wider community, including its creator.
Feel that it is straight. Ruby relatively low learning curve, and if you turned a Hom, you begin to "guess" how things work, and you guess right most of the time. Ruby adhere to the minimum surprised (Least Astonishment) principle.
It is unusual mechanism. Like Java and C + + like, Ruby also has unusual mechanism, which means that the return value because you do not have to be cluttered up the code, very few of nested if statements, very little spaghetti-like logic, better error handling .
It has a high-level categories of the array: Array. Ruby in the array is dynamic, you do not like the pascal as the size of it in a statement, do not have to like C, C + + as the allocation of memory for it. They are objects, so you do not have to be concerned about their length, in fact, you can not "come to the end (walk off the end)". This class offers a variety of methods, you can make the index, according to the array element to access the contents of the array can also handle reverse. You can also use a few for as a set, queue, stack and so on. If you want to use look-up table can be used to hash structure.
It is for expansion. You can use C or Ruby to write external libraries (external libraries), the same, you can also modify existing classes and objects.
Programming to encourage documentation (literate programming). You can embed Ruby program notes or documents, these documents can be used Ruby documentation tool for extraction and processing. (A real document programmers may think that this is the basic things you need to)
Creative use of punctuation and capital letters. For example, a method returns a boolean type (Ruby does not have this kind of argument), then this method generally have a question mark at the end of the last, if a method to modify the receiver itself, or destructive, then with an exclamation point at the end, simple, intuitive . All constants, including class name, all capital letters at the beginning, all object properties to @ symbol at the beginning. This is the practicality of the Hungarian nomenclature, but there is no visual of the ugly.
Reserved words aren't. It's perfectly allowable to use an identifier that is a so-called "reserved word" as long as the parser doesn't perceive an amibiguity. This is a breath of fresh air. (Use reserved words as variable it? who did not watch too much.)
Support iterators. This allows you to an array, list, tree, such as transmission of a block object, and then each element of their calls to block. Worthy of in-depth study of this technology.
Its security. Ruby from a Perl variable $ SAFE based on hierarchical control mechanisms. This is very useful for CGI program, you can prevent people from attacks on web servers.
Ruby does not target. The same as Java and C + + different, Ruby is not the concept of indicators, it removes the pointer syntax and debugging on the headache. Of course, this also means that the bottom will be very difficult for developers, such as control of access to a device status register; However, we can use a C library to call. (Like C language programmers sometimes have to use the same assembly language, Ruby programmers sometimes have to use C language to accomplish certain tasks)
It enables people to focus on the details. Ruby has many synonyms and aliases, you may not remember the length of string or an array is the size or length, does not matter, they can work in any. For the Range, you can use the begin and end, or the use of first and last, they are working. You want to spell indices, results of the indexes, all right, these two are the same.
Very flexible syntax. Method call can be omitted when the brackets, just use a comma between the parameters of partitions. Perl style similar to the definition of the array allows the use of quotation marks you do not have all the commas and the definition of a string array. Return keyword can be way out.
Wealth of library functions. Ruby provides a thread, socket, limited object persistence, CGI, server-side executable, databases and other library functions, as well as the support of Tk. There are many other library functions.
Their own debugger (debugger). In a perfect world, we do not need the debugger, but the world is not perfect.
Interactive implementation. Can be used as the implementation of Ruby as Kornshell. (This is probably the most controversial point of this page, I have to admit, Ruby is not really a good shell. But I still insist that the shell-based Ruby is a good idea.)
It is simple. Pascal is not as if followed by the requirements then, while followed by do. Variable does not require that they do not need to type. Do not have to specify the return type, return keyword can be omitted, it returns the value of the last expression. On the other hand, it is not like Perl or C as the complexity of difficult to understand.
It is the expression for (expression-oriented). You can easily use the x = if a <0 then b else c this kind of expression.
Syntax sugar (syntax sugar). (As explained Mary Poppins: a spoonful of sugar will enable semantic syntax is accepted). If you would like to carry out iterative array x can be used for a in x. You can also use a + = b instead of a = a + b, it will do. In fact, many operators in Ruby are methods that compare the names of intuitive, short, has a convenient syntax.
It supports operator overloading. If I remember correctly, back in a long time before the SNOBOL provides this feature, but until the C + + that it has become popular. Although it may be the fault of misuse, but this is still a very good advantage. Ruby automatic definition of the other operator version of the assignment, for example, if you re-definition of the +, then you also get a + = operator.
Support an unlimited number of precision. Some people will be concerned about the short, int, long you only need to use Bignum on the list, you can easily achieve the 365 number.
Have the power operator. A long time ago, in BASIC and FORTRAN, we use it, but when we are learning Pascal and C, we realize how bad the operator. (We were not even informed of their work it is not know how - it uses the number of iterations of it, how effective?), But the relationship of these do we really? If so, we can rewrite this method, otherwise, Ruby has a very good operator ** can be used.
Powerful string processing. If If you want to find, judge, formatting, trim, and bound (delimit), interpose, tokenize, you can not choose which one to use to get the results you want.
Rarely caused by abnormal rules. Ruby's syntax and semantics structured than other languages, each language has a unique side of each rule, there will be abnormal, but the rules of Ruby-induced abnormalities of the more than less.
Transfer from: process blog
Related Posts of I like Ruby's 37 reasons
-
The merits of the field-driven development
All along, J2ee development process (in Struts + Hibernate + Spring as an example) are as follows: 1. Design Database 2. Generate database 3. From the project to establish database connection 4. Put the database reverse engineering to generate POJO 5 ...
-
Hundred software developers interview question
Hundred software developers interview question Think employed to engage in software development of smart people is not easy. The event of accidentally, it will get a pile of low-energy large baboons. I met last year on this matter. You certainly do n ...
-
Rails2.0.2 change the default DB adpter
In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra ...
-
RSpec troubleshooting
1.uninitialized constant Dependencies Conditions: In windows under way to install the RSpec gem and rspec-rails. However, in ruby script / spec_server to do the test under the spec your_spec.rb-X will appear uninitialized constant Dependencies (NameE ...
-
Alternative to Java with Ruby to do unit testing interface rest!
Ruby is long overdue to replace java more flexible and make some necessary changes in a matter of, if not deep-rooted culture of the company's java, I think. . . . . . The following are my Writing for the Rest of the interface used to make the test su
-
Workspace run under different Eclipse
Now do live more and more often required to use eclipse in java and ruby & rails project conducted between the tangential shear from the past, because in the rails project used a coloring Aptana preferences, the results open the java project sour ...
-
RoR explained
ROR is Ruby on Rails. Ruby is a well-known has been very good dynamic language It's dynamic language. Simple and easy. Dynamic languages are interpreted, but the performance may make a discount, but not absolute, because the application is comple ...
-
Some interview questions java
The first is the company give you a chance to meet, it is necessary to know to meet from time to equal the interview, and have a lot of companies to see you at the first time will give you a ready point of doing something trivial, these questions, al ...
-
JAVA interview questions
JAVA interview questions 1, object-oriented features of what has 1. Abstract 2. Inheritance 3. Packaging 4. Polymorphisms 2, String data types are the most basic right? Basic data types include byte, int, char, long, float, double, boolean and short. ...
-
Oracle instant clent for ruby / rails on cygwin
Environment: XP: oracle full client, ruby, rails, gem cygwin: ruby rails, gem (the version with the XP version) Needs: for cygwin is installed under the rails platform support oci Steps: <1> download oracle instant client (10.2.0.3 Instant Clie ...













Leave a Reply