Programming Independently

Start programming independently.

We'll cover the following

You’ll want to learn the following workflow to do programming exercises on your computer, to experiment with things you learned, and to write actual useful programs:

  1. Write some code in the text editor.

  2. Save the code to a file in a particular directory. The file name should end with .rb.

  3. Open the terminal.

  4. Navigate to that directory using cd.

  5. Execute the file using ruby.

  6. Switch back and forth between the text editor and terminal so you can make small changes in your code, and then run it through ruby to see what it does.

  7. To quickly switch back and forth between apps, use the keyboard shortcut “cmd-Tab” on Mac OSX, and “Alt-Tab” on Ubuntu and Windows.

  8. In your shell, you can use the cursor up key to go through your last used commands. You don’t have to type ruby hello.rb again. Just hit the cursor up and then “Enter” to run it again.