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

Constructors was a mistake. Stupid and simple initialisation like Rust and Go is the way to go forward.


Constructors induced exceptions, and once we have exceptions they became the failure reporting mechanism of the standard library, leaving us with goto-some-other-function-using-dynamic-scope as one of the foundation blocks of the language. Thus constructors are a reasonable contender for the worst design mistake in C++.




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

Search: