Sunday, July 3, 2011

The Joys of the Craft : Why Programming is fun ?

What delights may its practitioner expect as his reward?

First is the sheer joy of making things. As the child delights in his mud pie, so the adult enjoys building things, especially things of his own design. I think this delight must be an image of God's delight in making things, a delight shown in the distinctiveness of each leaf and each snowflake.

Second is the pleasure of making things that are useful to other people.Deep within, we want others to use our work and to find it helpful. In this respect the programming system is not essentially different from the child's first clay pencil holder "for Daddy's office."

Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning. The programmed computer has all the fascination of the pinball machine or the jukebox mechanism, carried to the ultimate.

Fourth is the joy of always learning, which springs from the non-repeating nature of the task. In one way or another the problem is ever new, and its solver learns something: sometimes practical, sometimes theoretical, and sometimes both.

Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures. (...) Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separately from the construct itself. It prints results, draws pictures, produces sounds, moves arms. The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be.

Programming then is fun because it gratifies creative longings built deep within us and delights sensibilities we have in common with all men.

Note : This excerpts are from classic The Mythical Man Month Anniversary edition a must read for every software developer.  

Wednesday, June 29, 2011

Eclipse-ing fast !!

I recently switched back eclipse and voila i don't remember a single shortcut now. Its very painful to keep searching for right shortcut. Here are few points to help you find yours way on eclipse.  

1. Shift+Ctrl+L (Shift+Command+L on mac) : This opens the list of shortcuts available. Very helpful in remembering the shortcuts.


Now just scroll and remember some very helpful shortcuts.

2. Ctrl+3 (Command+3) : Sometimes you need to access functionality which does not binds to any command (aka key shortcut) than this is very helpful shortcut. Just press Ctrl+3 and start typing the name of the functionality you are looking for. For example if you wants to find the formatter. take the following route : 


As you can see it display every single functionality which contains work "code style" now just select the one you wants to use.

Remember these shortcuts when next time you need help in eclipse. 

Note: Used gmail-embedded image which got lost in transmission. screw google, will fix it tomorrow 

Happy hacking!! 

Tuesday, February 8, 2011

The Assignment

"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy’. They told me I didn’t understand the assignment, and I told them they didn’t understand life."
— John Lennon

Sunday, February 6, 2011

Gmail Attach file helper

This is real cool. Not a big thing to do but very helpful for scatterbeans like me who often forgets to attach file. Now If Gmail finds I have attached, Find Attached, Attached File etc and no file as attached than it pops a confirmation dialog to make sure you have not forgotten to attach something !! yay !!

Facebook can do a lot more

Building a fun place for 500 million people to share pics and play silly games is *NOT* that cool. I believe what more cool is to enable technology for freedom of expression and not to chicken out something which facebook is doing in the case of egypt crisis. They are okay to let their 5 million egyptian members down because they don't want to make angry egypt govt. and other countries under dictatorship. And expecially China where they are banned but want a pie of 420 million people using internet. If Facebook wants to remain a place where people hang out with their friends they certainly have to do more .

More on this:
* Facebook's China interest
* Why Facebook Should Do More to Help Egypt's Protesters
* Facebook treads carefully after its vital role in Egypt's anti-Mubarak protests

Saturday, January 29, 2011

Facts and Views

The very powerful and the very stupid have one thing in common. Instead of altering their views to fit the facts, they alter the facts to fit their views . . . which can be very uncomfortable if you happen to be one of the facts that needs altering. --Doctor Who

Thursday, January 27, 2011

Civilized man

Civilized man refused to adapt himself to his environment; instead, he adapted his environment to suit him. So he built cities, roads, vehicles, machinery, and he put up power lines to run his labour-saving devices. But somehow he didn't know where to stop. The more he improved his surroundings to make life easier, the more complicated he made it. So now his children are sentenced to 10-15 years of school, just to learn how to survive in this complex and hazardous habitat they were born into. And civilized man, who refused to adapt to his surroundings, now finds he has to adapt and re-adapt every hour of the day to his self-created environment. For instance, if it's Monday and 7:30 comes up, you have to dis-adapt from your domestic surroundings and re-adapt yourself to an entirely different environment. 8:00 means everybody has to look busy. 10:15 means you can stop looking busy for 15 minutes. And then you have to look busy again. And so your day is chopped into pieces, and in each segment of time you adapt to a new set circumstances. No wonder some people go off the rails a bit...

Friday, January 14, 2011

Begin from the beginning

Once upon a time a programmer came across a book describing a funny
programming language. It had an unfamiliar syntax, equal didn’t mean
equals, and variables weren’t allowed to vary. Worse, it wasn’t even
object-oriented. The programs were, well, different....
Not only were the programs different, but the whole approach to pro-
gramming was different. The author kept on and on about concurrency
and distribution and fault tolerance and about a method of programming
called concurrency-oriented programming—whatever that might mean.
But some of the examples looked like fun. That evening the programmer
looked at the example chat program. It was pretty small and easy to
understand, even if the syntax was a bit strange. Surely it couldn’t be
that easy.
The basic program was simple, and with a few more lines of code, file
sharing and encrypted conversations became possible. The programmer
started typing....

Guess which programming language i am talking about ;-)

Saturday, January 1, 2011

Java mistakes which should be corrected in future.

These days i am re-iterating all my language concepts especially java concepts. Actually i am reading a book called Java: The Good Parts. So reading this after doing a good amount of ruby coding gave me some understanding of things which i would like to be changed in Java Future versions.

1. Primitive Types : Primitive types certainly breaks the notion of "everything is an object". It makes special rules for those small types. Yes Autoboxing is smart thing and we dont need to thing about conversion anymore but we can go one step ahead and replace primitives types by real objects and compiler can take care of optimization.

2. Static : First thing i learned in my pairing session at ThoughtWorks was not to use Static as much as possible instead create a singleton object. Reason again it breaks the "everything is an object" model.We lose the freedom to override the behaviour as static calls are are linked compile time. And testing a static method is lot more tough task as mocking is cumbersome.

3. Checked Exceptions : Because nobody use them anymore. Most of the time if problem occurs we can't do much other than telling user something wrong happened and continue or shutdown.

4. Every Object is a Lock Object : This i realized while reading the book and i was like what. I am doing java programming now for three years and i didnot realized this we can take lock on every object while writing synchronised block because every object has in-built lock. This sounds pretty waste of resource. Instead we can start using explicit Lock object like we do in C++.

If we try to make these changes than the resulting java will not be compatible with its previous versions but it will be lot more cleaner and awesome language.
And i also want ruby/python hash like datatype. It is so so awesome just like swiss army knife ;-).

I wanted to start the year with a bang just the way i ended last year thats why this post. So happy new year to all.