Women in Technology

Hear us Roar



Article:
  Readable Java 1.5
Subject:   Cholesterol - WTF?
Date:   2003-09-26 12:33:01
From:   anonymous2
Response to: Cholesterol - WTF?

Static methods are not called polymorphically. They are called by the name of the class they belong to, and not by using an object that's an instance of the class they belong to. So of course they can't be overridden in subclasses. If you want a method that's overridable, simply don't make it static.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Cholesterol - WTF? - I want Smalltalk
    2003-10-03 22:02:31  anonymous2 [View]

    Snif sniff, all these syntax sugar sucks!
    I want Smalltalk!! ... sadly Java is so popular that I have to work with it :-(

    The need for generics is a myth, from C++.
    With today's method dispatching techniques -- like inline cache-- (researched by Sun in the Self Language) there is not really a real performance gain with generics, and static type checking.
    In fact static type checking bothers in a OO lang... one example: the need of javabeans that makes extensive use of reflection.
    I think that static type checking must be optional (like in StrongTalk... again another researh language of Sun)
    And the use of Iterators makes poor encapsulation of container objects.
    I like the Smalltalk collection aproach, with "code blocks", for example to call the "print" method in each element you can do:

    aCollection forEachElementDo: [:elem | elem print].

    note1: forEachElementDo is not language construct is a method of the aCollection instance.
    note2: [ code ] creates an instance of Block