guy keren wrote:
now, if you wish to be useful - tell me how to make the jre avoidCan you? I thought the whole point with Java was that it was strictly typed, and thus no giving up on array bound checks.
performing boundary checking on array accesses - and you'll make me a
happy man (at least for several minutes).
<HUGE RANT APOLOGY>
I also have to say that I'm not sure I agree with some of the "Java is superior" statements. If by "correct" programming you mean "Does not do low level programming errors", I would have to agree. If, however, you mean "Designed right for the task at hand", "Implemented according to the task needed", or "Used best constructs for the job" (I'll even settle for "Used best constructs offered by your chosen language for the job"), I have to vigorously disagree.
The way I see it, good programmers write good code. Bad programmers write bad code. No programming language that I have seen to date ever changed that. It's true that the common mistakes of each language are different. For example, a common mistake in C and C++ is to forget to free your allocated memory, or to access memory that have already been freed. That does not happen so often (read - never) in Java.
Then again, a common mistake in Java would be to create an overly complicated inheritance structure for a task that would really be best served by a couple of functions and a global variable. That does not happen so frequently in C. Does that mean C is better?
I'll just qualify that last statement. While I have seen programming languages that made solving a specific task very easy, and thus resulted in even bad programmers writing reasonable code for solving those tasks, bad programmers tend to not know when is a good time to stop using that program. You then see the program stretched for things that it was neither designed to do, nor is very good at (nor, I should add, makes the programmer's life any easier in doing it). I think Visual Basic is an excellent, if extreme, example for this.
I will say this about Java. I think C's main strength is in being a very very simple language. It's power comes from trusting the programmer. Most of the people Java advocate stress as weaknesses in C come from this last point as well. C++ cannot be said to be simple. It's a very complicated language. It does still trust the programmer (with better warnings, mind you). It has another interesting quality - if you don't know a feature, you can opt to not using it. C++ "trust the programmer" means that any design you choose for your program, from a simple spagetti to real sophisticated OO is implementable, more or less as is. While not as OO capable as smalltalk, it goes most of the way and retains static typness. As evidance, there isn't a single C program that cannot be made to compile with a C++ compiler given a few simple substitutions of new reserved words and a few reinterpret_casts added (so named to discourage abuse, btw).
Java, on the other hand, claims to have found the answer. OO is how you program it. Multiple inheritance is evil. We'll take care of returning your memory when we feel like it. Destructors are "just for returning memory", and therefor not necessary. As a result, you see threads such as http://jguru.com/faq/view.jsp?EID=13946. This just means that there are some programs that you need to have a BETTER understanding of both compiler and runtime environment, or you won't be able to achieve them (at all, or at reasonable performance). Unlike the C++ case (and I do believe Java to be a little simpler than C++, though nowhere as simple as C), you cannot ignore constructs you don't know. There are some things you will simply not be able to achieve unless you know them.
Don't get me wrong. The constructs Java removed from C++ are being abused on a daily basis. The problem is surmised by the most fertile quotes author ever, J. D. Anonymous, "the problem with making a system fool proof is that fools are so damn ingenious". If you block the most common method of abuse, the fools will find a way around. It's a never ending battle, and the fools will clearly always have the upper hand here.
</HUGE RANT APOLOGY>
In short, I think one of the most important thing to know about a programming language is to know when to use it, and even more importantly, when not to. No programming language, ever, is the best choice for ALL projects.
Shachar
-- Shachar Shemesh Lingnu Open Source Consulting ltd. Have you backed up today's work? http://www.lingnu.com/backup.html
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
