Chapter 1
Getting Started

We’ll be using three main tools when we program: a text editor (to write your programs), the Ruby interpreter (to run your programs), and your command line (which is how you tell your computer which programs you want to run).

Although there’s pretty much just one Ruby interpreter and one command line, there are many text editors to choose from—and some are much better for programming than others. A good text editor can help catch many of those “stupid mistakes” that beginner programmers make…oh, all right, that all programmers make. It makes your code much easier for yourself and others to read in a number of ways: by helping with indentation and formatting, by letting you set markers in your code (so you can easily return to something you are working on), by helping you match up your parentheses, and most important by syntax coloring (coloring different parts of your code with different colors according to their meanings in the program). You’ll see syntax coloring in the examples in this book.

With so many good editors (and so many bad ones), it can be hard to know which to choose. I’ll tell you which ones I use, though; that will have to be good enough for now. But whatever you choose as your text editor, do not use a word processor! Aside from being made for an entirely different purpose, they usually don’t produce plain text, and your code must be in plain text for your programs to run.

Since setting up your environment differs somewhat from platform to platform (which text editors are available, how to install Ruby, how your command line works…), we’ll look at setting up each platform covered in this book, one at a time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.219.209