View Full Version : What is the difference between programming language?
kogo50
05-10-2010, 12:53 AM
I am a new programming and I know Java. I want to know what is the difference between Java and C++. I don't mean like the syntax or stuff like that I mean what is each one use for in today's programming. I know Java is used for mostly for web programming and general programming. As far as I know c++ is used for video games and low level stuff. But can Java do the same things as C++ and can C++ do the same things as Java? I ask this because I read a Java book to learn Java and it goes over the basics than Object-oriented programming than GUI and than web programming. My C++ book goes over the basics and than a little object-oriented programming and than advance stuff in C++ but it does not teach you how to make a GUI in C++ or object-oriented programming in c++. So can c++ do that stuff and how do I learn it?
BrickInTheWall
05-10-2010, 07:55 AM
You are correct in saying that C++ is more low level. In my opinion it's what makes C++ so popular: A good mix of low and high level elements. Anything you can do with Java, you could of course also do with C++, though sometimes it can be a bit more time consuming, since you need to take care of memory management yourself for example.
It's hard to list all the differences, but it already starts in the way both languages are compiled (Java uses an interpreter to run). Java is a completely object oriented language.
The more low level a language is, the more freedom you have, and the more you can do. Thought often you will not need this, and the high level languages these days have a load of libraries and other things to help the programmer have an easy time, and try to give him as many options as possible.
As for GUI, it's a bit easier in Java seeing as Sun provides a lot of help. In C/C++ you can use the win32 API or MFC if you're fine with your program only running on windows, but there are also a lot of GUI libraries out there like QT (which are OS portable), which take advantage of the object oriented side of C++, making GUI development much easier.
A language is a tool. Which one you choose should depend on the job you want done, that is, if you know more than one language.
A C++ book that doesn't teach you object oriented programming, and the affiliated concepts, is worthless. Most C++ books wont teach you GUI, since it's not part of the language. GUI programming is done with the use of different APIs, that are written/intended for specific languages. The win32 API for example is a collection of C-functions/macros, and MFC is an object oriented wrapper of this API, for use with C++. Again here: The more low level, the more options you have. Using the win32 API will give you more freedom than using MFC, but often you wont need it, which makes MFC the better choice to get the job done faster and in a smaller amount of code.
As for learning C++, I can recommend "C++ Primer Plus"...it's a load, but C++ is a difficult language to learn. I'm not very proficient using it, as I mainly use C and C#. It's also a good reference. It wont teach you GUI, but you should get the basics down first before going into that.
kogo50
05-10-2010, 09:53 PM
Thanks for the help you answered it perfectly. My book is Sams teach yourself C++ in one hour a day and its a good book but I wish it did a little more object-oriented programming.
BrickInTheWall
05-10-2010, 10:19 PM
I took a glance at the books table of contents and it seems alright to me. It seems to cover the basics of OOP. I don't know what the examples are like but probably not bad. Looks ok to me actually. I don't like the way it covers the "basics"...there are a few things I would like to see covered before getting into OOP. Still, its just a different approach that might suit some better than others. The book I suggested takes a while to get to OOP, and most of the examples are rather boring, BUT there are a lot. They are relatively short, which helps demonstrate important concepts for example. It's very theoretical and dry, but I prefer that, which (imo) makes it a good reference aswell.
I'd say stick to the book you got, it looks good. There's tons on OOP with C++ on the internet.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.