27th Feb 2007 |
Tech Talk,
PHP,
Java,
Ruby,
Groovy | Comments Off
I can’t believe I never stumbled across this before; I’ve seen a few posts about Groovy on dzone.com previously and just ignored them. A couple of weeks ago however I bother to investigate this language - how I wish I’d done this earlier!
I recently bought the second edition of Agile Web Development with Rails, which is good and all but when I scour the net to see where Ruby is on the job front, it’s pretty bleak (at least in the UK if you don’t live in London).
Back to Groovy though; the first time I stumbled across some of the source I smiled - this is what I’ve been waiting for… I can see how the reduction in syntax could make purists turn red faced but from a productivity standpoint, not having to write such overly verbose code that is Java really appeals to me! (probably my nasty PHP habits)
It’s made Java fun again, dare I say it, it’s made Java groovy
(please put down those tomatoes).
I think stumbling across Groovy now is no co-incidence, what with version 1.0 just out the door and numerous books making it to the shelves. Things went from good to great when I Googled around for some Grails tutorials - the amount that can be achieved in such a succinct amount of code was a breath of fresh air.
Working with PHP all day (not exactly a verbose language), Grails looked like a significant improvement in productivity. Perhaps it’s the pedigree of the developers that have forged Groovy and Grails - PHP has always suffered from it’s low barrier to entry - Grails looks well designed and time will confirm this for me.
I’ve ordered Groovy in Action, and PHP in Action just for the hell of it (I saw Marcus Baker (who ran the PHP London user group until Mar 2007) in the authors list and thought this has to be a decent read since I’ve seen him speak nothing but sense on SitePoint’s PHP Application Design forum).
I’m not the only one who’s enthused… hopefully given Groovy’s heritage and the volume of Java programmers that can make an easy switch; commercial acceptance may be faster than that of Ruby, or at least taken more seriously/readily by big(ger) business.
23rd Feb 2007 |
Tech Talk,
Ruby,
JavaScript | Comments Off
I had cause to use script.aculo.us at work today, which depends on the Prototype framework. I’ve used Prototype previously (in fact on this very blog!). However, when I dropped script.aculo.us in on the site I was working on, all hell broke loose with my JavaScript breadcrumbs.
I was dynamically populating two arrays via PHP, one for the page captions and the other for the page URLs, JavaScript was then used to combine these arrays by way of Array.push() and Array.join(). After a few minutes debugging I realised Prototype was the culprit, spewing out a wad of JavaScript source all over the page header (innuendo not intended!).
A few more minutes Googling and I’d discovered it was Prototype’s Array extensions at work that had broken things. As explained by David Bergman iterating over an Array using a for (i in array) reveals the extensions added to Array class.
The author of Prototype (being a “Rubyan”) added these extension to bring JavaScript a little closer to home for the rest of the Ruby community. Converting my for to Array.each() remedied the problem - worth noting for future reference and hopefully this will save someone else 10 - 15 minutes head scratching. Thanks to David for his fine explanation and solution to the problem!
11th Feb 2007 |
Miscellaneous | Comments Off
Celebrities don’t look as good in person.
9th Feb 2007 |
Miscellaneous | Comments Off
I am still alive but am in the process of revamping this blog (a bit).
25th Dec 2006 |
Tech Talk,
Work | Comments Off
A couple of weeks ago I was having an informal discussion at work about another developer’s performance on a project. The developer had strayed from company convention and in his eyes had used many ‘best practices’ to improve things.
However, despite his best interests, the implementation was not only detrimental from a maintenance perspective (having increased the cognitive load for other developers by breaking from ‘the norm’) but also from a technical standpoint it was ‘best practice’ mis-used.
This was an unfortunate predicament but far from unique. A combination of inexperience and programmer’s ego had lead him to re-invent the wheel. Development time had doubled due to re-writing existing code (that worked).
I didn’t write this post to bash this developer as I’ve stood in his shoes on more than one occasion and re-written tried and tested code because I could make it ‘better’. The mentality of good developers is to do things right, not provide short cuts for convenience.
“I could use less code to do the same thing more efficiently and make it more cohesive, great!”
I thought to myself, so I did… it was fun; I was learning, getting to try out all my new found knowledge but it took me twice as long (at least) to fix bugs and implement new features as I re-invented the code base, byte at a time.
Fast forward to the present, when reflecting on this conversation I realised I still shared many of the same ideals as said developer. The key difference experience has taught me is to leave my experimentation at home and try not to bring it to work unless I’m confident that a solution that looks great in theory is also great solution in practice. Don’t make work your play ground.
Not being the developer in question and observing another’s work provided me with a different perspective. It allowed me to see how dissolved we developers can become with the problem and not see the bigger picture - we’re there to help run a business.
I find this both motivating and depressing. Motivating because of the responsibility and opportunity to produce a great product, on the flip side depressing because I’m not sure commercial programming still leaves room for what attracted me to programming in the first place… fun and freedom for creativity on the job.
I think the fun factor that every programmer feels when they first start or learn a new way of doing something will always be on a rocky road of high and lows. Gaining experience means those highs are spaced further apart.
Merry Christmas!
Update: I know it should be satisfaction minus minus but Wordpress thinks otherwise! (dammit, it won’t even let me write it in this post)