Sitemap
Thilo

Thilo

I'm a jerk.

Ruby on Rails

5 min readJun 15, 2013

--

Ruby and in particular Ruby on Rails is the hot topic by startups for some time now. Ruby on Rails is cool and easy to use. If you need something to get done, then make it in Ruby on Rails. There are also services like Heroku, which makes deploying your applications easy, and services like Github,which makes managing your applications easy.

Programming in Ruby itself is much more easier than in other modern language. Many things are strait forward and almost more and more like human language. Most of the stuff is handled automatically and almost magically for you by Ruby itself. You don’t have to think about variables. You just use them. Ruby will manage the type handling for you. Ruby will manage the memory management for you, these days called garbage collection. It is these things that Ruby learned from Smalltalk and other languages to make it easy to use.

That is, why Ruby attracts more and more people and gets them into programming. Which is a good thing, as Kirk McDonald would say according to his opinion in the Wall Street Journal “Sorry, College Grads, I Probably Won’t Hire You”.

But there is the flip side of the coin or as Greg Joergensen said in his opinion “Sorry, Digital Ad Exec, I Probably Don’t Want To Work For You”:

A dilettante is not a programmer

Learning a little bit of programming is probably worse than not learning it at all if you are going to be working with professional programmers.

I would go even further and would say, it is not only about to be a programmer but a software developer. A software developer, who not only knows how to code, but also how to translate a problem into a solution, that is maintainable. The main issue here is Maintainability.

To illustrate the problem of maintainability, I will dig into some details.

Some times ago I came across Redmine when I was looking for an easy to use, maintainable and easy to customize issue tracker. It was my first contact with Ruby and Ruby on Rails. With lots of problems I managed somehow to run. Now, to play a little bit, I wanted to upgrade Redmine to the latest version. This brought some caveats. I had to update Ruby to a newer version and also the Rails framework, on CentOS 5. I know, CentOS 5 is not known to have packages for the latest and greatest. I had to find other ways to get to the required Ruby version. Everybody says: You should use RVM. Installing RVM itself is without a hassle, but then things start getting worse.

First I had to lookup which versions are available:

rvm list known

I’ve got listed versions 1.9.3 and 2.0.4, which seems to be good. So, I’d like to install 1.9.3 with, as any documentation suggests:

rvm install 1.9.3

Bang. Error message that there is no binary for my system. WTF? The list command clearly listed that the version is available. After some more closed looked, I detected, that the version available was 1.9.3-p392 and the install command tried to install 1.9.3-p429. The list command has different list of known versions that the install command. For me, that clearly is a fucked up version management.

Get Thilo’s stories in your inbox

Join Medium for free to get updates from this writer.

How can such an easy task be screwed up so easily? The only thing, I as a software developer can think of, is that there are no clear definitions how things are handled internally. Some programmer just had some idea and has implemented it without thinking about consequences or side effects. That happens, if you just get things done.

In the same Redmine installation I wanted to test out some plugins. There are two plugins who needed the Gem acts-as-taggable-on. Ruby defines version management for Gems that sounds great, at first. You can easily define the required version in you Gemfile and the rest his handled by the Gem version management:

gem ‘acts-as-taggable-on’, ‘~>2.3.1'

That should mean, that any version between 2.3.1 and less than 2.4.0 is good. But what happens if a number of plugins define, that they need a certain version of a Gem? It should be handled by the Gem version management. Nope, it does not work. Even as 2.3.3 falls within the definition of ~>2.3.1 it is recognized as the requirement of a different version. By the way, version 2.3.3 is installed on that system.

Press enter or click to view image in full size

The Ruby Gems version management is screwed up as well. Again presumably by the same “getting things done” people and not by software developers.

The same principle goes on, when you look at the code in Redmine or some of its plugins. Here to code for the S3 plugin that includes itself into the attachment storage object:

Press enter or click to view image in full size

It adds itself to the methods of the base object. It adds itself, by taking the data, pushing it to S3 and then clearing the data as there is no data. WTF? Just kicking in into someones code, doing something, and then returning Zero as there is nothing. Clearly, a programmer, a coder, who may knows to code, but no sense in thinking about the consequences, the side effects, the whole picture. Thats the “getting things done” thinking.

The problem is more inherently. I think, the problem is in the “get things done” thinking. The problem is, that Ruby animates the people to the “getting things done” thinking, than enforcing it into thinking of patterns, of consequences, of side effects. That than even by programmers that Greg called “dilettantes”.

I presume, the next big thing in Ruby is: Security. I assume, that many of those Ruby code gets deployed in many web applications, because it is so easy. People, who are not aware even of simple software development principles, presumably are also not aware of security. You can recognize this already, by the number of Startups who provide correct SSL for their services.

Just, for example (I know, no Ruby): Instagram is still not using SSL and a such allow session riding and all those other nice things.

--

--