Friday, August 3, 2012

Episode 17: Java


Tool of the Biweek


  • 1995 “Write Once, Run Anywhere”
  • Applets
  • 2006 Open Sourced*
  • Third Party Virtual Machines

  • Generics
  • Garbage Collection
  • Interfaces (sort of like multiple inheritance)
  • Checked Exceptions (except for RuntimeException)

  • Platform Agnostic
  • Large community support
  • Many Libraries

  • Speed
  • Hardware Abstraction
  • Forced object-oriented architecture (not functional)

  • Eclipse
  • Netbeans

  • Web
    • Server (Tomcat, JSP)
    • Client (GWT)
  • Android


  1. Just a few comments.

    """they kinda made sure [Java] was sort-of pure"""
    Very much sort-of, as in not much at all. In some ways its more pure than C++, in other ways less so. OOP purity means everything is an object, but it took them nearly 10 years to tack on autoboxing. Bodiless mixins (interfaces) lead to more copy/paste/boilerplate which is anathema to the code reuse that object composition should grant. One might expect some consistency about things like operator overloading, which they decided was bad except when they do it (+ for strings). Member function pointers don't even exist in Java, like decapitation as a solution to beating your head against a wall. The closest you'll get is a reference to an instance of an anonymous class implementing an interface, which is like surviving the guillotine because the blade was so rusty; beating your head against the wall doesn't feel so bad after that.

    As to whether a professor should teach Java or Python to new students, I'd say Python because what Java teaches you is impoverished OO, senseless boilerplate code is somehow needed, IDEs are a requirement (see boilerplate), keeping track of types is the best use of a programmer's time, generic programming is only good for collections and more broadly "metaprogramming - what's that?"

    If you need to compile everything before it will run and obsess about types when you don't have pointers and can't work with memory directly anyway, that's just more turn-offs for those starting out. Its telling that MIT doesn't teach Java, at least initially.

    Though its fair enough to use reference counting to explain the concept of garbage collection, its important to note that Java doesn't do reference counting. If it did, then it could have deterministic finalizers.

    """you'll always make a mess if you write in Perl"""
    My experience differs, its possible to make a mess in any language, and a language that is succinct opens up whole vistas of tidy. Try searching for "modern perl".

    Despite the rantish nature these comments are intended to be constructive with respect to the fine effort put in by the presenters :)

  2. How is it that just anyone can write a weblog and get as popular as this? Its not like youve said anything incredibly impressive more like youve painted a quite picture above an issue that you know nothing about! I dont want to sound mean, here. But do you actually think that you can get away with adding some quite pictures and not seriously say something?

  3. Thank you so much for sharing all this wonderful information !!!! It is so appreciated!! You have good humor in your blogs. So much helpful and easy to read!
    Java Course in Pune

  4. JavaScript is among the most favorable programming languages to learn for hobby projects and career/job perspectives. Make friends with JavaScript and advance your career as a JS developer. Either you are learning JavaScript afresh or brushing up your programming skills, you will find these ten hottest online JavaScript courses worth your time, effort, and money. best free javascript courses