I want to learn C

I was shocked when I found out that drivers (and embeded stuff) is still written in C. I was really expecting C++. But it makes some sense because formal verifications isn't so developed for object oriented languages as for the structured languages. And that peace of code could be responsible for some ones life if it's software for some kind of controller in medical equipment.
 
I was shocked when I found out that drivers (and embeded stuff) is still written in C. I was really expecting C++. But it makes some sense because formal verifications isn't so developed for object oriented languages as for the structured languages. And that peace of code could be responsible for some ones life if it's software for some kind of controller in medical equipment.

Yes and no. I'm pretty sure there's another part to that answer, because a lot of critical stuff is still written in higher level languages, with classes and more complex interactions.

Also, fuck assembly.
 

On the book... no. Just... no. If you're asking why, and you learned from that book... there's your answer. K&R C is the way to go, period.

C isn't an easy first language (Python might be the way to go for that) but if you need to have that kind of precision and rigor beaten into you (as a physicist, this is likely the case) then it's a good thing to learn even if you won't be using it daily.

Atheist, you might want to check out Linus Torvalds' comments on why the Linux kernel doesn't have C++ code.

Guru... what made you say 'similar to BASIC'? I'm not sure I've seen that yet...

Jeff
 
On the book... no. Just... no. If you're asking why, and you learned from that book... there's your answer. K&R C is the way to go, period.

C isn't an easy first language (Python might be the way to go for that) but if you need to have that kind of precision and rigor beaten into you (as a physicist, this is likely the case) then it's a good thing to learn even if you won't be using it daily.

Atheist, you might want to check out Linus Torvalds' comments on why the Linux kernel doesn't have C++ code.

Guru... what made you say 'similar to BASIC'? I'm not sure I've seen that yet...

Jeff

Agreed 100%
 
Thanks for all the responses guys.

How important would you say being up to date is? I read reviews of books on the subject and they say how styles have changed significantly over time etc...
how much does this matter?
 
One of the essential steps will be looking at code written by more advanced programmers ("learn from the masters, not their students" and all that sort of thing) and getting up-to-date happens naturally that way.

Nothing you'll learn in K&R C will be wrong. Pick that up and then move on to whatever you want to figure out - free software is great for this, of course - and, while you may not understand the code perfectly right away, you'll know what you need to learn in order to understand the code. There's a disadvantage to trying to learn from books that strive to be up-to-date and cover all of the latest shiny toys - you'll gain nothing that you couldn't have picked up on your own from K&R C, and you run the risks of extraneous rubbish *and* missing important parts with some of the trendier-looking ones.

(Also... do the exercises!)

Jeff
 
@JBroll:

Just read it. Torvalds really hates C++? Yeah, it's broken here and there, but just don't use exceptions if you don't like them. Memory allocation are a bit more serious though.

And many people don't realize that you can write OO code in C - it was just a design pattern once.
 
@JBroll:

Just read it. Torvalds really hates C++? Yeah, it's broken here and there, but just don't use exceptions if you don't like them. Memory allocation are a bit more serious though.

And many people don't realize that you can write OO code in C - it was just a design pattern once.

Many people don't realise you can write OO code in assembly. It's just a pain in the ass though :loco:
 
@JBroll:

Just read it. Torvalds really hates C++? Yeah, it's broken here and there, but just don't use exceptions if you don't like them. Memory allocation are a bit more serious though.

And many people don't realize that you can write OO code in C - it was just a design pattern once.

I think it's more a matter of frustration with unnecessary C++ things being used by people who should know better... like anyone wanting to write C++ for the kernel, where C is still just fine. It's not as abominable as that C# monstrosity, I'll give that, but... still, why?

Jeff
 
do you think that is so bad?
c# is not that bad...

C# is fucking nasty.

In addition, I fail to see the significance of tying your programming career to a proprietary, closed language only for a single platform which is not necessarily the most utilised in the scientific field.
 
you people crack me up, you say c#sucks and maybe you don't even develop on it on a daily basis.
Not arguing that c++ is the best language out there, it is indeed, but you can't say c# sucks totally.
Talented c++ programmers will tell ya that c++ is a waste of time in certain situations, while c# comes handy.
You still need the framework to make it work, you won't think about malloc or other stuff though (GC is your friend) and last but not least is easy, and intellisense on VS is fully supported.
For some things c# is a rock, for others like games is uhm.... sucks yes
 
you people crack me up, you say c#sucks and maybe you don't even develop on it on a daily basis.

That's because I am currently working on a driver/software backend for an ECG heart monitor that requires compat with Linux and Solaris...

Where is your C# god now? :lol:

My point is that C# is tied to Windows and any project (Even in an area that C# excels above any other language/framework... though I can't think of any) that requires Linux,Solaris,BSD,OSX support is thus difficult/impossible and so a choice of an open language is a clearly sane choice.

That and C# (for me) and Visual Studio are horrible to work in.

That is my reasoning... I'm not saying it should be taken as gospel, but I have my own (valid) reasons to dislike C# and as such, feel that claiming Jeff and I shouldn't rag on C# is a bit narrow minded.
 
I guess me and millions of programmers are narrow minded to say that everything has its own place?
Not saying is uber fast or you can use it on OSX/LINUX/whatever, I just said that if you're on Windows and want something done fast, that's the best choice for something like websites/CRM and so on instead of using c++ and waste hours on it.
Still you can't develop something on c++ and believe that will compile just fine on everything, you gotta tweak it anyway(maybe as much as c#) and pay attention to a lot of things.
 
Kaomao, are you really that enthusiastic about giving up any kind of portability, consistency, and reliability for something that adds nothing to C that can't be obtained in some other (less Microsoft-tainted) way? Besides that, you're the first person I've ever heard claim that it's the best choice for anything, let alone websites...

Jeff
 
Kaomao, are you really that enthusiastic about giving up any kind of portability, consistency, and reliability for something that adds nothing to C that can't be obtained in some other (less Microsoft-tainted) way? Besides that, you're the first person I've ever heard claim that it's the best choice for anything, let alone websites...

Jeff

the fist person caliming it's the best choice....
I guess you didn't even read carefully what I said......
I said "everything has its own place"... for crm and websites c# is great period.
I never said is the only solution, you people don't really read what others say.
You said basically it "sucks" period (in a way or another) without even mentioning why it really sucks besides portability (still c++ programs have to be tweaked to run on OSX or linux from a windows environment).
c# has its place into world of programming language, if not why so many people use it? have you ever looked for a job? did you notice that the most ask for that goddamn c#? guess why?
As I said talented c++ developers moved to c# because we all know most pc's are windows based systems, developing in c# is easier faster get same results and won't get you mad.
Yes porting to linux/OSX a PITA, but with mono maybe in the future we won't struggle that much who knows.
And last but not least c# has become an international standard by ECMA and ISO like c++