• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C in today's world? Is it useful to know?

Well, I am kind of curious about C, because I like the idea of an extrmely fast language, native to Linux (I like Linux), and really low level, with lots of power. But, is C worth doing over C++ in today's world? Is the Linux programmer useful at all? Or should I go with C++? Or a higher level language. Also, what language do people write drivers in? I would LOVE LOVE LOVE to work for ATI or nVidia writing drivers. But, a head start is always good before I get to college, and I would like to get that head start now.

So, to recap.

A.) is C usful now?
B.) What are drivers written in?
 
C++ works just as well as C in Linux. But that doesn't make C any less usefull.

Almost all drivers you find will be C with some inline asm if necessary.
 
But is C useful today? Because I am picking up C pretty easily, with my limited C++ background. I can just move along with learning C if you people think it's a good idea.
 
C is a subset of C++. Therefore if you learn C++ thoroughly you should know most of C.

Not that that's incorrect, but more correct is C++ is the successor to C. That's why it was named C++, it was a geek pun.

And I would suggest learning C first, it's a simpler language and unlearning all the OO stuff to get a handle on C would probably be harder than learning the C++ OO stuff after you know C.

Either way both will work and are extremely usefull. probably over 80% of all apps written for any OS are done in C, not counting small scripts or inhouse VB programs.
 
Nothinman,

C is a subset of C++. That was a design goal; Stroustrup originally called the language "C with classes".

I somewhat disagree with you though. It's somewhat well-known that C hackers can have a difficult time jumping to C++ because they don't think and design using OOP.

So if the goal is to learn C++, I'd say learning C first is not advisable. I wouldn't say you need to unlearn OOP if you later use C. Even with OOP, there's a fair amount of functional decomposition going on; it's just that the essential design is decomposed into objects.

But if you're accustomed to a procedural programming style, it can be difficult to make the mental leap to OOP.
 
C is a subset of C++. That was a design goal; Stroustrup originally called the language "C with classes".

The reason I said what I did was because C was first, C++ was it's successor; I didn't disagree with him, just the wording which made C++ seem like it was better simply because it was newer. OK so I'm strange, but you have to decide whether you need the features of C++ in your program, not everything benefits from classes, templates, etc.

I somewhat disagree with you though. It's somewhat well-known that C hackers can have a difficult time jumping to C++ because they don't think and design using OOP.

Well since I'm not a professional developer, learned some of both in school and only really know enough to hack other people's code and write small programs myself, I won't argue =) But, work free time permitting, I'm trying to change that =)
 
C is used with many embedded systems.

The vehicle that you drive has an Engine control module which is running realtime (not Unix) and has an excellent chance of being written in C.

Most smart appliances have C inside the micro-processors.
 
I think the correct phrase should be: C++ is a superset of C.

As for learning C, I think it depends on what you want to do. If your planning to do real low level stuff it is a must know, if not
just go with C++ you will not be loosing anything special...

I think that Bruce Eckell has a point when in his book "Thinking in C++" it teachs the "C in C++" and that's it no more C in the book.

And Nothinman is correct when he says that that drivers are written in C or assembler...well in fact only the real
lowest level stuff in drivers will be in assembler that is usually embedded in C.

The point is that with C you get speed and with C++ you get ease of use. In the "Practice of programming" you can
find good examples of this. They have a program that is written in several languages (C,C++,Java and Perl) and the
C version is the fastest but also it's the one with more of code to acomplish the task!
 
It's a common myth that C++ is slower than C. Originally, C++ compilers were inferior but that was many years ago.

Modern C++ is a high-level language, and you simply pay for whatever language/library features you use.
 


<< C is used with many embedded systems.

The vehicle that you drive has an Engine control module which is running realtime (not Unix) and has an excellent chance of being written in C.

.
>>



one of my comp sci professors writes code for Ford for that very thing. using C of course.
 
It's a common myth that C++ is slower than C. Originally, C++ compilers were inferior but that was many years ago

But it is true that C++ has slightly larger memory overhead for things like classes. That's one of the reasons low level things like the Linux kernel are written in C instead of C++. Having a linked list of structs for each memory page uses less memory than a class for each page.

For normal applications this doesn't mean anything, a few bytes here and there are nothing, more is probably lost to alignment.

The general point is that if you're just doing regular userland apps either one will work fine, both compile into small, fast executables and more depend in the libraries you use than the language itself. And C++ may make things easier if you have larger applications because classes and such make reusing code/objects easier.
 
Let me get this straight: you currently don't know C++ or C, right?

While it's true that you don't need to know C to learn C++, it certainly helps to understand "what's really going on" behind the scenes.

IMHO, everyone should learn procedural programming first. Whether it's with Pascal or C or Basic. Because unless the concepts of procedural programming are understood first, OO will only confuse things further.

Basically, you won't regret learning C if you're planning on learning C++ anyway. There is enough code out there written in C to make it a programming staple for years to come. And its speed is unmatched. The standard library be damned!
 


<< Let me get this straight: you currently don't know C++ or C, right?

While it's true that you don't need to know C to learn C++, it certainly helps to understand "what's really going on" behind the scenes.

IMHO, everyone should learn procedural programming first. Whether it's with Pascal or C or Basic. Because unless the concepts of procedural programming are understood first, OO will only confuse things further.

Basically, you won't regret learning C if you're planning on learning C++ anyway. There is enough code out there written in C to make it a programming staple for years to come. And its speed is unmatched. The standard library be damned!
>>



Yea I would agree I started learning C first then moved on to an OO langauge like Java. The stuff I learnt in C helped me a lot when I came to learn a new language
 
Back
Top