-
To learn C or C++?
Greetings all.
I have seen it touched on a bit in the FAQ, but I really still feel the need to ask before I dedicate my time to learning a language, I wanted to get a bit more info on the subject.
Mostly, I would greatly like to simply learn C++, because for me it would be a refresher as I had used the language about 8/9 years ago when I was learning to program and wanted to, like so many, bust into the game industry. Unfortunately, I was sucked into Web Development as a profession, and learned many tools (PHP namely, which obviously has syntactical/structural similarities to the C family) but dropped away from more standard programming.
However, my concern is one of platform independence. It seems that C++ is much more platform dependent than C. So, I guess my question is... is it worth learning C simply to maintain platform independent code, or is C++ a viable option to developing platform independent software as well?
Thank you in advance,
Xark
-
If your C++ compiler conforms to the ANSI standards (and most do) your code is totally portable.
-
I see...
May I ask, is there a particular tutorial/site/book that you might recommend (perhaps even on this site) that teaches the path to ANSI standard C++? What I mean is that I'm sure many tutorials are OS/System specific, and one would have to later go back and learn what is and is not ANSI standard.
Also, do you think it is viable that serious application development could take place in purely ANSI std C++ or do you think that most applications require platform specific tools, APIs, etc that make it more efficient to use A) C or B) A different language perhaps?
Thanks again,
Xark
-
>>do you think that most applications require platform specific tools, APIs, etc
Yes. Very much so, especially in the gaming industry. Its basically vital.
It really depends on what you're trying to accomplish. Obviously there are many applications of C++ to which platform independance is irrelevent. Most non-standard C++ code will port very easily anyhow.
I'd recomend C++ over C in a heartbeat.
-
I agree with lightatdown, that you should learn C++, not C.
And yes most applications require platform specific tools.
-
My thanks to the people who posted.
I appreciate your rapid responses and I'll be taking your advice, and re-taking up C++. It was more or less the news I wanted to hear.
Thank you once again,
Xark
-
I must say that quite obviously, C++ is the way to go.
As for platform dependence... which platforms are you planning on developing on? Although I'm practically sure you're going to be workin on a Windows based x86 system, C++ code is easily ported to linux as well, with the only conflict being, basically, Window APIs, which are pretty easy to get around by substitution.
-
The platforms that I was concerned with are, as you mentioned, Windows and Linux.
As to the 'obvious' choice, it is better to have asked the opinion of those who may have more knowledge than myself, than to go with the option that appeared to be more appropriate.
Thank you for strengthening my belief that C++ is the way to go.
-Xark
-
No problem. If I may suggest, I suggest you just download a free compiler rather than plop hundreds on a Commercial compiler that gets you the same results. If you run linux like me, g++ comes with most distros almost as a standard.
If you run windows, just download the windows port of gcc/g++, which is called DJPP I think.
-
Thanks...
That's my current debate... compiler.
I dual boot Windows/Linux, so I do have access to g++ and all the wonderful development tools available for linux. The only problem I have there is that I have yet to get my netgear card working under linux to run the roaring penguin pppoe package, so I don't have a network connection yet, cutting off alot of my access to resources.
As far as Windows is concerned, I have downloaded Dev-C++, Borland 5.5, and I'm thinking of looking into DJGPP as I remember it from my 'old' days of learning c++ and hearing it thrown around alot. Back then I was using an old version of Borland Turbo C++. I also have MSVC++ 6.0, but I've heard horrible things about it, mostly that it is strictly for a Windows based development environment.
Any advice that any one has here as far as compilers go... perhaps pros and cons, etc... would be extremely helpful.
Thanks again for the great response, and thanks in advance for any further insight.
-Xark
-
you was asking about resources and books, i may suggest books
from harald online books , its great stuff there. take a look
http://www.syndik.at/harald/regal/buecher/library.asp
-
C++ is very portable u can use it on every platform.
for example I use on mac..
c++ itself is the same on any platform what differs is the libraries(api) you had.
for exemple windows use win32.lib
mac use carbon.lib
and im sure linux got his too..
as for a book id say buy the c++ programming language.
it was written by the inventor of c++ (bjarne stroustrup) can't beat that!
Luigi