3 ms·
C gives you too many guns to shoot yourself in the foot. Beginners deserve a language with a helpful compiler, slightly more hand-holding, as well as more struc
by kccqzy 3y ago
C gives you too many guns to shoot yourself in the foot. Beginners deserve a language with a helpful compiler, slightly more hand-holding, as well as more structure and convention to encourage a maintainable coding style.
You can read about how experts write their C code (like https://nullprogram.com/blog/2023/10/08/ https://nullprogram.com/blog/2023/10/08/) but you aren't going to appreciate why they decide to do this. Indeed, beginners need to be able to blindly follow rules before they can critique them or invent their own coding styles.
- scns 3y agostructure returns instead of out parameters typedef struct { i32 value; b32 ok; } i32parsed; Defined a Result Type.
- thewakalix 3y agoThat is not a result type. Result types are sum types.