While I am not a huge fan of using the out parameter in c# I would like to know why Java chose not to include it in its language syntax. Is there any special reason or maybe its because a person can simply pass an object as a parameter type?
Share
Java was designed to be a very simple language, with a very simple syntax – a kind of “Spartan OO programming language” in contrast to C++ with its abundance of features that hardly anyone knows and understands completely (including compiler implementors).
Basically, features were omitted unless they were perceived to be absolutely necessary.
On one hand, the goal was achieved – there are very few areas in which Java’s behavior is hard to understand or predict.
On the other hand, the missing features have to be worked around, which leads to Java’s oft-maligned verbosity. The designers of C# tried to build on this experience.
However, I personally wouldn’t count out parameters as a great loss.