Hopefully, you are now beginning to see why Ruby is so popular. Clearly it would be hard to make printing a line of text any easier than a print statement followed by the text to be displayed (together with a newline character '\n' on Linux and UNIX).Īs an example, let's compare this to the equivalent code in Java: import java.io.* You may recall if you have read the previous chapters that one of the strengths of Ruby is that it is fast and intuitive to learn. On Linux or UNIX derived operating systems: print "Hello Ruby!\n"Īs you can see, all we need to do to output some text is enter a single line of Ruby code. Without further delay, let's get started: Ruby Essentials is no exception to this rule, though we will modify it slightly to display "Hello Ruby!". Typically such a program does nothing but output the string "Hello World" to the console window. Programming guides tend to follow the tradition of using "Hello World" as the first example of using a programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |