It's easier to just say "this() must ALWAYS be called first in constructor" and everybody understands... than to try and say "you can call this() after other statements, but not in a try block and not if those statements reference the instance under construction" which will certainly allow you to do more interesting things, but also be more confusing.
Foo(long x) { ... }
Foo(double y) { this(Math.round(y)); }
In the second constructor, the first call is Math.round(), followed by Foo(int). I am talking about evaluation order, not lexical order.I found myself needing to work around the limitation recently: https://github.com/nayuki/PNG-library/blob/b92cedc23b1fc32d5...
In all other cases, either super(...) or this(...) MUST be called exactly once. Additionally, you can't catch Exceptions thrown by a call to super(...) or this(...) (so you can't call them inside a try{} block). Finally, you can't reference any non-static members of the "this" object except to write to write to a field.
So yes, the rule is significantly more complex.
Bison from Buffalo coerce other Bison from Buffalo.
Generally, making a language more expressive makes it harder to parse. You have to know a lot more stuff. Computer languages often have a formal spec. I think java does, but I don't think perl does. Regardless, you just have to remember that footnote on page 26 of the manual that the construct X is an option.
I haven't touched java in a while, but I do remember some difficulty with parent class constructors calling methods implemented in the children, that relied on member variables that hadn't been initialized yet. I wish I could point at a concrete example, but I think it was something deep in the heart of swing (part of the jre so not changeable).
I can't imagine a way this makes it easier to parse in my head as I'm reading through code, or communicate failure. but there probably are libraries that become more usable with this new syntax.
It sucks because you're guaranteed super is called, the parent class can implement stuff that _has_ to happen. there's no way for me to force a subclass to call, something like pleaseInitializeAfterSuper(). and there's no way for me to do anything before super, right now.
Regardless, there's no easy way out. Making the language more expressive is a damn big hammer to use though. you'd think you could use a builder to guarantee initialization, But sometimes you can't.
To answer your question, no. I don't think this makes it easy to communicate why a program was rejected. it makes more programs possible though. At the cost of having to remember that footnote on page 26.
> Bison from Buffalo coerce other Bison from Buffalo.
The words don't have different meanings, though, at least in idiomatic English. No-one uses the word "buffalo" to mean "coerce". I'd be surprised if you could find even a handful of examples of it being used that way.
File the "many buffalos" thing under the same heading as the "code golf / obfuscated C" type things where you've got a chain of half a dozen ternary operators wrapped in a loop to make a state machine, where a switch() statement would suffice.
Vaguely related: www.marchmarchmarch.org.uk
(a badger being someone who makes badges, and thus badger badger being someone who makes badger badges)
Also, if you can have a badge depicting a badger badger, then badger badger badgers badger badger badger badgers.
PS. Mushroom! MUSHROOM! Panic, a snake!
I am not sure what your definition of "expressive" is. To me, effectiveness to convey thought or ideas in this context. And I don't have the faintest idea of what that sentence means.
Still, after I experienced the constructor-less paradigm in Rust, where you only can only construct structs entirely all at once, and every "constructor" is just a static factory function, it's harder to justify the traditional OOP paradigm in Java, C++, etc.
Moreover, given that Java calls overridden methods when super() calls a non-final method, the existing rules prevent some reasonable code patterns (again, see the proposal for the example) and the new ones allows to address those in reasonable and readable ways.