Well, I think it is a matter of history and IT culture. Why is COBOL so bad labeled, I had opportunity to work with it and I found it a great language for business applications. Actually add to it OO and you get perfect business language. But no, academics (professors) want their students to be scientists, science is math, and math is assembly and C language. Computer scientist is scientist so he respects C language and despise easier COBOL for business, along the way came C++ and VB, so scientist naturally choose C++ for really hard math formula programs, complex code gets popular with scientific institutions and the language gets the emperor of the programming languages title. With the hype comes marketing and business people look forward to have C++ top notch programmers as superior race of programmers. On the productivity level, VB amazes the managers, instead of being late, now they have VB coders who produce fancy GUI and fast applications (80% of the world is MS based). However, the hype holds for C++ and even if you can do it in VB in 1 month, give it 3 or 4 months and you have it in C++, bravo (now you got it complex and scientific). Along the way, IT students divide themselves in two camps. Top markers go for C++ with full steam and patiently accept the pointers induced crashes (assembly/C legacy of low level programming), another group of students, ones who got life (and lower marks for time lost on life) adopt easier yet more practical approach, VB is easy to learn, gets the projects done sooner, and GUI is cool. Yet they are lazy labeled, hence not professional, and really complex code still is done in C++. So the natural progression of VB as a language is stuck, what does MS have to solve if VB is used for small to middle range projects and its good for it. Why add to it anything nobody will use anyway. Along came Java and C++ scientific community cheered, no pointers = no crashes (less anyway), no viruses, reduced complexity, more productivity (even academics forgot why they insisted on pointers at first place and now teach Java). C to C++ to Java progression inherited Java scientific hype of C++, MS had to respond and they labeled their Java C# and finally added what they should have long time ago to VB.Net. The syntax of VB and C# is different but funcionality very similar. Yet true scientist is C syntax oriented and everybody respects those good students and not lazy ones so the hype holds, and is properly payed for. I’m currently Java programmer who only casualy worked with VB so for me its C# to adopt (I was C++ student) and Java is great language. Is it slow? not really. Case: Empty loop of 10 000 billion iterations.
Create a simple test class which times a loop. The Java definition is
public class Loop
{
public static void main(String[] args)
{
//10 000 billion iterations
long time = System.currentTimeMillis();
int REPEAT1 = 1000 * 1000;
int REPEAT2 = 1000 * 1000 * 10;
for (int i = 0; i REPEAT1; i++)
{
for (int j = 0; j REPEAT2; j++)
{
//do nothing
}
}
time = (System.currentTimeMillis() - time)/1000;
System.out.println("Time taken: (in seconds) " + time);
}
}
The C# definition is
using System;
class Loop
{
static void Main()
{
DateTime start = DateTime.Now;
int REPEAT1 = 1000 * 1000;
int REPEAT2 = 1000 * 1000 * 10;
for (int i = 0; i REPEAT1; i++)
{
for (int j = 0; j REPEAT2; j++)
{
//do nothing
}
}
TimeSpan time = DateTime.Now - start;
Console.WriteLine(“Time taken: (in seconds) {0}”, time.TotalMilliseconds/1000);
}
}
Result: Time taken to run -
C/C++ == approx. 1 month
C# == approx. 1 month
VB. == approx. 1 month
Java == Under one second
So does all this mean that Java is really faster than other languages? Hundreds of times faster?
No, of course I was joking. If you read the code, you probably assume that the benchmark measures the time taken for any language to iterate a loop counter. In fact the benchmark measures the ability of a language to optimize an application by eliminating inefficient instructions. The Java server mode JIT compiler eliminates the empty loops completely from the JIT-compiled code. So Java really does not execute these loops at all and thats a catch. Can other languages be optimized to do that too? Yes of course, its a matter of compilers.
Advice: Don’t make syntax and compiler ruin your chances of getting bread. If you are good programmer, the code you make is complex to the degree it needs to be. VB code can be very complex according to the requirements, but languages themselves are very similar. So if you are ridiculed cause you are using easy to learn language (as it happened to me when I programmed COBOL) move on and give it some extra time to learn new syntax and let them pay you properly for the hype they created. As for the casing issue C/C++/Java/C# have been a case sensitive language from the very start of it, and how much are you ready to pay me if I take your lower case code and convert it properly for you (if its your only reason not to adopt more paying language then you are probably paying some pretty greenies anually for it anyway).
“Anis” (never study IT my son).