I learned a lot getting an Arduino and building stuff with it in C. With zero C and zero Arduino experience I wired together an e-ink display, SD card reader, and some buttons to build a basic e-reader. I would have never been bothered to build something in C in an environment where I can reach for any higher level language.
Ask HN: Learn C in 2023?
101–110 of 220 posts
Re: Ask HN: Learn C in 2023?
#102The K&R book is a great example of clear technical writing, but it's also quite terse. I'd recommend C Programming: A Modern Approach by K. N. King instead, as it uses a more gentle pedagogical approach.
That's not really a “but”; eschewing superfluous verbosity is a hallmark of good technical writing.
IMO, a more significant strike against K&R, which is excellent for its time, is that it is hopelessly dated—unless there is a third edition I am not aware of—providing, in the second edition, a preview of the first edition of ANSI C, which was standardized just after it was released.
Re: Ask HN: Learn C in 2023?
#103Earlier quoted context omitted.
C has the unique distinction of being criticized on the one hand for the complexities of vendor-specific extensions and portability concerns... and on the other for being insufficiently like Rust or Go, which are defined entirely by their proprietary implementations. I don't think I've ever seen this criticism leveled elsewhere. Do people criticize JavaScript programming because the ECMAScript standard doesn't give y…
There is no meaningful sense in which either Rust or Go’s reference compilers is “proprietary.” If you’re trying to say that there is no ISO standard for the two, that’s an entirely different problem (and one shared by the overwhelming majority of programming languages).
Nobody is talking about the compilers. This, right here — the fact that you are conflating a language and one implementation — is the whole point and is indicative of the tight control the respective organizations keep over their languages.
The direction of the languages is entirely up to their private owners, and that exclusivity is enforced via intellectual property law. They are exactly as proprietary as RHEL or Unix.
Re: Ask HN: Learn C in 2023?
#104I'm not a C engineer, but I think I have an interesting recommendation to consider. Since you are already familiar with other languages, you obviously don't need to know the basics of C. The basics are the same everywhere. Instead, you'd likely want to build that mindset on how to build good software with C. I suggest you read other people's code and try to deep dive into the whys. I heard Redis is a well-written sof…
That being said, how do you feel about using this technique for repos with 2k+ commits? It seems unrealistic to read all of them, or am I being short-sighted here? I get demotivated just thinking about it.
Re: Ask HN: Learn C in 2023?
#105If you are learning for practical reasons, like you have a project in mind, then it will be dependent on that project. C patterns and idioms vary a lot per project and time period. For a newer, more practical book I liked C Programming: A Modern Approach. Just don't go into it not expecting it to be too modern. The subject matter is still still C. After that you'll still probably have a lot to learn for whatever project you have in mind. C has a lot of quirks, peculiarities and shortcomings. There is no standard way of dealing with them so each project has their own best practices or set of helper APIs/tools with some minimal overlap.
Re: Ask HN: Learn C in 2023?
#106Earlier quoted context omitted.
There is no meaningful sense in which either Rust or Go’s reference compilers is “proprietary.” If you’re trying to say that there is no ISO standard for the two, that’s an entirely different problem (and one shared by the overwhelming majority of programming languages).
> There is no meaningful sense in which either Rust or Go’s reference compilers is “proprietary.” Nobody is talking about the compilers. This, right here — the fact that you are conflating a language and one implementation — is the whole point and is indicative of the tight control the respective organizations keep over their languages. The direction of the languages is entirely up to their private owners, and that e…
I don't even know what you're referring to with IP law. The projects' names and logos?
Re: Ask HN: Learn C in 2023?
#107https://www.learn-c.org/ If you have lots of time: https://hal.inria.fr/hal-02383654 If you can't be bothered reading a whole book: https://matt.sh/howto-c Exercises: https://www.codestepbystep.com/problem/list/c and https://exercism.org/tracks/c Once you have syntax and basic algorithms down well, watch this, the only 2 hour YouTube video I'll ever recommend: https://m.youtube.com/watch?v=443UNeGrFoM Both r/cprogram…
What is your opinion on K&R?
For modern, practical C programing it is missing a lot though. It is a short, simple, from the original authors introduction to the language itself. There is nothing about how to test your code, how to set it up for long term maintainability, how to mitigate some of the security downfalls or even any of the features added since C89.
It's a good technical book. A great one for it's time and subject matter. But that caveat is important, it needs to be taken in context of the time. It shouldn't be the first, and absolutely not the only, book you read if you are writing modern production C in 2023.
Re: Ask HN: Learn C in 2023?
#108Modern C by Jens Gustedt is quite good. This video gives a good overview of some modern patterns in C: https://www.youtube.com/watch?v=QpAhX-gsHMs I think the best thing you can do is go find a unit testing library you like the look of, maybe some tools for address/leak sanitization, and spend a good amount of time learning CMake and creating a build/project workflow you're happy with. Coming from Rust you've got gre…
If you like it you could buy the print version.
There are some things he writes that are a bit controversial but generally I think it is very thorough. Sometimes it felt a bit dry to read to me.
Re: Ask HN: Learn C in 2023?
#109I'm not a C engineer, but I think I have an interesting recommendation to consider. Since you are already familiar with other languages, you obviously don't need to know the basics of C. The basics are the same everywhere. Instead, you'd likely want to build that mindset on how to build good software with C. I suggest you read other people's code and try to deep dive into the whys. I heard Redis is a well-written sof…
But I love it and it is great recommendation.
Going to move with commits to see how it unfolds :)
Re: Ask HN: Learn C in 2023?
#110Does anyone have a good recommendation on developing operating systems?
This depends on how deep you want to go. I honestly recommend starting small. First, Code by Petzold to make sure you understand how a computer truly works. Then I recommend: Understanding Microprocessors (Motorola) 8086/8088 Assembly Language Programming Dissecting DOS Practical Filesystem Design FreeBSD Internals The reason there are so many books is because it’s a big topic. The reason most are old is that things…
>Understanding Microprocessors (Motorola)
>Dissecting DOS
Can you share or point me to where i can get the above from?