News for hackers. Stuff that matters.
Re:Why should I have written ZeroMQ in C, not C++ (2012) by stcont on Saturday August 13, 2022 @01:27AM (#32447189)
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.

Re:Why should I have written ZeroMQ in C, not C++ (2012) by archi42 on Saturday August 13, 2022 @03:05AM (#32447575)
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

Re:Why should I have written ZeroMQ in C, not C++ (2012) by languageserver on Saturday August 13, 2022 @10:18AM (#32450127)
> We used init functions at my last job

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

Re:Why should I have written ZeroMQ in C, not C++ (2012) by stcont on Sunday August 14, 2022 @12:12AM (#32456257)
init functions and factory pattern are not orthogonal.
Re:Why should I have written ZeroMQ in C, not C++ (2012) by languageserver on Wednesday August 17, 2022 @02:02AM (#32492838)
that is not the statement. they say C++ sucks because init pattern means an unititialized object might be used. the factory pattern solves that