Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 6th, 2004, 12:44 PM   #1
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 707
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
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?
thechristelegacy is offline   Reply With Quote
Old Aug 6th, 2004, 12:52 PM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Aug 6th, 2004, 2:29 PM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
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!
Pizentios is offline   Reply With Quote
Old Aug 6th, 2004, 2:40 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Aug 6th, 2004, 3:59 PM   #5
Pimp Daddy
Programmer
 
Join Date: Aug 2004
Location: Wherever the beautiful women are.
Posts: 30
Rep Power: 0 Pimp Daddy is on a distinguished road
Send a message via MSN to Pimp Daddy Send a message via Skype™ to Pimp Daddy
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)
Pimp Daddy is offline   Reply With Quote
Old Aug 6th, 2004, 7:06 PM   #6
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
My personal preference would be C++.
__________________
&quot;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.&quot; - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Aug 7th, 2004, 12:12 AM   #7
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
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 &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Aug 7th, 2004, 12:44 PM   #8
erebus
Programmer
 
erebus's Avatar
 
Join Date: Aug 2004
Location: /dev/null
Posts: 65
Rep Power: 5 erebus is on a distinguished road
Send a message via AIM to erebus
Quote:
Originally posted by thechristelegacy
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?
This depends on alot of factors. Would you mind telling us what you're trying to accomplish with learning either of those languages? That might give us some insight as to what the answer should be. If you're working with writting user applications on one platform, C++ will be your choice(although that is slowly changing with the Java and C# on center stage).

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'>&quot;Political power grows out of the barrel of a gun&quot; - Mao Tse-Tung</span></span>
erebus is offline   Reply With Quote
Old Aug 8th, 2004, 2:08 PM   #9
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 707
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
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
thechristelegacy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC