Women in Technology

Hear us Roar



Article:
  Readable Java 1.5
Subject:   Cholesterol - WTF? - I want Smalltalk
Date:   2003-10-03 22:02:31
From:   anonymous2
Response to: Cholesterol - WTF?

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

Main Topics Oldest First

Showing messages 1 through 3 of 3.

  • Cholesterol - WTF? - I want Smalltalk
    2003-11-04 19:30:35  anonymous2 [View]

    Generics arent all good because of any potential speed increase.

    They are all good because they enforce homogeneous collections - and provide errors at compile time instead of run time. Doing run time checking to enforce homogeneity is clumsy.

    I consider them to be like exceptions, a real bonus to increasing readability.
  • Cholesterol - WTF? - I want Smalltalk
    2003-10-16 15:22:58  anonymous2 [View]

    I like the way java actually works. I don't want a foreach, and I don't like the way generics would work.
    But I like java anyway.

    If you like codeblocks you should try ruby:

    aCollection.each {|elem| print elem}

    note1 and note2 stay valid ;)
  • Cholesterol - WTF? - I want Smalltalk
    2003-10-06 15:48:25  anonymous2 [View]

    Yeah, that must be why languages like C++ and Java are on the way out and Smalltalk is making such a strong comeback. Sheesh!