News for hackers. Stuff that matters.
Re:Show HN: Smart pointers for the C programming language by Snaipe on Wednesday January 14, 2015 @11:49AM (#8887367)
I guess it's more about writing less & better than using known functions -- in the same reasoning, I /could/ use new/delete in C++, but I always end up using unique_ptr<T>(...) because it's just better, and we usually don't really know/care about the implementation details.

Now I realize that the comparison I made isn't fair since unique_ptr<T> is standard C++ (and hence, polished), and mine isn't and will never be standard C, but abstraction here is not that much of a threat to understanding -- in the end, it's still syntactic sugar on top of smalloc/sfree.

As a last word, I'll say that this is mostly a toy project, and I probably won't have the occasion to fully use it. This is just a proof of concept to say that it is possible to have modern idioms in C.

Re:Show HN: Smart pointers for the C programming language by cpeterso on Wednesday January 14, 2015 @03:51PM (#8888937)
It would be nice if C++ added syntactic sugar sigils for unique_ptr<T> and shared_ptr<T> like Rust used to.