August 18th, 2013, 08:56 PM
C well with system programming?
I'm starting high school this year and it'll be a wreck. But on my free time I want to learn more concepts about programming. I'm very familiar with C. Is using C for system programming a good idea or is it better to use assembly? I'd like to learn system programming with C but I don't know where to go with it (if it's a good idea). Only books and sites I saw on it dealt with Unix programming.
August 18th, 2013, 09:33 PM
C and UNIX kind of grew up together. Before then (circa 1970), operating systems were usually written in assembly, which meant that every time you needed an operating system to run on a new computer, you needed to rewrite the entire operating system all over again. It was too much work to take an existing operating system and port it over to a completely different hardware platform. As a result, most computer models had their own unique operating system.
What they did with UNIX was to write it in C. Well, most of it was written in C with some parts like device drivers still needing to be written in assembly. As a result, UNIX spread quickly. If you had a new hardware platform, porting UNIX to it was almost as easy as simply recompiling the kernel and rewriting the device drivers and other very low-level very hardware-dependent parts of the OS.
C has been used to write many operating systems, including Windows. And it is a very good tool for doing system programming.
Since you already know C, I would suggest that you also learn C++. C++ is a super-set of C, which means that by knowing C you already know most of C++.
August 18th, 2013, 10:22 PM
Actually, if you're going to learn C++, it is better to forget that you know C at all (at least in the initial stages). While C++ is designed to be largely backward compatible with C, there are also C++ ways of doing things which avoid several of the pitfalls of the C equivalents.
Originally Posted by dwise1_aol
For instance, he deals with vectors very early, instead of using arrays, and strings and streams instead of char arrays and fgets().
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
August 19th, 2013, 09:30 PM
C++ doesn't really deal with much of system programming as more of game programming. If I wanted to work with system programming using C where's a good source for a windows user? (I know my hardware stuff)
August 19th, 2013, 09:44 PM