C vs. C++

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
GyroVorbis
Elysian Shadows Developer
Elysian Shadows Developer
Posts: 1874
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon Mar 22, 2004 4:55 pm
Location: #%^&*!!!11one Super Sonic
Has thanked: 80 times
Been thanked: 64 times
Contact:

C vs. C++

Post by GyroVorbis »

Seriously, I have scrounged up barely enough pennies to afford one programming book. I want this book to aid me in my DC development, nah, more guide me. Without this book I'm nothing. I'm wondering, C or C++ book. I've heard good things about C, but is C a very useful language for other things besides the DC? I want this language to stick with me for the rest of my life. Could C land me a job?

I could buy a C book then move to C++, but is that transition very smooth, and what do you gain by learning C first?
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

The C++ book will undoubtedly deal heavily with the STL (Standard Template Library). This does not work on the Dreamcat at all.
User avatar
GyroVorbis
Elysian Shadows Developer
Elysian Shadows Developer
Posts: 1874
Joined: Mon Mar 22, 2004 4:55 pm
Location: #%^&*!!!11one Super Sonic
Has thanked: 80 times
Been thanked: 64 times
Contact:

Post by GyroVorbis »

C IT IS!
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7499
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 10 times
Contact:

Post by Quzar »

i would look into online tutorials first, learn the basics then judge the book based on what you see online and what you CANT learn online. you want the book that will give you the most that you cant get elsewhere
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
ragnarok2040
DC Developer
DC Developer
Posts: 462
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ragnarok2040 »

I suggest O'Reilly's Practical C Programming, 3rd. Edition, if you're gonna buy a book. It helped me.
humandislocation
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Tue Sep 30, 2003 7:40 am
Has thanked: 0
Been thanked: 0

Post by humandislocation »

I think you should start with whichever one you decide is best, but I think the most important thing to learn is that there is no best language. A lot of people learn C, or C++ and then think that the C or C++ way of doing things is the only way to go, and that the other is wrong. They'll then refuse to learn other languages, because they think they're "too inefficient", or "too low level".

I think whatever language you learn, it's important to stay open minded about different languages, and learn a good range of languages.
GPF
DC Developer
DC Developer
Posts: 529
Joined: Wed Oct 17, 2001 7:44 pm
Location: Texas
Has thanked: 0
Been thanked: 0
Contact:

Post by GPF »

For learning programming I would recommend to learn the easiest language possible. The goal is to learn programming not a language. Once you know how to program it just a matter of finding out how you do it in a particular language.

All languages are pretty similiar for high level. loop, logic, etc. its just a matter of learning different coding styles, and frameworks, top down design, object oriented etc.

The language is just the tool, used to solve a problem or to engineer something new.

Troy
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7499
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 10 times
Contact:

Post by Quzar »

That is a good point, maybe something in the BASIC family or better yet JAVA would be a better precursor to C/C++. Java is syntactically very similar to C and C++ but is more protective and user friendly.
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
speud
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 1459
Joined: Sat Dec 27, 2003 10:40 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by speud »

i wouldnt say basic is a simple language.
it may be good to do simple things but its structure is very "old fashionned" and you need to use goto and subs a lot while in other languages you dont.
java may be a good idea, javascript is one of the simplest to me.

but i think supersonic actually knows programming already, judging from his site he knows perl.

so if you only want to know which one to choose between C and C++ i would recommend C.
http://blueswirl.fr.st - DC Online Tools and Downloads

thx to Wack0 for the avatar ;)
ragnarok2040
DC Developer
DC Developer
Posts: 462
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ragnarok2040 »

I was taught with pascal, so I'll suggest that as a beginner language, but that book I pointed out teaches C just like I was taught pascal, and it is a textbook, complete with all the beginner exercises and etc., so it teaches you how to program, how to analyze problems and develop a solution, the whole 10 yards.
Kamjin
DC Developer
DC Developer
Posts: 216
Joined: Wed Dec 17, 2003 5:27 am
Has thanked: 0
Been thanked: 0

Post by Kamjin »

Guess I'll toss my penny..

Since I started on pdp.. 8080/Z80, and 6800/6502 assembly..
Cobol.. rpg..err fortran... err... grey hairs are showing... (kill me!)

If you've never programmed before.. here's the catch..

If you plan to bang harware, write assembly. make api's/kernals/drivers.
Then start with Basic.. the using goto's, and gosubs,
developing a linear execution mentality, where you have to "imagine"
structures, learn ways of jumping into/out of middle of functions..

The downside to this.. you'll find C++ very confusing the first
time you see a com object.. you'll cry..
The plus side (in several years)... you won't need KOS or any api to actually
program.. you can make your own faster than it takes you to understand
the api..

If you plan on coding games for DirectX, GL, or other api's
then the idea of classes will become essential, and will be
much easier to understand when you brain starts to see coding
as a non-linear lego set, rather than a mindless number munching
beast.. Start with Pascal, or C.. in essence pascal is easier to
start with, but you're probably better off starting in C, and not knowing
what you're missing from a higher level language.
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has thanked: 0
Been thanked: 0

Post by Ex-Cyber »

I've heard good things about C, but is C a very useful language for other things besides the DC? I want this language to stick with me for the rest of my life. Could C land me a job?
Which language you learn isn't really the important part. If you understand the underlying concepts, you should be able to learn new languages pretty quickly (even INTERCAL). That being said, C is probably the single most enduring language that has ever existed in the computer industry. There is still nothing that can even pretend to replace it for portable systems and embedded programming. C is supported in one form or another on virtually any platform that can possibly handle the basic datatypes - everything from Game Boy to high-end supercomputers. It's the native language of Unix and its derivatives, which run the Internet. You can't really go wrong learning it if you want to be a programmer.
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

Aside from the fact C runs on anything, most modern languages use largely the same syntax (C++ is mostly a superset of C, Java and C# both use the same basic syntax as C), and a lot of other languages use the same principles.
Post Reply