Quote:
Originally Posted by BiRDBRAiN
Personally I don't see anything wrong with Java syntax.
|
My main complaint is it's a verbose mess. Part of this is probably the fault of the Java designers but huge part of it is its relationship to C's syntax. There's stuff in there tat makes perfect sense for a language that could just about be a set of assembly macros that isn't quite comfortable in a partially object orientated language like Java.
Then there are things which one might actually consider broken. Here's my most recent Java WTF:
Code:
// what does this return?
for(;;) {
try {
return 1;
} finally {
break;
}
}
return -1;
It's just just plain odd behaviour that it doesn't return 1. Flow shouldn't be modified like that. There's also a lot of superfluous syntax in there all of which is a carry over from C.
Quote:
Originally Posted by BiRDBRAiN
I can go between different languages still, but I find the strict data typing in Java "comforting" if that makes sense LOL.
|
It makes perfect sense. I felt the same way right up until I "had" to start working in a dynamically typed language.
The basic argument here, and correct me if I'm assuming too much about your line of thought, is that you might pass an object into some code and have it explode because it does something horribly unexpected. This is a valid concern but turns out to be
very rare in practice. There are two main reasons for this not being a big issue in dynamically typed languages (as I see it):
- One can, and should, design by interface not type. If an object supports the method setFireToPants() then we don't care what type the object actually is so long as it knows how to put a match to its clothing. There isn't likely to be method name collision because,
- The types you might be working with are limited by context. If I'm working with containers I'm unlikely to accidentally try to open() an Array. If I working with network connections I'm unlikely to try to flatten() a TCPSocket.
Take this all with a grain of salt. Most of my commercial experience is with C++ and Ruby not Java. If a Java guru is reading this, please correct me.
Perhaps we should have a discussion about strong and weak typing next.
