Announcing:

LessMoney Conference will be June 7th in Tampa! Register today and make us smile super big!

There Is No Magic. Only Bad Magicians.

written by Steven on January 20, 2012

I'm surprised that there are still people that think Rails is magic or that's there's "too much magic in there." Magic is really just not understanding how or why a library or any bit of code works. For libs I think it's just fine if they're magic. It's just fine if a lib is a black box that you never have to look at. No one would ever complain that an OCR or graphing lib is too much magic, so why complain when any lib does stuff that you don't understand? 

When people, even ruby folks, complain about magic it makes me think they simply haven't taken the time to understand either the code or the framework/language/technology they're using. Anytime I read a bit of code the curtain is pulled back, the magician's tricks are revealed. This is true for Rails or anything else. After all, it's just instructions that are stored in memory and executed as writen. 

If you think a particular lib has magic, just read the code. If you don't understand the code than it's a great opportunity to learn. We are all magicians. Our audience isn't other developers, it's the people who use the apps we write. They should be the ones who say "this is magic."

Learn how LessEverything built their consultancy to over $1,000,000 annual revenue at LessMoney Conference, June 7th in Tampa Florida. Each attendee will get early access to our upcoming ebook as well.

5 Comments

Paul Bock
Paul Bock said on January 20, 2012

Well said and true.
Unfortunately there are many for whom it’s easier and more convenient to believe the magic than to do the hard work of learning and understanding.
Our challenge and mission is to lift the veil for those, so they may discover the joy of learning, the excitement of understanding and the satisfaction of knowing.

Alex
Alex said on January 20, 2012

There are exceptions – obvious things should be obvious. E.g…

a + b

If “a” and “b” are 2 numbers, strings or collections for whom the concept of addition is obvious, then a + b should actually add or concatenate these objects. Otherwise it goes against everything you ever did before, failing your intuition and it’s not really productive to look up every line of code you ever use.

Also, in Django every “view” (which are the controller methods from Rails) can return only one type of object – HttpResponse() – A view cannot set a global state about which template to render (Rails) and the returned result is not automatically converted to the expected type (again Rails). So the expected result and how everything is glued in Django, is more obvious, making the learning curve more bearable, at the cost of explicitness and whatever that brings.

Therefore I do think the term itself (magic) is useful to denote the usage of conventions OR fucked-up code. So it’s not necessarily in a derogatory way.

Eugen
Eugen said on January 20, 2012

I think taking ‘magic’ to mean ‘a library that does something you don’t understand’ is forcing it a little.

When I talk about ‘magic’ in the pejorative sense, what I usually mean is a library doing something I’d like it not to do. Remember instantiated fixtures? That would be a pretty bad case of magic.

Donnie
Donnie said on January 27, 2012

I feel the same way about SEO.

….granted, tons of people dont’ have the time or just plain don’t want to learn it… but it isn’t magic, it can be learned.

More and more these days, it’s becoming increasingly more difficult for companies to write a check and just expect it all to be done. This is mostly because search engines are starting to do a much better job of requiring websites to contribute/ interact with online communities.

Great post Steve, I’m off to study some rails…

Jinesh Parekh
Jinesh Parekh said on March 14, 2012

Well said steve.

Well put by William Bernbach in his quote “An idea can turn to dust or magic, depending on the talent that rubs against it.”

Leave a Comment

About Steven
Steven Bristol has written code for the past 20 years. He like green vegetables and kittens, oh and butterflies too. He loves to throw ninja stars at his enemies.

You Should...

Follow Steven on Twitter
Friend Steven on Facebook
Subscribe
LessEverything Copyright 2011 LessEverything.com
We don't like footers, they're kinda boring