Linux, Ruby and Python

My first encounter with Linux was in the mid 2000s – and it was a terrible one. Why? Because I grew up using only GUIs. With Linux I suddenly was confronted with a sort of mandatory command line. However, once you see how fast things can be done with a command line you really start to like it. And as I got more and more into programming, I thought to myself about giving Linux another chance. That was a good idea!

Linux uses a case sensitive filesystem. That means it makes a difference wheter you call your file “myFile”, “MyFile” or “myfile”. Mac OS and Windows don’t use a case sensitive filesystem unless you want to. Not being used to that gave me headaches writing my first Ruby program.

I followed a tutorial on the web. Its author used Mac OS X and therefore didn’t worry about lower- or uppercase letters when writing the code. Here’s what he did:

require 'HTTParty'

This simple line of code tells the script to include a gem called “httparty”. Yes, right, the gem is written all lowercase. So what did the interpreter do? Right, throw an error. It couldn’t find a gem called HTTParty, because it is called httparty. That makes no difference on a case insensitive filesystem but it does on a case sensitive filesystem.

With the decision to use Linux I also decided it was time to learn new languages like Python and Ruby. C++ is also on the roadmap – but before that I have to figure out how to use libraries in C++. Here’s the problem:

When writing programs in PHP all you have to do to use a third party library is to download the sourcecode, place it in the directory of your project and include it. (Unless you use PEAR, that is). Boom. The Library is ready to use! Not so when you’re writing programs in Ruby. You have to install the library on your local machine and when you distribute your application (or script if you prefer), you have to tell everybody who uses it to install the library you used too. That’s actually not the convenient way I’m used to.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s