Live data from Hacker News

To become a good C programmer (2011)

fabiensanglard.net

1–10 of 16 posts

Re: To become a good C programmer (2011)

#2
As much as C is fantastic to work with, as the general idea of a low/high level language whose compilers are easy to implement, its pain points are annoying.

Integer conversions, literals, unhygienic macros, inconsistent library, overflows, zero-ended strings are all very very fastidious to work with.

I really hope that Zig will grow up because it seems the best promising alternative to C right now. In 20 years or so it might even get a significant market share... Then it will be the turn of POSIX and by 2100 low level system programming will be fixed

Re: To become a good C programmer (2011)

#3

As much as C is fantastic to work with, as the general idea of a low/high level language whose compilers are easy to implement, its pain points are annoying. Integer conversions, literals, unhygienic macros, inconsistent library, overflows, zero-ended strings are all very very fastidious to work with. I really hope that Zig will grow up because it seems the best promising alternative to C right now. In 20 years or so…

I don't want to be that guy, but have you tried Rust? If so, what makes it not the C replacement for you?

Re: To become a good C programmer (2011)

#4

As much as C is fantastic to work with, as the general idea of a low/high level language whose compilers are easy to implement, its pain points are annoying. Integer conversions, literals, unhygienic macros, inconsistent library, overflows, zero-ended strings are all very very fastidious to work with. I really hope that Zig will grow up because it seems the best promising alternative to C right now. In 20 years or so…

I don't want to be that guy, but have you tried Rust? If so, what makes it not the C replacement for you?

Rust is far more complicated in every aspect.

Re: To become a good C programmer (2011)

#7

As much as C is fantastic to work with, as the general idea of a low/high level language whose compilers are easy to implement, its pain points are annoying. Integer conversions, literals, unhygienic macros, inconsistent library, overflows, zero-ended strings are all very very fastidious to work with. I really hope that Zig will grow up because it seems the best promising alternative to C right now. In 20 years or so…

Nim is fantastic, too.

Re: To become a good C programmer (2011)

#8

K&R is full of gems, cannot recommend that enough for C. Great not only as reference but initial learning. It’s also so humbling that something 40+ years old (published ‘78) is still used so frequently today.

K&R is a masterpiece, but I would recommend the 2nd edition from 1988 so that the language as taught is a little more modern (essentially C89)

Re: To become a good C programmer (2011)

#9
post #4

Earlier quoted context omitted.

I don't want to be that guy, but have you tried Rust? If so, what makes it not the C replacement for you?

Rust is far more complicated in every aspect.

Not knowing Rust but looking into its usefulness to me, could you share some of the issues you see?

It’s always good to hear others experience.

Re: To become a good C programmer (2011)

#10
I also used to religiously target C89 for "maximum compatibility" (`-ansi -pedantic`). But the problem with this approach is that it's 2021, and C89 doesn't have a concurrency model.

FFS, use C11 or newer. Even if you're writing for consoles and weird microcontrollers, the compilers have mostly caught up.

Post reply on HN