About switching and running and being free @ limpens.com
Monday, 12 May 2008
So over the past weekend, I changed the dns and limpens.com is running at the new host, webfaction.com, which, so far I can recommend. I’ll talk about them another time, maybe. I switched webhost, because I was unhappy with webhost4liefe’s connection’s speed. I live in Brazil and waiting for a page to appear seemed like I had a 14.400 baud modem, and not a 4mbit connection.
So, just for you to know I am a .NET developer and apart from having seen some rails screen casts in the past I am completely new to this area. At first I thought, rails would be the way to go for me, but coming from a dissident background, I soon figured, if everybody is using it, there must be something wrong with it – and in fact I sincerely dislike the active record pattern that rails kind of forces on to you spamming all your generated (and I am a newbie so I use generate) with base classes. I disliked all the ‘magic’ going on, where your classes seem to have invisible attributes and scaffolding is filling all the gaps. It may be only me and I might be completely wrong in my view, but I like it if there is something missing and I have to put it there. I also think this kind of approach does not help TDD.
In the end I build the site in rails and did not like it because I did not understand it’s inner workings.
So I looked into another direction and with webfaction being a python specialized host, I checked out what python could do for me. And with cherrypy, another mvc like framework, I found something quite beautiful – it’s lean and fast and what’s quite interesting is, that you actually build a object graph of your site`s controllers (they are not called controllers, but the behave in the same way)
so you have
root = Root()
root.about = About()
and so on, this also takes care of controller parameters and routing quite beautifully:
the method
root.somecontroller.action(param1, param2, param3) is mapped to
http://site.com/some/action/param1/param2/param3
Now _that_ is easy. And I had the site running (ruby and python are quite similar, so once you got your architecture in your mind, translation is not an issue).
But I did not like python too much. I disliked the lack of multiline lambda scopes out of language restrictions (no {}), and being the old OO guy, I did not dig all those global methods, like len(string) instead of string.len. I found it awkward why you have to order your methods within the class, so that the called method comes before the caller. I did not like the fact that I was writing methods outside of classes. For me this was a step backward (and I am heading in the lisp direction and am not saying that this is not possible, there), so I ditched it. Most probably a bad decision, many pythonistas might argue, and as they are far more experienced than me, they probably are right, but one has to make decisions, and after reading this article, I found that probably I’ll go for ruby. (And am already missing MI, for that matter)
So I looked around what other frameworks are lingering around in ruby space and encountered Merb. Merb seems to be a framework, that lets you plug in your choice of technologies, which I liked. It offers different physical structure options and still some good defaults.
It took me a part of the weekend to slap together limpens.com and I am quite happy with the results. Merb seems to be quite configureable, I found no magic going on (apart from than that my model was accessible to my controllers without ‘require’- and me adding these requires made the app fail and I had no clue why). So far I am not using any database and merb is 100% ok with it, and once I want to I have a gamut of options. I use haml as a view language (I wish there was something like pythons genshi for ruby, which is a template language which I liked a _lot_) and I’m free
To do what I want
Any old time
I said I’m free
To do what I want
Any old time
No. 1 — May 14th, 2008 at 04:52
Django’s url routing is also cool.
No. 2 — August 2nd, 2008 at 18:10
Speaking of old times, haha.
@TDD & scaffolding in Ruby
If I recall correctly the test classes are generated as well
Well, anyway, just wanted to say hello.
w.
No. 3 — August 27th, 2008 at 05:45
[...] public links >> cherrypy About switching and running and being free @ limpens.com First saved by snafu | 2 days [...]
No. 4 — August 31st, 2008 at 08:35
Hey Wolfgang, long time no see.
Even worse so, generated tests are about the worst idea I can imagine.