February 03, 2008

Philosophy and programming...

Another year... and the tree of wisdom is still as strong, unfocussed and entirely non-plussed about it too... So, its nice to have no changes of minds... no new resolutions... no newer constraints... nothing whatsoever to restrain and keep me from a path of constant drifting... Taking some time to look back at the path i have taken in the past year, setting aside my deliverables, i have dabbled in a fair few languages... Started with Perl initially. Writing small time server implementations using POE was fun, but that wasnt what i would call a paradigm shift from what i was used to writing initially using in Ruby. Then, came the stuff to do with VB and c# on .net2005. But till then i had not shifted entirely from the code that i was used to writing in Java. Or to be very blunt, the attempt can be termed as writing 'Java in  X', where is X is any language, subjected to the amount of 'Java" that can be written. This wasnt the first time i was dabbling in new languages though. But most of the other attempts were mere doodahs with no real purpose behind it and it never went beyond creating some silly console games and some gimmickry... This past year has been the year of enlightenment for the electrical engineer who defected to programming, me. This is pretty late, though i have a very "valid" excuse. Oh, i havent said what the "nirvana" feeling was all about.... but well, its cannot be cramped into one or two short sentences. So, i endeavor to provide this rather long account on my experiments with learning a new language and some thoughts on the things to consider. Atleast post-hoc i have noticed that i wasnt the only one in such a predicament, and that most of the mindless programming masses around me suffer from the same symptoms, in-fact if possible even severe. There are countless anectodes of despair and hatered towards learning new languages, fear of failures and countless lines of mindless code generated by people who are seemingly normal and devoid of any mind-numbing mental maladies.

But the point i was trying to make is that, every language has an underlying philosophy, or atleast most languages do. The reason why come languages turn out pretty neat and some others the way they are can be attributed to their "core-principle"(s)/ideologies etc,. Now, we have all seen these Learn X in Y hours claim to make us a master of programming in X within Y(ok.. i was stretching it a bit back there, say "Learn" not "Master"). When they come calling, i meekly surrendered to their will. But time and time again, i found that i was merely Java'ing in X and not "programming"... The trouble with these Learn X in Y hours(LXIYH) quickfixes is that, what is being achieved in the time period is a familiarity with the syntax, some new features that this aquired tongue(in this case X) has and the native (in my case Java) doesnt. But this doesnt lead you anywhere. The similarity between learning a programming language and a natural language cannot be ignored. The LXIYH are like say, Spanish Steps(or for that matter any of the X Steps tour). A crash course in japanese teaches one some important tricks for survival if paradropped into Japan, like asking for food etc. But such a thing cant help one compose haikus(not that everyone who is fluent in japanese compose haikus).

The thing about learning new languages is mainly to understand the needs and the pains that X is written to satisfy. Java, to take an instance, was to mainly

"We were after the C++ programmers. We managed to drag a  lot of them about halfway to Lisp."- Guy Steele, co-author of the Java spec

So much of Java's features and its constraints can be analysed based on this and few more quotes like these and the specification documents etc.(IMHO its not that the spec doc is a requirement to learn a language, but it is more than a necessity when it comes down to writing anything serious with it). The endeavor is to throw some light on the underlying philosophy of the language(i feel like im coming closer to start saying what i want to say, but not there yet). Ruby for example, was all about DRY. So, when I see some code that was written by me prior to this enlightenment and post-hoc, including the ones that i was very confident of as examplars of clean-coding practices, the difference just stands out. This type of realization is quite common with me. My first real object-oriented code(not the ones i was doing at school), made me blank out for two full days, rejoicing in the glory of human intelligence(thankfully that was my last internals, and i had peaked just at the right moment. By the time i gave my boards, i was in full-form!). Yeah, so coming back to the point, the language has to be learnt in its own right and not translated into the native. That it has to be learnt with its design principles and philosophy or not learn at all will be a better way of approach(either you know X or you dont, where X can be anything).

One more thing to consider is the place where X really belongs. There is the famous lisp-leaning article of Paul Graham that points out one major point that not all languages are suitable for everything. Trying to state it otherwise, we can arrive at something like, each language has its own strong and weak points, places where it can be used, should be used, should never be used, can be considered etc. To know the strengths and weaknesses of oneself is primary for survival and to not know the same for the language under consideration to be learnt is tantamount to being "dead" for all the time being spent in learning it. Say you have spent 10 days learning a new language and remain oblivious to these meta-info, then thats 10 days wasted, that could instead have been spent working out at the nearest gym or making out for a week with "someone" and spending the rest of the three recovering(not that these are very useful, but the task 1 is super-futile).

So, the end-note, to learn a language is to know where it can be applied, how it can be applied and to to do both efficiently and not just learning the syntax. That would be what is known as the moral of this rather long story on my musings on the year that hast rolled past.

Powered by ScribeFire.

August 01, 2007

Blackberry dev using eclipse

After a bout of three hours trying to configure, i gave up and went online to garner some info. Not surprisingly, lots have tried the same thing before me... some failed, some gave up yet some persisted with some workarounds... then i found this article. Pretty neat, contains a step by step information on configuring BB dev to work with eclipse, debugging et al. Well, goodriddance JDE! It was a pain!

powered by performancing firefox

July 24, 2007

Apache MINA!

Working with NIO wasnt as easy as i had initially presumed! Well, after two weeks of confusion, i was able to change all the stuff that i had already written into something workable(sort of production ready). Now, im looking for something much better than my own implementations, and planning to use MINA. On the first look, it seems to be really easy and seamless to integrate, but these days i cant be too sure of my first impressions. But it has quite some amount of flexibility in terms of custom protocols and well, lets see how quick i shall be up, about and running with it....

powered by performancing firefox

July 08, 2007

Random musings?? thoughts??

"Strange are humans and stranger the way they think. What lies in the murky depths of the folds in the cerebral cortex? What drives the mortal towards lust for everlasting power, even the thuggish know its all temporal except for lust?" so wonders the nameless-necromancer

Hmm... a little haiku possibly?? let me try...

The want of total control
Mankind all at war
So says God on judgement day

April 15, 2007

Open source and free-software??

Hmm... I read this article from "The" Richard Stallman @ GNU, when i was checking out a charting library for Java (JFreeChart)... This one elucidates the philosophy behind "Free Software", which according to him should refer to "free" as in "free speech" and not as in "free beer"... hmm... a VERY marked difference at that.. But thats not the interesting part, for there was something in there, that i have to accept that i was completely ignorant of till now! Come to think of it now, well, i had been quite dumb, but i can console my aching heart that not many know of the difference (not many near me anyways ). The one thats causing me trouble is this... Well, if u support "free software", then may be u would want to visit this one Have i done it?? Well... not yet!

powered by performancing firefox

April 14, 2007

What a sham??

If i can spend an hour to setup this blog, with some neat custom graphics, why cant i spend about 10 mins to post and entry? I have no answer to that cnundrum. Bit i have now configured performancing, hope this helps!


powered by performancing firefox

March 25, 2007

haha.. three times a year

Looks like if i keep blogging at this rate i will curn out 3 posts a year! Pretty sight it would make... haha

November 12, 2006

Exacty 2 week later... nuthing much happened

I have been writing some API style library for providing ready-made implementations of servers and socket handlers, that provide simple handling of sockets and build new/existing protocol based servers... jus got it registered in sourceforge...
Well... i just named is spoony...
Though i have no idea why i got stuck with that name, probably because of Detective Spooner... . watever...
So.. yeah... i have finished a draft of a portion of the features i felt like implementing... now i just have to use it in my current project and find out if it is as useful as i am currently of the opinion... well... i need to dish out more docs like... some feature checklists n stuff... and ofcourse the project site... but.... hmm..  it all depends on Kronos... (if only i hav the time turner or some crazy device)... anyways... hope the time comes sooner than i expect...

October 28, 2006

Echoing the world.. switching 2 AJAX

well... after some 5 days, i still havent made any headway into even starting to create a custom theme for Typo... though, the fact remains that most of the themes are not to my liking and a custom theme is always a niché thing... i havent been able to devote time or rather channelize my energies into doing somethin in that direction, may be because of the constant stream reprimands that i get from raghavan, or probably i had more interesting thing to do.. like checking out this nice AJAX framework in java...
NextApp Echo2...  Well... it looks like tooo good to me as you can possible write only serverside java code to render really good looking HTML pages. Well.. it basically works on top of servlets, and you dont have to dabble with lots of JavaScript, and JS aint my forte. Well, to quote them,

Echo2 unifies AJAX technology with a practical server-side framework to create a next-generation web application platform. For web application developers, Echo2 provides a familiar and powerful component-oriented framework that promotes event-oriented design similar to traditional thick-client user interface toolkits like Java Swing or Eclipse SWT. Echo2 leverages AJAX technology to deliver rich internet applications that create a user experience normally reserved for desktop-based applications.

I was actually in the process of searching for a pretty good framework in java where server-side push functionality (aka Comet)... Though the support is very limited and is not threadsafe(scroll to "Multithreading Concerns"). Anyways, im in the process of checking out a similar tagged framkework... Zk... This looks pretty good as well, and once again, no JS. ah! well.. GWT is one more option, but those guys have the Java2JS converter that converts your code to client-side JS anyways. Well, the good thing about most of these frameworks is that they offer very good integration with IDEs(Eclipse/IntelliJ)... But havent come to any conclusion yet.. lets see...

October 23, 2006

Hear ye! Hear ye all!!

I think this first post is will be a post to herald the post im going to post about my efforts in customizing this template to my liking! hmm....