I have watched some developers giving advice about using C for general software development, i noticed that a not insignificant amount of them are strictly using C89, vaguely gesturing that more recent versions of C are less dependable, or more broken.

I would appreciate if anyone here can explain the specifics, as me not being a C developer (yet) and looking over the source code of some libraries which do heavily use modern C features, for example to have a defer-like macro (using attributes, or the 2 for statement trick), or generic data structures (using manual name mangling).

I understand these examples are strictly not how C is usually used, and are common in other more modern languages, which may turn some developers away from using these, my main question is “why exactly?”.

I don’t mind being given further reading about this, so if you have an article in mind, it too would be greatly appreciated.

note: in the title i referred to C23, but it could be anything post C89/C99 depending on the subject matter.

  • BlackRoseAmongThorns@slrpnk.netOP
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    I can see that, personally i dislike using C++, as it has so many different ways to solve the same problem, confining a project to use a specific subset of C++ is very difficult.

    Though mostly what i would like to be closer to other languages, is what is mostly standard across everything, like tuples, so i wouldn’t have to do:

    Err fallible(Arg argument, Out* output) { ... }
    

    But at least attributes allow me to warn if the error in this case is unused.

    Thing is, C can compile to anything, so i wonder if Zig/Rust can really be a drop in replacement in most use cases.