Friday, January 30, 2015

4 Reasons Why You Should Learn Ruby As Your First Programming Language





Learning to code has a steep learning curve. You’ll encounter foreign concepts, technical jargon, and difficult choices. One of the very first choices you’ll have to make is which programming language you should start with.
Programming languages are similar to spoken languages. Each programming language falls into one or more categories. A few categories you might have heard of include imperative, object oriented, functional, or logic-based. Fortunately, once you learn one language it’s much easier to learn a second language in the same category. Unfortunately, that first language is going to be tough to learn.

Ruby is a general purpose programming language created in the 1990s by Yukihiro “Matz” Matsumoto. It’s also one of the best languages to start with when you’re first learning to code.

Ruby is one of the easier languages to learn

I remember when I first started learning to code. It was an introductory Computer Science class and the course curriculum used C++. In the world of programming, everyone’s first computer program is one that displays the message “Hello, world!”. It’s known as the “Hello World Program”.
Here’s what that looks like using C++:
c++ coding exampleIntimidating, isn’t it? To display “Hello, world!” to a computer screen, you’ll have to learn multiple C++ functions and keywords. Here’s the equivalent Ruby source code:
ruby coding exampleMuch simpler than the C++ version!
Ruby is considered a higher level programming language than C++. A high-level language features strong abstractions from computer details. Whereas low-level languages are closer to machine details (like memory addresses or CPU registers), high-level languages are closer to a naturally spoken language.
When you’re first learning to code, a high-level programming language like Ruby is much easier to use.

Learning Ruby is a stepping stone to Ruby on Rails

If you’re currently working within the software industry or startup community, chances are you’ve heard of Ruby on Rails (often shortened to just Rails). Rails is a software framework for creating web applications.
Many students new to programming aren’t sure what the difference is between Ruby and Ruby on Rails. Ruby is a language. Ruby on Rails is a framework that uses and depends on the Ruby programming language. Think of a framework as a collection of pre-written code to help programmers. In this case, the Rails framework is a collection of pre-written code to help programmers make websites and web applications.
Still confused? Think of making a sandwich. You simply add a slice of meat, cheese, and lettuce to two slices of bread. But where did the bread come from? It’s easier to get pre-sliced bread from the grocery store instead of baking our own bread using flour and water. In this case, the Ruby programming language is flour and water. Pre-sliced bread is the Ruby on Rails framework.
Learning Ruby is a prerequisite to learning Ruby on Rails. You’ll be one step closer to creating web applications like Twitter, Yellow Pages, Hulu, or Groupon.

Ruby knowledge is in demand

The TIOBE Programming Community Index lists Ruby as the 13th most popular programming language as of the time of writing this article.1 Although popularity is a good thing, what’s better is demand. Currently, Ruby is experiencing incredible growth in demand2
Demand for Ruby programmers is most likely tied to the Ruby on Rails framework, which launched the programming language into mainstream development in 2004. Employers are building their websites using Ruby on Rails. They need Ruby developers to maintain their code bases.
ruby developer on computer
Ruby developers are a hot commodity now.
Caption if possible: Data center full of servers powering hundreds of websites.
The demand for Ruby also exists outside of Ruby on Rails. Ruby is increasingly becoming common within DevOps roles. Wondering what DevOps is? A website or web application with huge amounts of traffic will usually require hundreds of computers to run on, called servers. DevOps engineers ensures the reliability and efficiency of those servers. DevOps engineers also automate the deployment of servers, so websites can quickly handle large surges of traffic. Ruby is a popular programming language for DevOps frameworks like Puppet and Chef.

Ruby has a huge and useful ecosystem

A programming language’s ecosystem is important for several reasons:
  1. Existing code that you can leverage — Ruby has pre-written frameworks and libraries like Ruby on Rails and Chef. You can use this pre-written code for your own projects. Why spend time reinventing the wheel when someone else has already done it for you? Ruby even has its own system to manage frameworks and libraries, called RubyGems. There are currently over 60,000 libraries to choose from!
  2. Documentation — instructions play a huge role in every developer’s life. As you’re working on your project, you’ll constantly be searching through documentation. First time connecting to a database? The go to starting place is documentation. When you’re coding, there will be a lot of “first times” where you’ll need access to good documentation.
  3. Learning resources — Ruby has a large amount of resources to choose from. There’s plenty of books, screencasts, in-person courses, and even developer bootcamps dedicated to learning Ruby. There are even free tutorials scattered throughout the web, like Why’s Poignant Guide to Ruby.
  4. Community — Stuck on a programming problem or have a question? Find a Ruby mailing list, chat room, or web forum and ask away! The Ruby community is filled with generous developers who enjoy helping out. Be sure to contribute once you’re more experienced. There are even Ruby User Groups, where developers interested in Ruby meet in person to discuss and learn from each other.

How to start learning Ruby

I hope I’ve sold you on why Ruby is an ideal first programming language! As I mentioned, Ruby has an excellent community and extensive amount of learning resources. You can learn from books or online courses, but remember, the best way to learn programming is by getting your hands dirty! As you’re reading books or taking a course, start coding on your own programming projects. You’ll learn best when you’re solving real world problems.

No comments: