View Full Version : Usefulness of C?

05-12-2006, 12:28 PM
Well I started out with the intention of learning C++ with zero programming experience, besides Basic, which doesn't really count.

But I had trouble finding a book that gave me an acceptable background, so I thought I would start with C instead. The book I am using is "Beginning C" by Ivor Horton. Except for the typos (which is OK with me, because if I can identify the typos in code, then that means I understand the material, right?) I think the pace of the book is good for beginners like me.

My question is, is learning C even useful anymore, or am I wasting my time that would be better spent on a C++ book for beginners?

My goal here was to start with C++ and then eventually move on to windows (java, VB, etc). Its cool stuff and I wish I would have started learning this a long time ago, but am I wasting my time with C?

05-12-2006, 12:49 PM
This question probably ranks up there with "What is the meaning of life?" as the questions most asked to death. C'mon, you type a summary of your question into the Google textbox, click "Search" and receive as many opinions as you like. :rolleyes:

As for mine, I started with C, and I like it. As a result, I view C++ as somewhat of a bastardization of C to meet what must've been a vague specification (It probably had "MUST BE OBJECT-ORIENTED!!111!!" written across it in big letters), but it does the job, the job being teh encapsulation of a large process into smaller building blocks that talk to each other. You can write C and compile it as C++ (attaching typecasts as necessary) and it will work fine. You can essentially do what C++ classes do in C, the only problem being that your code is likely to become somewhat unruly and difficult to understand.

On the plus side, C is more easily used in embedded programming (getting your own little CPU and welding it to your PCB with some memory chips and having fun), C++ isn't because its runtime memory footprint is larger (if you include exception handling).

Some people who get waaaay down into C find it hard to write in such a way as to make C++ useful to them, a bit like how hard it is to quit smoking. Try to avoid that if you can. ;)

05-12-2006, 12:57 PM
There was a thread earlier that turned into a discussion like this one. You will find that programmer's opinions on C can very. I use it because it's easier for me to understand, which sounds weird to lots of people. Other programmers will point out that C is most useful in embedded environments where resources like memory are sparse, and that for the most part C programmers will spend time coding things so they can get C++ functionality out of a C program.

Is it a crime for you to learn C first? Nope. Go ahead, it will help you understand certain things about C++ better, in my opinion, by giving you a more terse language to understand. C++ is powerful, excellent, but it does confuse certain things for new programmers, like pointers and runtime memory. Most talented people are able to just learn C++ from the beginning and get better at it every day.

Also, some programming books are better than others. Read reviews carefully and make a choice. A bad book willmake a bad programmer.

05-12-2006, 01:04 PM
>My question is, is learning C even useful anymore
The people who pay me to use C think it's useful. Who am I to argue? :D

05-12-2006, 02:30 PM
Well, what's the point of learning any programming language at all? To get you a job? Then learn the languages required for that specific job.

C and C++, even though you're not gonna be using them, give you lots of added value because those pretty much most popular languages out there are based off C/C++. A game programmer may just use available game engine, but it's better if he knows how to make one. A C#/Java programmer may program only in C#/Java, but knowing C/C++ as well, will give you better understanding how your program works, which could be useful somewhat.

05-12-2006, 03:20 PM
Personally, I would say learn C++, but like others have said, C is useful too. Just don't look at C as a stepping stone to get to C++.

05-12-2006, 03:46 PM
your OS is likely written in C. do you find that useful?

05-12-2006, 05:12 PM
your OS is likely written in C. do you find that useful?

Well, only for certain things. Not so good for driving 3 1/4" nails..... ;)

05-12-2006, 05:55 PM
Well, only for certain things. Not so good for driving 3 1/4" nails..... ;)Couldn't resist:
If the only tool you have is a hammer, then everything looks like a nail.

05-12-2006, 06:06 PM

05-12-2006, 08:28 PM
If the only tool you have is a hammer, then all your problems are solved.

05-14-2006, 11:50 AM
of all the languages i've played with C is overall the best... its simple complete and concise and powerful... makes things plain an easy... its only as difficult as you make it.

05-14-2006, 02:07 PM
I think it is great, and usefull.

05-14-2006, 04:38 PM
I think it's good to know both languges. I use them interchangabley; for example when I'm learning new code, I use C to keep everything as simple as possible.

Then when I want to write a serious program, I use C++ to keep my code more structured and organized, and to make the code shorter.

05-14-2006, 04:46 PM
i learned C while learning C++. c and c++ are so closely related youll pretty much learn one while learning the other, actualy almost all programming languages are very much the same once you learn one you can pretty much do them all. of course theres limitation differences and syntax differences but al the logic is the same and theres an equavalent function for almost everything across languages.

my approach in your position is to not worry about C but if the time comes that you need it it woudlnt hurt. but thats just how i work because i only get into new languages if im trying to write something that requires use of the language.