Samstag, 26. November 2005
Scala makes things "just work"
Trackbacks
Trackback für spezifische URI dieses Eintrags
Keine Trackbacks
Kommentare
Ansicht der Kommentare:
(Linear | Verschachtelt)
Starting identifiers with numbers is generally bad practice and illegal for variable names in most languages.
Groovy can also compile to java byte code which makes it generally faster than most scripting languages
Groovy can also compile to java byte code which makes it generally faster than most scripting languages
Kommentar (1)
Yes, it is a bad idea to start identifiers with numbers, but that is not the point. My critic concerning the Groovy map syntax is, that it is not a map syntax. It is a property syntax.
There was a nice example on the mailing list where someone had to map numbers to the days of the week. That is not possible with this syntax, but not an uncommon case, I think. You also could not use variables as identifiers.
It is a nice syntax, if you accept, that it is just for properties. But why is it not a real map syntax?
Groovy is not very fast. Most other scripting languages seems to be faster, even if you compile groovy. But speed is not everything.
There was a nice example on the mailing list where someone had to map numbers to the days of the week. That is not possible with this syntax, but not an uncommon case, I think. You also could not use variables as identifiers.
It is a nice syntax, if you accept, that it is just for properties. But why is it not a real map syntax?
Groovy is not very fast. Most other scripting languages seems to be faster, even if you compile groovy. But speed is not everything.
Kommentar (1)
Ruby:
Struct.new(:firstname, :lastname, :age)
puts [Person.new(’Cathi’, ‘Gero’, 35),
Person.new(’Ted’, ‘Neward’, 35),
Person.new(’Stephanie’, ‘Gero’, 12),
Person.new(’Michael’, ‘Neward’, 12)
].select{|p| p.lastname == ‘Neward’}
Struct.new(:firstname, :lastname, :age)
puts [Person.new(’Cathi’, ‘Gero’, 35),
Person.new(’Ted’, ‘Neward’, 35),
Person.new(’Stephanie’, ‘Gero’, 12),
Person.new(’Michael’, ‘Neward’, 12)
].select{|p| p.lastname == ‘Neward’}
Kommentar (1)


Jörg bei Twitter

