Earlier quoted context omitted.
C99 object literals are also fantastic. I feel very constrained when I have to use strict C89. Meanwhile, in terms of C11 [update: actually also from C99] I actually wrote a function with a signature like void func(int arg[static 3]); but later removed it because (a) the generated code was the same, and (b) rather than increasing clarity and self-documentation, it caused confusion; even when you're familiar with the…
I do love object literals. The 'static' keyword for array parameters actually dates to the C99 standard.
Essential C
21–30 of 57 posts
Re: Essential C
#22Oh, memories. I took CS107 in 1996, which was apparently the date this handout was written. Nick was my academic advisor, and his CS108 (which was C++ at the time) was one of my favorite courses of all time. Bunny World... Maybe I'm just a grumpy old programmer, but I feel like kids these days are missing out on something important by learning to program in a language that doesn't require them to truly grok memory ma…
Re: Essential C
#23I recently started a graduate course that originally required C++. My only exposure to C++ basically went through the fundamentals of the C part without getting to any of the ++. Is there something similar to this for C++? I understand that C++ is a much larger language and I'm definitely not looking for something comprehensive, more of a solid overview of a workable subset of the language. Enough to be productive, p…
"Thinking in C++" by Bruce Eckel "Effective C++" by Scott Myers
Re: Essential C
#24Oh, memories. I took CS107 in 1996, which was apparently the date this handout was written. Nick was my academic advisor, and his CS108 (which was C++ at the time) was one of my favorite courses of all time. Bunny World... Maybe I'm just a grumpy old programmer, but I feel like kids these days are missing out on something important by learning to program in a language that doesn't require them to truly grok memory ma…
Re: Essential C
#25Re: Essential C
#26Oh, memories. I took CS107 in 1996, which was apparently the date this handout was written. Nick was my academic advisor, and his CS108 (which was C++ at the time) was one of my favorite courses of all time. Bunny World... Maybe I'm just a grumpy old programmer, but I feel like kids these days are missing out on something important by learning to program in a language that doesn't require them to truly grok memory ma…
Re: Essential C
#27Earlier quoted context omitted.
I don't know if I would count any part of C11 as "essential", particularly given its still-spotty implementation coverage.
A lot of code is still written in C89 for maximum portability, and I regularly do that. The only thing I really miss from C99 is the mixed declarations and code, but you can instead use nested scopes or just move the declarations up to the top.
Re: Essential C
#28Essential C doesn't mention a standard but it says Copyright 1996-2003 . I'm going guess it hasn't been updated for C11. Modern C [1] covers C11 and was mentioned before. However, it weighs in at 300 pages rather than Essential C 's 45. [1] http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf Actually, reading through Essential C , it hasn't really been updated for C99 since it uses C89 declarations: C takes th…
I don't know if I would count any part of C11 as "essential", particularly given its still-spotty implementation coverage.
For essential features, well if one uses C it's usually to have fine-graded control of memory use and allocation patterns. Then C11 _Alignas, and _Alignof are pretty essential. Yes you can do that with platform/compiler specific macros without C11, but it's nice to be able to avoid that.
Re: Essential C
#29Any additional recommendations for C tutorials?
Also C unit testing is often rare. I ended up writing my own framework (which I open sourced, but am neglectful with maintenace) with the idea you can run tests on embedded devices. Meaning it only relies on pretty vanilla C and has no memory allocation.
But, definitely incorporate unit testing in your C coding experience. It will help focus you on not falling for the evils of the language
Re: Essential C
#30I recently started a graduate course that originally required C++. My only exposure to C++ basically went through the fundamentals of the C part without getting to any of the ++. Is there something similar to this for C++? I understand that C++ is a much larger language and I'm definitely not looking for something comprehensive, more of a solid overview of a workable subset of the language. Enough to be productive, p…
https://www.amazon.com/Advanced-C-Programming-Styles-Idioms/...