Going from C++ to C
Master Of Puppets
Member Posts: 1,210
in Off-Topic
Hi guys,
I want to learn C but I have no experience whatsoever in it. As one of my professors says - I'm some kind of a badass when it comes to C++ So that probably helps. At the university we started straight from C++ and I was never really interested in C. So my question is, has anyone made that transition? Any tips or things to look out for? I think it's going to be uncomfortable going from C++ to C but maybe it's not that bad. I think the best scenario is doing the opposite but too late for that now. Also, I would really appreciate if someone could recommend a good book that is suitable for the situation. Something not for a total beginner as I don't need to learn programming from the ground up.
I want to learn C but I have no experience whatsoever in it. As one of my professors says - I'm some kind of a badass when it comes to C++ So that probably helps. At the university we started straight from C++ and I was never really interested in C. So my question is, has anyone made that transition? Any tips or things to look out for? I think it's going to be uncomfortable going from C++ to C but maybe it's not that bad. I think the best scenario is doing the opposite but too late for that now. Also, I would really appreciate if someone could recommend a good book that is suitable for the situation. Something not for a total beginner as I don't need to learn programming from the ground up.
Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.
Comments
-
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□C is still an extremely common and important language for embedded applications. Just remember, you don't have to write C code like an old-time C developer. The best code tends to follow the principles of C++ (such as OOP) while using the tool of the C language. I like "The C Programming Language" by K&R, assuming you already know C++ and basic programming concepts.
-
ptilsen Member Posts: 2,835 ■■■■■■■■■■I plan on learning both. I haven't touched either in years, but I had done a little bit of each in the past without any major issues.
The real key is knowing imperative programming concepts and how to use them in the absence of object-oriented features. I operate in higher-level languages today that follow the same respective paradigms, and it's really not too bad. If all you've done is object-oriented, you will have a bit of a learning curve, but really, it's not so bad. I started with imperative/procedural and multi-paradigm languages and if anything, found them much easier to pick up than pure OOP, but I'm thinking there's a bit of unlearning to do when switching in either direction.
As far as learning it, I'm not convinced there's any reason to go to anything but the original source, The C Programming Language, written by the language's creator. I did some fairly extensive searching on Amazon, and based on reviews and popularity, this is probably still the best book for the non-novice programmer, 25 years after being written. Edit: Looks like NetworkVeteran is on the same page on this one. -
Master Of Puppets Member Posts: 1,210Thanks guys. Looks like it really won't be an issue. I have done a lot of OOP which turns out to have never-ending benefits.Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.
-
sratakhin Member Posts: 818C is just C++ without objects and classes. Simplified explanation but whatever
Actually, C++ builds on C, so you know it already. -
Slowhand Mod Posts: 5,161 ModYou could always give yourself a refresher on what you already know about C, and probably a whole lot you don't: Learn Code The Hard Way -- Books And Courses To Learn To Code
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do. -
paul78 Member Posts: 3,016 ■■■■■■■■■■+1 for the K&R book. I cherish my first edition fondly.
Thbbft! In my day, we didn't have fancy namespaces, objects, or classes. None of that silly templates, polymorphism and inheritance either. And I had to walk to work uphill both ways in the snow. -
ptilsen Member Posts: 2,835 ■■■■■■■■■■+1 for the K&R book. I cherish my first edition fondly.
Thbbft! In my day, we didn't have fancy namespaces, objects, or classes. None of that silly templates, polymorphism and inheritance either. And I had to walk to work uphill both ways in the snow.
Edit: By the way, showing your age. :P The second edition was published the year I was born. -
paul78 Member Posts: 3,016 ■■■■■■■■■■yeah - I'm old and bitter I learned C++ using Cfront. Those days of debugging C++ code translated into C left me forever traumatized.
-
TheShadow Member Posts: 1,057 ■■■■■■□□□□yeah - I'm old and bitter I learned C++ using Cfront. Those days of debugging C++ code translated into C left me forever traumatized.
Yeah what he said. I also own a dog eared first edition and a nice second edition. After learning Simula, Cfront wasn't so bad.Who knows what evil lurks in the heart of technology?... The Shadow DO