IverCore

Website & Software Developer

0 notes &

Ramaze

I have decided to go back to writing all my personal projects in Ramaze. The only reason being I feel I need to broaden my knowledge horizon, and I feel it is the most complete and stable alternative ruby framework out there. I also see it having longevity. I am also quite impatient with waiting for rails 3 and I don’t want to have to use hacks to achieve things like using datamapper. Ramaze, like Merb is component based. So you can mix and match more. And although I stopped using Ramaze before because I was tired of all the changing, I think for the foreseeable future it is going to be Rails at work, Ramaze at home. I think it gives quite a good balance, and also allows me to use other ruby technologies/gems/plugins that at the moment don’t fit in smoothly with Rails. And it is my plan to keep on using both frameworks in this way beyond the release of Rails 3, nothing wrong with having more knowledge.

Also look out soon for my follow up posts on Rails lasagna. I have been quite busy, but I will follow up on my promise to write about it.

Filed under Ruby frameworks rails ramaze

0 notes &

My Rails Lasagna

With over two years worth of rails development under my belt something happened to me the other day. Something clicked, and not only was I a professional Ruby on Rails developer by way of my job, but I also became a professional Ruby on Rails developer by way of my state of mind. Let me explain myself in more depth. I am sure when all developers start out in a new language and frame work, everything is shinny and new, and you jump on every cool new thing that comes out regarding your new toy and you just want to use it. I was like this when I first started using rails. I think back to when I first found out about haml (http://haml-lang.com/) and decided that it was so cool I wanted to totally abandon erb and use haml exclusively, I was also of the mind that those that did not use haml were a bit wrong in the head. Now I am not so sure about this, now I think that views should be kept as close to pure html as possible. I am a purist and an idealist. I do not like muddying the waters. Moving on in my rails life I was always searching for a book, blog post, screen-cast, something definitive that I could use to learn what I thought needed to be known to make me a professional rails developer not only by job title, but to also actually feel like one too. In my search I have read many posts, subscribed to (and removed) many rss feeds. Watched many screen-casts, been to a few conferences, and read the odd book here and there. All of these things have contributed to putting me in the frame of mind I have now. Which is not only am I a rails developer by trade, and I am also a rails developer by mentality. And I am sure that many developers have this feeling (or maybe it is just me), of wanting to do things the best and most professional way possible. To say that their code is the cleanest it can be. To say that the tests are as well written as they could be, to say the views are well written with close to zero percent logic in them. To say that the controllers are skinny, the models are fat, and nothing that belongs in one is in the other and vice versa. This is sort of the ideal. The place that you want to get to mentally where you are not just telling people you are a rails developer but you actually feel like it too. Well people I have obtained that feeling. I have reached my mecca. I am a ruby, and ruby on rails developer. I am very content being so. I have no desire to work with technologies that are not related closely to this. So all you PHP disciples, Java-ites, Python preaches and others, it is great that you have a technology that works for you. I however, have less than no interest in the technologies that you use. Each to their own, and do whatever works for you. I just want to concentrate 100% on what I like to do and makes me happy doing and explore the new found world of mental professionalism that I have newly acquired. If you read the byline of my blog it says something like “I am a user that just knows how to develop”, and while this is still true, I now also feel I have moved into the realm of professionalism. This is thanks to all my experience that I have had in everything I have done in the past 2.5 years using rails, and all other technologies that highlighted how great ruby and rails is compared to them. But these past 2 weeks 2 things tipped me over the professionalism line. 1. I watched a screen cast entitled What Killed Smalltalk Could Kill Ruby, Too”. This was tweeted by my friend and current colleague Leonardo Borges. I say current because Leo will be leaving us soon to join thoughtworks in a few months down in Australia. Good luck with that. Tell the locals G’day and give them hell down under. But I digress. This screen cast served to iron out the remaining bad habbits that I have in my mind, and sometimes currently put into practice. It also re-reminded me of how I should be developing. In short and to paraphrase from the film As Good As It Gets with Jack Nicleson, “It made me want to be a better man”. Sometimes if you have worked for sometime in a place of work like I have and you have tried to implement change for the better, you also get sucked into the bad habbits that were in place without even knowing, and lose sight of what you were trying to change in the first place. And this screen-cast was a great wake up call. If you have not seen this screen-cast it is well worth watching. 2. The second thing that tipped the scales of professionalism for me was looking at code for the past couple of weeks at my current place of work. What can I say? Looking at code like that makes me what to cry/tear my eyes out/get up and just leave the code alone/good to sleep and hope it is just one bad dream. Any and all of these things. We have been doing a transition from Prototype to jQuery (thank God), and looking through the code and the tests that go with the code makes me realise how far I have come and why code like this just not acceptable to me anymore. These two things along with all the things I have gone through and have learnt over my time working with ruby and rails have made the developer I am today. I can no longer stand to see javascript in the html, I cannot abide having css in the html either. I abhor rjs. Code with no tests make me feel very uneasy. Test written after the code has just seems useless to me. The use of a non distributed Source Control Manager is just crazy to me. And last but by no means least, the “get this done as quick as possible” mentality is one that despise, and which unfortunately is currently a part of my current job. When will people learn that short term gain does not outweigh the long term goal. In the past I was reluctant to take on a lot of freelace work in rails because I still felt I was honing my skills. Now, I feel I could (and probably should, if for nothing but my own sanity and peace of mind) start up my own company where all these rules of coding are enforced. And good… no, great code is produced on a daily basis. All of this brings me to the main point of this post. My Rails Lasagna. I will undertake to write a series of posts pointing out what I think makes a good Rails Lasagna. Let me first explain what I mean by a Rails Lasagna. As we all (should) know, Lasagna is a layered dish. If made properly all layers are nicely separated from the others and you have something that not only looks good, but tastes good as well. And so in my analogy this is how my Rails Lasagna would be made up.

  • The cooking dish - This would of course be rails. This is the framework that holds everything together. This is where all the ingredients go. This is where everything gets cooked. This is Rails.
  • The base layer - The foundation all all good Rails Lasagnas should be testing. And not just testing, but test driven development, behaviour driven development, whatever you what to use. But tests must be first whether you use testunit, rspec or something else.
  • The meaty model layer - This should be a big fat juicy model layer. All of your juicy logic should be here.
  • The thin controller layer - Your controllers should be light and thin. Something beautiful to break up the taste of the meaty model layer below and the view layer above.
  • The view layer - This layer should be packed with all types of html goodness, and very low in logic cholesterol.
  • The css Layer  - This is the first layer people are going to see when they look at your Rails Lasagna, so this is your chance to make your Lasagna look as great as your want it to look.
  • The javascript layer - For those of you who like to dabble in the more advances techniques in cooking, this is where you get the chance to shine. Remember that in this layer, a lot of the time less is more. Use this to enhance your Lasagna, do not let this drive your recipe. And even when you do feel like you want to use this in your recipe, I would suggest you go for a ready mix solution. A nice jQuery, Prototype or mootools would do just fine here. Because unless you are a Michelin star javascript chef, why kill yourself doing what others who are, have taken the time to make as easy for you as possible.
  • The oven and the fridge - These are is your SCM, this is where you put your lasagna when it is cooking and when it is done. I would suggest that you get yourself one of the more modern distributed models of oven or fridges. Git, Mercurial and Bazaar are fine brands. They will serve you well. Try and stay away from older brands like SVN or CVS. While these markers were good in their day, they have not kept up with the times and make the whole cooking experience more painful and a whole lot less enjoyable.
So there you have it, a start for your Rails Lasagna. In the following posts that I write I will detail my thoughts on each of these parts for a great Rails Lasagna. Now sit back and enjoy that great Rails Lasagna aroma and taste.

Filed under Ruby lasagna professionalism rails

0 notes &

Firefox Add-on Collector - What A Pile Of Crap

2.30 am local time, Spain. I have just been trying to use FireFox’s Add-on collector to manage a bunch of extensions that I like to have on my FireFox install. And my verdict, FAIL!!!

I don’t even want to go into the detail of why this is a good idea, but poor (maybe even the worse) implementation I have seen of a product in a while.

I mean sometime I wonder if developers actually think about the people that are going to be using software and not just the software itself. I feel like exacting revenge on someone from Mozilla for the 20 minutes of my life I have wasted on this. If I wasn’t so busy with other stuff, and if I liked using stuff outside of ruby to develop, I would recreate this just to show them how it should be done.

No common sense, no user friendliness. Ahhhh, someone must pay for my wasted minutes!!!

These developers need to be sent away and locked into whatever basement in their mothers’ houses it is that they came from, because they obviously do not live among the real people of this world.

I am starting to really loose patients with FireFox. This is not the first time that they have driven me to the edge of insanity. As soon as chrome gets a couple of what I see are essential plug-ins, I am out!

Filed under General add-on collector firefox

0 notes &

To Puppet or to Chef, that is the Question

I have taken a break from coding ruby and rails for a couple of weeks to try and get my company’s administration is order. To do this I have been using the sysadmins automation tool called puppet, which is written in ruby, but uses an external DSL, meaning that you don’t get all the power of ruby, just the amount that they let you have. I actually even went to Belgium last week to a training course run by the company responsible for maintaining the puppet code. And while there I came to the conclusion that I like the idea of having an external DSL… in theory. Because it means that it is tailored to the task at hand, and it is actively parsing the code you write to make sure that it adheres to a set of rules for the task. But like I said in theory this is a good idea. In practice, well being a ruby developer means that I find puppet extremely restrictive. Simple things that I take for granted in ruby (in any programming language in fact) are just not available in puppet. Which is very strange to me, as the company claims to have been around for as long as rails and you would think that in the about 4 years that rails have been around puppet would have matured to a much higher level than where they are. In fact in using puppet I always have a feeling that I am using some outdated version of the code because it just does not allow me to do the simplest of things. For example before version 0.24.5 (or something like that) and bearing in mind that they are on 0.24.8 at the moment, you couldn’t even do

if $variable == something_else
Which means that because I am using ubuntu as my server and the version of puppet that ships with that is older than this, I cannot even do this. I asked on the irc channel about the best way to install puppet and they kept telling me to stick with the distributions copy or create a package for the distribution myself. I am obviously dealing with a bunch of sysadmins here, they never want anything to stray off the beaten path. And the thought of installing myself from souce, nooooooooo, burn him at the stake they cry. But anyway, I mean come on, for a configuration tool that claims to have been around for so long this is just poor in my eyes. I start to wonder that if it is just because the guys that produce puppet just are very paranoid and just don’t trust people to use the full power of ruby correctly. And if this is the case, it is kind of an insult and we as developers (or indeed sysadmins, which is who the tool is primarily designed for) don’t need to be babied in this way. Chef on the other hand (which I have no experience with, except for a lot of reading and research that I have done) seems to embrace the ruby (and rails) philosophy more. They give you a tool, written with an internal ruby DSL, meaning that you can do anything that you can do in ruby when writing the scripts, this means that there is not much momr learn for us ruby developers, just some new methods, and it has a top down order of execution, which mean that code is executed in the order it is written in, which puppet isn’t. I mean, why make things more complicated than they need to be? Companies systems are complicated enough, but to then go and invent, what in essence is a whole complex new language (a feature poor one at that), just to manage those systems is insanity if you ask me. But I digress. I will continue to battle the puppet in the coming weeks and see if I can get it to do what I want. But if it were my choice I would have gone with Chef, it might not have solved any of the bigger problems in any a simpler manner that I am having with puppet, but it would have been a hell of a lot less frustrating to be using a language I know, with rules that I know, and could debug problems within 5 - 10 mins instead of half a day. Oh and I must add that while there is a lot of puppet documentation out there, I find it disorganised, and unclear.I could be reading something and trying to apply it, only to find out through the irc channel that the way  I am doing it is deprecated or it applies to another version of puppet. Oh and just on the off chance I was reading an article in Linx-mag.com, and they just happen to mention both puppet and Chef, which is strange because system automation isn’t even the topic of the article. But here it is for you anyway http://www.linux-mag.com/id/7348/ And here is what Ezra of Engine yard fame has to say on the subject. http://brainspl.at/articles/2009/01/15/chef-suck-on-my-chocolate-salty-balls and http://brainspl.at/articles/2009/01/31/cooking-with-chef-101 I must admit that I have a basis towards Chef because of its pure rubyness, but then why make life harder than it needs to be. Ruby was made to bring the fun back into development, and it has spoilt me for any other languages, and without it I certainly wouldn’t be a developer anymore. Why? Life is too short. Puppet seems to want to more in the opposite direction to this. I have heard it said that ruby developers and stuck up and arrogant about their language, we have a right to be, it is a language designed for humans first, not machines. I seriously don’t understand how so many companies use puppet, but I guess the mind of a developer (especially a ruby one) is far removed from that of a sysadmin. Thank God!

Filed under General Ruby chef dsl puppet

0 notes &

gEdit == jEdit # false

But almost.

While I am a huge fan of jEdit I am constantly keeping an eye on other text editors making up the ground on its functionality.

Being a developer a slick fully fuctional, light weight editor is key for me.

Yesterday I took another look at gEdit, and to my surprise it has acquired a new plugin which not only equals the functionality of jEdit’s column select, it far surpasses it.

This plugin, Multi-edit, not only allows you to edit in columns but actually gives the user multiple cursor marks so that they can edit in multiple places not just in straight lines. I don’t really want to duplicate what is explained on the website already so I won’t, and instead just post the link to the page right here.

Muti-edit

What this means in the grand scheme of things is that gEdit is in reality one plugin away from being my editor of choice. What is stopping me at the moment? The excellent RecentBufferSwitcher plugin from jEdit that gives the user ctrl-tab switching to the most recently used files. Much of like how on most computers you can use alt-tab to circle through the most recently used applications.

And you may ask why I am looking for another editor when jEdit does all that I want, well java! Not the programming language itself (although that doesn’t help its cause) but the fact that jEdit (hence the j in jEdit) relies on the Java jvm in order to run. This has caused me a few problems in the past, not to mention the fact that it means that I have to install another piece of software just to use jEdit. Whereas gEdit is a native application and written in C and Python, meaning quick starts (depending on how many/few plugins you have installed and enabled), and no problems that I used to have with java applications running under compiz.

So seeing as it is just one plugin away from satisfying all my needs, I may take a stab at RecentBufferSwitcher functionality, but I am not making any promises. In fact I would even say that if someone were to volunteer their time duplicating the ctrl-tab functinality into gEdit I would pay them to do it. Something like 50 euros, I think it is a small cost for something that is so key to my job.


Anyway, jEdit here today, maybe gone tomorrow.

Filed under General editors gedit jEdit

0 notes &

Passenger For Nginx

Phusion Passenger, the application server that makes deploying ruby web apps on apache so easy, has now been ported to nginx, my web-server of choice.

And me being me, I have already switched all the ruby web apps I host over to using the passenger module in nginx. Which means that, no longer do I have to have apache running behind nginx to deal with the ruby apps using passenger. I can just do it straight from nginx.

Life is good

Get it here

http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/

Filed under Ruby nginx passenger phusion

0 notes &

New Theme

As you can see I am using a new theme for this blog.

Why? The other one was too dark, and this one is brighter, cleaner, and goes along with my new state of mind to do things and simply and with as little effort as possible.

Filed under General theme

0 notes &

Test Framework

I have decided that, just for a while (maybe more) I will leave RSpec in favor of a TestUnit + Mocha + Assert2 combination.

My problem with RSpec is that while the specs maybe easy to read, I always find myself having to read the documentation to find out how to write the assertions in the first place. And this for me means that it is not easy to use. Whereas with the above combo I think things are simpler and more straightforward for me.

Like I said in a previous post, I am tired of things that make me have to think about things that I don’t want or need to be thinking about all the time.  So, out with the old and in with the new. Or should that be out with the new and back to the old (with a bit of new).

Filed under Ruby assert2 mocha rspec test unit

0 notes &

Mack No More - I’m So Tired

I really cannot catch a break with a framework.

No sooner had I decided to use Mack as a framework, that the developer announces that it will no longer be maintained.

I am being pushed into a corner.

The only frameworks left that have the maturity I would like is Rails and Merb. Rails I am not too fond of the opinionated ways, and Merb will become Rails come version 3.

I think there is some sort of conspiracy theory going on out there to get everyone to use Rails. And too be honest as long as the Merb changes get rolled into Rails I wouldn’t mind. But the frameworks are in such a state of flux at the moment I am not sure what the right thing to do is. And I have no idea when Rails 3 will be ready.

Really I am just mentally tired of all of this. I would just like to use one framework that I like the philosophy behind and releases updates regularly. By that reasoning Merb would be the way to go, because although it will be merged to Rails 3, it, as the developers say, will have a clean upgrade path. Which should mean that it should act as just the next version of Merb.

So it is with some reluctance that I will go back to using Merb. What I am secretly hoping is that when Merb does get Merged into Rails 3 someone/some people will fork it and maintain it as a separate framework. I would love to do such a thing, but I have neither the time nor the inclination to do such a thing. I am at a point where I just want to use something that works and that is flexible. I am tired of hopping for here to there. I am tired of the time and thought given to doing things that don’t produce useful code, like thinking what framework to use and migrating code from one framework to the next just to test it out. To be honest I am starting to feel like I did in the Good (bad) old Java days when I am just getting tired of it all.

So to preempt that this is the plan. I am going to take the thinking out of it all and say this. Rails and Ruby got me to carry on being a developer and Merb embodied all the  things I wanted from Rails even before I knew of the project. So I am done with the endless thinking. I will use Merb, and follow whatever path and route is shall take, whether that be a merge into Rails 3 or whatever. As long as the principles behind it are still the same I don’t care anymore.

It is either that or call it  a day and do something completely different unrelated with computers and work with real people, which almost happened in the good (bad) old java days.

So there you have it, the flux has stopped for me. Wherever Merb and its philosophy goes so will I. Whatever shape or form it takes, I will use it. If there ceases to be a Merb (whatever name or form it may have), well then, I will cross that bridge when I come to it. But I am pretty sure I know where that bridge will lead and am sure that it will lead out of developer town. But who knows, life has a way of surprising you.

Filed under General mack merb rails