[QUOTE=ROBO_DONUT;33491574]If Java ran faster, it was an implementation issue, not a language issue.[/QUOTE]
[url]http://scribblethink.org/Computer/javaCbenchmark.html[/url]
Took me a while to find. It was a few months back in my search history.
Edit: Ironically, I found that article by searching something along the lines of, "Why do Java Swing layouts suck so much?"
[QUOTE=Jookia;33491570]My example showed how operator overloading can be used to make life easier. If multiplication with vectors is ambiguous, then you shouldn't be overloading multiplication. But with things that aren't ambiguous, overloading helps make code cleaner and more readable.[/QUOTE]
You're still assuming that you're the one writing the code. Not everyone is sensible.
Writing out dot(vec3, vec3), cross(vec3, vec3), and add(vec3, vec3) is always clearer than overloading operators that are already defined for some other purpose.
[editline]29th November 2011[/editline]
[QUOTE=Soviet_Banter;33491625][url]http://scribblethink.org/Computer/javaCbenchmark.html[/url]
Took me a while to find. It was a few months back in my search history.
Edit: Ironically, I found that article by searching something along the lines of, "Why do Java Swing layouts suck so much?"[/QUOTE]
"linux2.2 gcc (2.9x) [b]-O6[/b]"
He doesn't understand GCC.
[QUOTE=ROBO_DONUT;33491629]You're still assuming that you're the one writing the code. Not everyone is sensible.
Writing out dot(vec3, vec3), cross(vec3, vec3), and add(vec3, vec3) is always clearer than overloading operators that are already defined for some other purpose.[/QUOTE]
vec3 + vec3 and add(vec3, vec3) are the same things, yet one uses an operator and one uses a function.
I'm not saying that operator overloading is the right tool for every occasion, but if you had something a BigNum class it'd make sense to overload the operators.
[QUOTE=Shammah;33491236]For the love of god, [B][U]DON'T[/U][/B] use Java. It's missing key features like default parameters, operator overloading and other general things.[/QUOTE]
I absolutely hate operator overloading.
Most of the time you can't easily tell what the fuck the operator does to the objects without looking at the function definition.
[editline]29th November 2011[/editline]
Looks like I didn't read the operator overloading debate that came after the comment I replied to. :v:
[editline]29th November 2011[/editline]
[QUOTE=Jookia;33491570]My example showed how operator overloading can be used to make life easier. If multiplication with vectors is ambiguous, then you shouldn't be overloading multiplication. But with things that aren't ambiguous, overloading helps make code cleaner and more readable.[/QUOTE]
It's only not ambiguous if you're working with primitive data types, which you can't overload anyway.
[QUOTE=ROBO_DONUT;33491529]And then you have to worry about what multiplication does...
It's clear to you [i]when you're the one writing it[/i], but it's just a source of uncertainty for anyone reading your code.[/QUOTE]
Soo.. You'd rather have the multiplication operator do essentially nothing, or something completely unexpected and wrong, rather than have it return the common sense value?
Seems really stupid ([b]really stupid[/b]) to have such a nonsensical hatred for overloading. If the person using/reading your code is too inexperienced and inept to understand the basics of the way your code has handled its overloading, that's on them. Overloading is extremely helpful and it shouldn't be tossed aside for a nonexistent feeling of "clarity"
Operator overloading. Let me select a random line from a physics calculation here...
[cpp]
fthrust -= rot.GetYawRight() * ((cam_vRt - cam_vLt) * mul);
[/cpp]
Without operator overloading:
[cpp]
fthrust = fthrust.sub(rot.GetYawRight().mul(cam_vRt.sub(cam_vLt).mulScalar(mul)));
[/cpp]
It's up to personal preference. I wouldn't attempt the latter if I didn't have to, though.
IIRC Java is the same speed as C#, or atleast close to it. I don't know where all this "java is so slow" or where this "java is much much faster than C" is coming from. It depends in the context of usage. Java can do 3D fine, it can do 2D fine, just like C#.
[QUOTE=Map in a box;33496463]IIRC Java is the same speed as C#, or atleast close to it. I don't know where all this "java is so slow" or where this "java is much much faster than C" is coming from. It depends in the context of usage. Java can do 3D fine, it can do 2D fine, just like C#.[/QUOTE]
When you're going through a graphics API like that, most of it is native machine code routines written in C anyway. Not only that, but much of the time you're waiting for draw calls to finish, which is a lot of GPU crud and transfers over the system bus. So judging performance of a language by the performance of an OpenGL/D3D program is fallacious.
The issue of language speed comes into play when you need to do things like collision detection, physics, or pathfinding.
Java [i]is[/i] slow for tight loops and math-y applications. Additionally, the GC likes to kick-in and halt everything else at inopportune times. C# suffers from all the same issues.
So yes, it's slow, but it's up to you to decide whether you actually need the performance. In many cases, the overhead doesn't matter. In some, it does. And, like I said, you can work in any of those languages and benefit from the speed of C/C++ whenever you need it by going through the C API (JNI, for Java). Start in whatever you'd like, profile, then go back and improve whatever needs improving.
COBOL.
java, use a free opengl library, steal someone else's game idea, give it horrible graphics because that's all you can do, make $60 million.
[QUOTE=ROBO_DONUT;33496795]When you're going through a graphics API like that, most of it is native machine code routines written in C anyway. Not only that, but much of the time you're waiting for draw calls to finish, which is a lot of GPU crud and transfers over the system bus. So judging performance of a language by the performance of an OpenGL/D3D program is fallacious.
The issue of language speed comes into play when you need to do things like collision detection, physics, or pathfinding.
Java [i]is[/i] slow for tight loops and math-y applications. Additionally, the GC likes to kick-in and halt everything else at inopportune times. C# suffers from all the same issues.
So yes, it's slow, but it's up to you to decide whether you actually need the performance. In many cases, the overhead doesn't matter. In some, it does. And, like I said, you can work in any of those languages and benefit from the speed of C/C++ whenever you need it by going through the C API (JNI, for Java). Start in whatever you'd like, profile, then go back and improve whatever needs improving.[/QUOTE]
with C# you get things like structs and the ability to allocate pinned memory to use pointers. It's quite possible to optimize C# applications to be very fast, but if you absolutely need the fastest code possible, then you'd just use PInvoke to do all your math-heavy calculations.
I use C because no body bad mouths C.
I'd say D, it's just not widely used enough to be easy. You can get an opengl instance up and running without issue though.
Sorry, you need to Log In to post a reply to this thread.