By using this site, you agree to our Privacy Policy and our Terms of Use. Close
TheRealMafoo said:
NJ5 said:
supermariogalaxy said:
Yeah, I heard Java wasn't so fun, I heard it's also slower than C++.....But my cousin told me for games, Java has better graphics, is this true???

Yes, most languages are slower than C++. Of the most used languages, the only ones which are faster than C++ are C (or C++ without the object oriented part, which is basically C) and Assembly.


C is not inherently faster then C++. In some compilers, C++ is converted to C before it's compiled. Fortran is faster then C or C++. Because it does not use pointers it's easier for the compiler to optimize the code. It can do a better job of predicting when it needs to fetch something out of memory, and how long to keep values in registers.

It's why a lot of people who do a lot of CPU intensive calculations still use it. (Like blast analysis algorithms that might take 2 days to run)

As to the OP, it’s been said here before, but to reinforce the point… the language is not important. Learning what OOP is, and why you would use it, along with programming algorithms is what you want to focus on. Once you know those things, you’re in good shape. There are dozens of good languages, and based on what you plan on doing, you will be using different ones.

 


Just because C++ is sometimes converted to C, it doesn't mean it's not slower. After all, all languages can be converted to machine code, and we don't say that they aren't slower than machine code ;) Certain constructs that C++ encourages make it slightly slower than the code most C programmers would write. It's certainly a very small hit considering the benefits though.

But your point still stands though, performance is not one-dimensional.

 



My Mario Kart Wii friend code: 2707-1866-0957