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. "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
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
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.