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

When using a C library, who's code is responsible for allocation objects? Who's is responsible for freeing said objects? That alone leads to a LOT of issues.

Not to be evangelical, but give Rust a look.



Seriously, all these language mechanisms like RAII make it a lot harder to write modular code. Look at the mess that C++ got itself in, with its constructors, default constructors, move constructors, rvalue references, exceptions (required as a consequence of constructors), and what not. It's hard to believe Rust could make it significantly less painful.

Programming is mostly not about initialization and deinitialization. If it is, you're doing it wrong, you have too many small objects.

Yes, stack allocated STL containers can be nice for quick "scripting". But I will happily write a few function local deinitialisations to enjoy much less convoluted and interdependent, slowly compiling code.


Rust makes it less painful by not having constructors, default constructors, move constructors, rvalue references, or exceptions.




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

Search: