1. Home
  2. Computing & Technology
  3. Ruby

Practical Example: CSV

This practical example walks you through writing and using a CSV parser in order to parse and format some tabular data. It deals with string manipulation and splitting, sorting non-trivial arrays and printing tabular data with format strings.

Follow Along

Ruby Spotlight10

Conditional Statements

Tuesday October 18, 2011

I imagine the very first computer programs were very simple number crunchers.  Program some numbers into memory (in the very beginning, by hand) and run the program to compute an average or something.  But things have gotten a little more complex than that.  Computers need to be able to do different things depending on what was input, what state the program is in, or even what time it is.  At the heart of this type of behavior is the conditional statement.

Read more about conditional statements in Ruby here.

Boolean Operators

Friday October 14, 2011

Boolean operators are unavoidable.  As a brand new programmer, you may try to nest conditional statements (if this and if this and if this...), however Ruby (and almost every language) has something to help you with that:  boolean operators.  They allow you to be much more expressive in your conditional statements (if this and this and this), but at a price:  it can get out of hand quickly and become unreadable.

Read the complete article.

Boolean Expressions

Friday October 14, 2011

Boolean expressions are at the heart of most (if not all) programming languages.  They're what allows a computer program to follow different paths, or else it will do the same thing every time.  But, at their core, boolean expressions are simple:  it simply refers to the "truthiness" of any expression.  Later, we'll take a look at how these are used in conditional statements, but for now, read the complete article on boolean expressions.

Ruby 1.9.3rc1 Released

Friday October 7, 2011

The 1.9.3 release draws closer.  The first release candidate is here.  It's been stable for quite some time now (since the prerelease releases), so by all means, start playing it with.  Maybe don't deploy it to anything mission critical just yet, but for the most part, it should be just fine to us.

If you wish to begin using 1.9.3 today, I recommend RVM.  Simply install RVM, then run rvm install 1.9.3.  It's rather painless, so don't think that because there are no binaries for your operating system or distribution that you can't play with 1.9.3 before the official release.

Discuss in our forum

  1. Home
  2. Computing & Technology
  3. Ruby

©2011 About.com. All rights reserved. 

A part of The New York Times Company.