Hacker News new | past | comments | ask | show | jobs | submit login

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/) 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.




structure returns instead of out parameters

typedef struct { i32 value; b32 ok; } i32parsed;

Defined a Result Type.


That is not a result type. Result types are sum types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: