|
|
|
luiscubal
|
|
Reply #3 Posted on: April 06, 2010, 08:59:31 am |
|
|
Joined: Jun 2009
Posts: 452
|
C#/Java: Rarely interpreted. Usually compiled. This is a huge point. It's the same for JavaScript. Almost nobody runs interpreted JS(IE9 has JIT too). Modern browsers COMPILE the code into native code. Which is why JS is recently having such huge performance boosts.
C++ is much LESS predictable than Java/C#. Undefined behavior is EVERYWHERE. Weird interactions occur. Stuff like buffer overflows make code pretty much impossible to predict. Java pretty much FORCES code to be predictable. Therefore, your "predictable" argument is bogus. Java and C# are predictable unless there is a bug in the VM/JITer. And, guess what, C compilers can have bugs too.
My main point is being closer to the processor(also known as "low level") is better if you want to solve a problem that's close to the processor(kernels are a typical example). As the tasks you need to do become more complex(and, therefore, require abstractions to be possible to solve), having "high level" languages becomes more useful. This is why C++ has some popularity over C - you can do ANYHING with C and, in fact, C code equates much more closely to the actual code being executed by the processor than C++. And this also why C# and Java become more popular as the task becomes more complex.
In other words, C++ is a low-level language, where everything is possible but nothing is simple. C/C++ are BRILLIANT languages for low-level programming. Java is a high-level language, where low-level things are more complex(and therefore hardly worth the effort to replace C), but things that were insane in C are very easy to handle in Java.
Low-level tasks -> Low-level language(C) High-level tasks -> High-level language(Java/C#)
|
|
|
Logged
|
|
|
|
|
|
|
score_under
|
|
Reply #7 Posted on: April 06, 2010, 09:38:17 am |
|
|
Joined: Aug 2008
Posts: 308
|
C#/Java: Rarely interpreted. Usually compiled. Excuse me for being a little ignorant on the subject, but every time I've seen something written in Java, it's been a ".class" file, and every time I see something written in C#, it has a CLR header (containing the CIL bytecode to the entire program) and a dependency on the .NET-interpreting DLLs. C++ is much LESS predictable than Java/C#. Undefined behavior is EVERYWHERE. Weird interactions occur. Stuff like buffer overflows make code pretty much impossible to predict. Java pretty much FORCES code to be predictable. C is predictable to me. Your idea of predictable is "do what I mean", and mine is "do what I say". If I want a program to be able to write 500 bytes to a 400-byte-long buffer, then I will do that. If I don't, I'll put the necessary checks in place. (Saying that, MSVC++ usually puts a check in place to make sure that a program will "abnormally terminate" instead of returning from a function if it sees the the return address has been smashed - it pads the return address with a few encrypted values to verify that nothing has overwritten it). Also, nobody [in their right mind] uses gets(). At all. They might as well rename it crashme(). In other words, C++ is a low-level language, where everything is possible but nothing is simple. C/C++ are BRILLIANT languages for low-level programming. I do have rather a thing for low-level programming. Java is a high-level language, where low-level things are more complex(and therefore hardly worth the effort to replace C), but things that were insane in C are very easy to handle in Java.
Low-level tasks -> Low-level language(C) High-level tasks -> High-level language(Java/C#) Actually, low-level tasks are completely impossible in Java, but high-level tasks are just difficult in C. Tried writing an OS kernel in Java? Not possible. In C, it's just difficult.
|
|
« Last Edit: April 06, 2010, 09:39:59 am by score_under »
|
Logged
|
|
|
|
|
luiscubal
|
|
Reply #9 Posted on: April 06, 2010, 09:50:27 am |
|
|
Joined: Jun 2009
Posts: 452
|
There was a time where people said C was too slow that it was unusable.(asm programmers) Turns out C is now "fast enough for most purposes, sometimes faster". http://unity3d.com/gallery/game-list/http://docs.google.com/viewer?a=v&q=cache:6aTCMeFMbfUJ:simcitysocieties.ea.com/help/readme/readme_en.pdf+Simcity+societies+.NET&hl=en&pid=bl&srcid=ADGEESjMcZl10XCwCQyoSjd83qROSAmuCKMshtYYzWKrU5o6pjTEmIOTfq1-tHdBVxcHMU5NaSfKUQ_gCfAFvYJAdnXrOMc8SeJkl2xezMkeFQ_0VKjDiHbrVIyYKAEoRWy27k390Gr7&sig=AHIEtbTeUtbE081MKORjFEzLRZej-lub-gSimCity Societies requires .NET 2.0. This will be installed along with SimCity Societies if necessary. Visit www.microsoft.com for .Net. With frameworks like Unity3D and XNA, along with Mono's iXXX efforts, I think the trend is going to be reversed. Java and C# are *COMPILED*. Get used to it. The JVM takes those class files and, depending on how much they are used, compiles and optimizes them(some classes are more worth optimizing than others). Those ".NET-interpreting DLLs" are the API, which can also be compiled. That's why it's called "Just-in-tme" compilation instead of "Ahead-of-time" compilation(JIT vs AOT) Java and C# do what I say too. So they are predictable(by your own definition of "predictable"). Sure, there can be errors on bound checking, but they are perfectly clear on the language standard, and therefore predictable. Yes, it is possible for kernels. Cosmos is a C# kernel. Not sure about Java, but I'm pretty sure they are possible. And, technically, it is possible to do *ANYTHING* in BRAINFUCK too. Which means your argument just puts C along with turing tarpits.
|
|
|
Logged
|
|
|
|
|
|
|
|
|
|