While editing an article on the Decorator pattern, I came across a paragraph which explained why Decorating was so much nicer than subclassing, in Java. (Besides the fact that you get major points from Pattern geeks, that is.) Apparently, constructors aren't inherited in Java. Yeah, I had to check several references before believing that.
Add to that the strict method signature checking, the requirement that constructors have the same name as the class, and you could find yourself (as in the first example in this article) declaring several constructors that meticulously gather arguments and call super() with them.
Gosling forbid a language should reduce busywork.
Re: A Language for People Who Like to Type (Score:2, Insightful)
You should spend more time working with staticly typed languages. It would be a "very bad thing" for a staticly typed language to inherit a constructor (you'd have a nasty case of memory corruption). If you think that is odd, you should take C++ for a spin. Member functions are not virutal by default. Or better yet, try writing OO-C sometime (no, not with glib. Take the time to actually setup
Re: A Language for People Who Like to Type (Score:1)
Is this because of memory allocation or method dispatch or something else I'm missing? I realize that allocation in C++ is tricky, but that's so rarely a concern in Java...
Re: A Language for People Who Like to Type (Score:2, Insightful)
The compiler keeps track of a base address and offset of class members (e.g., the struct/class starts at address 0xDEADBEEF and the m_udder member has an offset of 6 bytes). In static languages, the comp