![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Alright I want to move up from scripting languages like Python and JSript to a higher level langauge. Coming from people who have both worked with c++ and Java what are the pros and cons of each language and what would you guys prefer?
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
Damn, I wrote a long post for this and it blew up some how.
At any rate, I will keep this one short. Java is platform independent due to the Java Virtual Machine. This means that Java code is more "portable" to across different operating systems. Its a little more difficult to port code in C++ but not impossible. I mostly use and prefer C++.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
java can be slower too. Depends what your doing with it.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
Yes. Because Java is interpreted and not compiled.
![]()
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#5 |
|
Programmer
|
C++ Programming
Official Java website The above two websites should give you enough information to get started. They have tons of resources downloads and links. As for comparing the languages..... C++ ---------- This language (as I'm sure you'll know) has been around for years and is renowned for it powerful nature. Two major uses have been in operating systems and games programming. There are a number of different forms - unmanaged pre-.NET C++, the .NET variety and GNU C++, the latter being mainly used in Linux programming. Nowadays I wouldn't recommend using Microsoft's pre .NET offering. It can be complex in certain areas and it's perhaps best to learn something like Java or C# first. It is also prone to memory leaks if you're not careful and always beware of pointers - get them wrong and you could be in trouble. The .NET variety was a big improvement. It is still highly powerful. It's one of the languages that I'm learning at the moment and I can tell you that while it can seem very complicated at first, once you get into it you should be OK. Once again though I wouldn't recommend it as a first language. The GNU offering has some significant differences, however it is widely used and by learning the GNU extensions aswell, you'll be able to more easily port your apps over to Linux. Java -------------- This can be an ideal first language. Once you learn this you can go on to learn languages such as C++, C# and VB. It uses a virtual machine to ensure portability. This means you probably won't have to do any editing to your code to make it available for multiple platforms. Two major uses have been in the internet and mobile phones. However, the use of a virtual machine takes up memory which means it slows the programs you make down. Sometimes this maybe barely noticeable but when your programs get bigger - watch out! The javadoc facility which is used to document the code is cumbersome and complex. The code can also be verbose and in some areas it may lack power. Conclusion ------------------ I would say that if you want to enhance your learning and have a better grasp of the basics then Java is ideal. It would be also ideal if you want to program for phones. However, if you want to build much more powerful apps or games that are virtually platform independant without a loss of speed, then the more complex C++ is the way to go.
__________________
David Morris BSc.(Hons), MBCS Qualified Computer Engineer Administrator (SEED Software) |
|
|
|
|
|
#6 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
My personal preference would be C++.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#7 |
|
Expert Programmer
|
Java has a lot of higher level funtions that you would not normally find in C++, like built in memory management and a huge array of classes which are not available without libraries or code add-ons in C++, however C++ will execute much faster since it kills the needs for a virtual machine to interpret the byte code (overhead) but is a little bit less more cross-platform (cross-platform is not that difficult to accomplish in C++, just not as easy as it is with Java).
C++ has STL, but not a whole lot of higher level functionality above that. C++ tends to be more practical for real world problem solving then Java (which tends to have its presence more specifically in certain web applications and academia).
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#8 | |
|
Programmer
|
Quote:
Java would be your choice if you don't want to interact with your machine in a low-level fashioin(i.e. pointers, d.m.a, inline assembly). Java is rich for platform independent development which is great when you're working with toaster ovens, since you could load your program on virtually and kind of device with the required virtual machine. This is a dream for any robotics or embedded developer, so if you plan on jumping into this field, that should be something you should consider. Also, you'll find yourself in the comfort of another very high-level language, like your Python :-P. It's all relative to what you want to do, really.
__________________
<span style='font-size:14pt;line-height:100%'><span style='color:red'>"Political power grows out of the barrel of a gun" - Mao Tse-Tung</span></span> |
|
|
|
|
|
|
#9 |
|
Expert Programmer
|
Alright, well I made my decision to write in c++ for speed and power. Plus it seems to have a wider array of uses. Plus that's going to be the language of the project so it will give me a reason to start learning it. Thanks guys
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|