Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It was more like, "Dang, Perl users. How do you manage to get anything done with that rotting fish-head of a language? Check out what we have over here in civilization!"

... which is ironic for students of language design who realize that none of (for example) Ruby, Python, and PHP get lexical scoping anything close to correct, that none of them do object systems particularly well, none of them do an extension system particularly well, and only Python comes close to the amount of available and accurate documentation or the robust test coverage of the language and its features.

You can discount a lot of the rest of the criticism as "I didn't bother to learn what makes the language unique before writing a bunch of awful code" and "I don't like sigils but am embarrassed to sound that much a snob."



If you don't think Ruby's is good, what language does have a good object system? I mean, it essentially plagiarized Smalltalk, which has the best fundamental object system I know of — and added mixins, which complement traditional inheritance very well.

(Yes, its imitation of Smalltalk has a few seams showing — like the fact that blocks are not normally objects — but overall it's a pretty good if imperfect system. I certainly don't know of any language that gets closer.)


Ruby does have an advantage (thanks to its Smalltalk influence) of treating most primitives as objects in a much less clunky form than Python. That allows for many useful abstractions.

CLOS, Smalltalk, Perl 6, and Perl 5 with Moose have better object systems. Mixins suffer similar method resolution flaws to multiple inheritance, and the same problems with unconstrained monkeypatching show themselves with unconstrained duck typing in large systems.


How are the other systems better? I've bumped up into enough rough edges with Ruby to have a pretty good idea of where its seams are showing, but I've had to write a fair amount of code to get there and I don't have nearly the experience with the others to spot how they might work around the same design problems.


CLOS and Perl 6 have multiple dispatch, which improves genericity when used well. All four of the languages I mentioned have better metaprogramming capabilities, whether from runtime introspection in Smalltalk to a well-defined MOP in the other three. Smalltalk and both Perls offer better mechanisms for genericity, abstraction, and safety through traits and roles.


I mean, the obvious answer is CLOS, but a lot of people don't think that CLOS is an object system.

(To mean that it is very much different from smalltalk/ruby/java paradigm of single inheritance, encapsulation, and message passing).


I wonder if people think "CLOS is not an object system" because of its pervasive support for multiple dispatch.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: