sankara.me

Sankara Rameswaran

  • Linked In
  • Facebook
  • Moving on - Clojure

    • 7 Mar 2010
    • 0 Responses
    •  views
    • clojure tech
    • Edit
    • Delete
    • Tags
    • Autopost

    Until recently, I was a staunch believer in Java; of course, not without reasons. Here is a short list of things I found useful & convenient. Note that this list is as per my expectations as a naïve & novice programmer.

    1. Strong type system meant that I know what is in hand. This resulted in eliminating quite a lot of errors at compile time.
    2. No pointers. This was kind of a shock for me. I had always appreciated the ability to store links especially when it comes to data structures. Once I figured out the trick to live without pointers life was much easier. One more source of errors is eliminated from my code. No more debugging segfaults.
    3. Strong exception system let me anticipate errors and handle them gracefully. 
    4. A rather well defined OOP. List all advantages of OOP here. Java did a little *cleanup* of C++. Confusions and those that hamper readability of code like operator overloading and multiple inheritance were removed.
    5. Other strong advantages. A great set of library, platform independence, strong IDE support (of course the above points played a major role here)…etc.

    But as you approach “I know what I’m doing” these advantages would rather become sources of frustration. Code would be verbose than required; you feel strangled by the type system and exception system; you would find yourself having to learning a lot of best practises, industry standards, design patterns …etc. to overcome the inherent deficiencies of the language. There are two routes from here

    1. Religiously believe Java (also name x, y and z which are in the same domain as Java) as the best language out there and never realise that you are indeed at a disadvantage.
    2. Learn a more powerful language; a lisp preferably or a modern language like Scala, Erlang or Groovy.

    I was introduced to Erlang and Clojure quite a long time ago. But I was in (i). This coupled with the inertia (a fancy term for laziness), resistance to change and the lack of a place to apply my learning meant that I never took that up. If you are in an established company it is highly likely that you could never introduce a new technology. This is definitely not a bad thing. Of course, every company runs for profit and they don’t want you to be a rather irreplaceable resource. This is where working in a startup became an advantage. The list of language and technologies used in my present company goes on and on: Java/J2EE (struts, spring, hibernate, freemarker, ognl, velocity), Groovy/Grails, Python and now the latest introduction Clojure (not to mention other front end technologies) and introducing a new useful technology fitting a particular problem domain was well accepted and was the general norm. Also, I was exposed to these brilliant and thought provoking articles by Paul Graham: Revenge of the Nerds & Succinctness is Power. 

    I decided to update my toolbox and started learning Clojure. Why Clojure? The reasons are pretty much covered here. My major strong point was that I felt functional programming and lisp are a totally new way of thinking but yet clojure makes them usable in your day to day life. After using clojure for well over 3 months I feel my decision was indeed wise. A direct impact of this is that my Java code is much more succinct and yet readable. The impact was not limited to Java; my entire style of thinking was altered (in a good way). It does help you if you understand the limitations and drawback of the tools/technologies that you use. Functional programming is indeed radical, fancy terms like TDD would be just a way of life. This is a direct advantage of the fact that every function is self-contained and the scope/environment is small and easy to setup. That’s just one example that I felt personally. I definitely feel more satisfied now. Take a look at an example from the book Programming Clojure:

    Java code, from the Apache Commons

    Compare this to Clojure code

    • Tweet
  • Switch to Safari - Irritants

    • 5 Nov 2009
    • 0 Responses
    •  views
    • tech web
    • Edit
    • Delete
    • Tags
    • Autopost

    Recently switched to Safari to just try it out. Finding it to be good in terms of speed and rendering of sites. But of course not without irritants.

    1. No way to add more search providers – Locking to Google is CRAP! There seem to be workarounds but nothing works for Windows. The preference file is RSA signed. Why the hell would someone do that! Isn't this anti-competitive?! And btw, I love Bing. It's yet to be polluted with SEO junk.
    2. No undo closed tab - A problem that I get into very frequently. I'm one of those who close tabs inadvertently. And when the competition has it and as a user I have had a taste of it (including in IE8) why would I want to miss it.
    3. No process isolation - One crappy site, one tab hangs and you lose all your work? Oh come on!
    4. No recent tab order - Again having had the taste I'm missing this.
    5. Address completion is still naive - If you can optimize your algorithm to ignore the beginning "www" why not optimize it a little more search across words.
    6. No private browsing. - There, but!! What's the point if Google gets my cookie when I have chosen to browse in private! Why the hell did I turn on Private Browsing? To hide history in my browser but expose it to Google? Come on, guys! That's ridiculous.
    7. 280 MB for just 5 tabs in windows is ridiculous. I mean, seriously, not even Intellij Idea requires so much memory.
    8. Missing about:config or similar powerful preferences editor.
    9. Plug-in support - Same problem as IE. But IE is at least popular enough to have the most essential plug-ins.
    10. Clearing private data – Firefox beats everyone else.

     

    • Tweet
  • About

    Sofware Engineer with BankBazaar.com. Ex-Amazonian.

    74287 Views
  • Archive

    • 2011 (8)
      • September (2)
      • March (2)
      • February (3)
      • January (1)
    • 2010 (11)
      • October (1)
      • September (1)
      • August (2)
      • June (1)
      • May (1)
      • April (1)
      • March (2)
      • January (2)
    • 2009 (3)
      • December (1)
      • November (1)
      • September (1)

    Get Updates

    Subscribe via RSS
    TwitterFacebook
  • Sites I Like

    • Clojure: Getting Started
    • Personal Loan
    • Home Loan
    • Car Loan