Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think C really needs an update to the standard library that includes these shorter types. Seems like a fine list though.

Some of my own style changes this year:

I try really hard to write functional code. Mainly try to keep functions pure, and write declarative code. I find that this makes the code easier to write(not necessarily read), and I'm less scared of bugs.

I also avoid malloc unless I absolutely need it. You can usually preallocate space on the stack or use a fixed length buffer, which pretty much avoids all fears of memory leaks or use after free type bugs. You will sometimes waste memory by allocating more than you need, but it's a lot more predictable.



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

Search: