21 September 2010

Some comments from various source codes

In case you haven't yet seen this memorable article do check it out. Some examples :

// 
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 25
//

// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets
// released into the public.

// Magic. Do not touch.

// Replaces with spaces the braces in cases where braces in places cause stasis
$str = str_replace(array("\{","\}")," ",$str);

/**
* This method leverages collective synergy to drive "outside of the box"
* thinking and formulate key objectives into a win-win game plan with a
* quality-driven approach that focuses on empowering key players to drive-up
* their core competencies and increase expectations with an all-around
* initiative to drive down the bottom-line. I really wanted to work the word
* "mandrolic" in there, but that word always makes me want to punch myself in
* the face.
*/

,and the famous :
#define TRUE FALSE //Happy debugging suckers

15 September 2010

jQuery for dummies


As I was rudely forced in the the magnificent world of jQuery I needed to find a starting point for understanding it's universe. The question that I am now trying to ask myself is "Is jQuery better than simple JavaScript?". Of course this would be very difficult to establish, mostly due to the fact that jQuery IS JavaScript.

So, coming back to the starting point, the first thing a Java developer like me does is try to find API documentation. I was pleasantly surprised to find out that it is very well organized and most importantly filled with examples. jQuery is off to a good start.

For the most inpatient of my readers you could simply jump into the ocean of plugins that are developed by the open source community. You will find very interesting layout frameworks, as well as a centralized theme management tools and gadgets such as notifications and etc.

At the end of the day I still feel a bit strange. jQuery is undoubtedly a revolutionary extension to the way JavaScript is used. The ease with which one could select elements, transverse over the DOM tree, change the elements themselves and interact with CSS is astonishing. Unfortunately since it is built over JavaScript jQuery exhibits some of it's weaknesses. Debugging is a real hell at times (even if you are smart enough to test on Firefox + Firebug), the lack of typification is confusing and sometimes you just can't understand why for( a in b) is not the same as b.each(function(){}).

I'd still recommend adopting it though if not for something else but for the great community and support.

Tools I used:

* Eclipse (interesting plugins would be Aptana and jQueryWTP
* Firefox and Firebug
* all the sources of documentation mentioned in the beginning

13 September 2010

Java2Days 2010


Java2Days is coming again!

This year's conference would be split into three groups : Mobile2Days, Cloud2Days and Java2Days. The prices are almost the same as last year's. The discount for an early registration is 20% but the end date is 15 of September, so if you are reading this you have no more than 2 days left.

The agenda is published early this year and it looks promising - some topics on HTML5, Spring, OSGi etc.

The event would be held in the International Expo Center (IEC) in Sofia, Bulgaria.