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

We used init functions at my last job and got to enjoy a lot of the other benefits of C++. Lambdas, templates, std::variant, the STL, the list goes on.

Not wanting to use feature X of C++ doesn’t make it a shittier C.




I agree with you, GP is wrong about the "generally". We did use the isValid variant (and the odd factory once in a blue moon) at $former_job, no exceptions but a lot of other very nice things about C++ (as they became available).

But the article is a decade old, the project started 2007. So there is a good chance the project couldn't even use c++11 features. I still recall using initializer lists on my Linux machine only to have the nightly Windows builds fail (we were stuck on an old msvc for a while; the day we upgraded it there was much rejoice).

//Some light editing


> We used init functions at my last job

has the factory pattern somehow managed to crawl into a hole?


init functions and factory pattern are not orthogonal.


that is not the statement. they say C++ sucks because init pattern means an unititialized object might be used. the factory pattern solves that




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: