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

When writing C code, which for me is rare these days, the language doesn't give me enough guardrails in the type system (e.g. unique_ptr) and at compile time that I'd prefer to write straightforward and dumb code. And that means code that does a lot of malloc()s with no surprises. If I have a char* that cannot be free()d, such as pointing to the middle of a longer string, I don't even let that escape the scope of a single function. Leave the memory management trickeries to more modern languages like C++, or, better yet, Rust.



I think parent was criticizing the multiple use of mallocs when one would be cleaner and easier. This wouldn't really make a difference to the library users, besides perhaps more heap fragmentation in the old version.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: