Bill (pstscrpt) wrote in computerscience,
Bill
pstscrpt
computerscience

OOP doctrine

What's the rationale behind only allowing a constructor to call the superclass's constructor as the first line? That always struck me as bizarre in Java, and .Net seems to have copied it.

While we're at it, how about optional parameters? C++ has them and classic VB has them, and I've written a fair amount of Java code that simulates them with method overloading (it can be done as long as there aren't many, but it's a nuisance). VB.Net has both optional parameters *and* method overloading, like C++, but C# only has method overloading. That would seem to indicate that they're frowned upon, but included in VB.Net for VB6 compatibility. Optional parameters are a useful feature; are they conceptually objectionable somehow?
  • Post a new comment

    Error

    default userpic
  • 10 comments