News for hackers. Stuff that matters.
Re:Embracing Modern C++ Safely, Book Review by UmbertoNoEco on Monday May 30, 2022 @03:47PM (#31562905)
Writing as someone just learning Rust (knowing more C++) I think a comprehensive Rust book would be in that scale too (+1000 pages).

> Learn to embrace the pain.

Judging by how much I suffered just to try to implement a sqrt function generically I think that is not an exclusive C++ thing.

> And yet converting code to Rust is hard.

Exactly, that is why many many projects will remain in C++ for a long long time.

Re:Embracing Modern C++ Safely, Book Review by ncmncm on Monday May 30, 2022 @06:51PM (#31564472)
All projects in C++ will remain C++ forever.

Some projects will be coded in other languages, and stay in those languages. Wherever that language fizzles, the project will too.

Re:Embracing Modern C++ Safely, Book Review by tialaramex on Monday May 30, 2022 @08:13PM (#31564941)
> All projects in C++ will remain C++ forever.

Anybody who believes this ought to think it an excellent reason to stay away from C++. For actual software projects I mean. Obviously if you want a career writing books (like the one reviewed) or on the conference circuit, or training, or several other prospects, this is great news. C++ is a good language it which to charge somebody $1000 per day plus expenses to tell them what they already knew.

But if you actually write software, or worse, if you need software but that isn't really what you actually wanted to do just a necessity like farmers need to know how to drive a tractor, then this ought to put you off. C++ doesn't want to be your best choice, according to ncmncm anyway, it wants to be a trap you fall into and can't get out of. Run away!

Re:Embracing Modern C++ Safely, Book Review by ncmncm on Monday May 30, 2022 @08:32PM (#31565033)
Projects coded in Rust will remain in Rust, too. Projects coded in Go will remain Go. Projects in Java will remain Java.

So, the advice above is just to avoid all languages (which, by the evidence, he does, seeming to know nothing meaningful about any).

There is an exception, though. Projects in C have frequently transitioned to C++, often with great success, notably Gcc and Gdb.

Re:Embracing Modern C++ Safely, Book Review by oncewas on Monday May 30, 2022 @08:45PM (#31565093)
People language hop all the time. I 've seen people rewrite apis from python to Go, java to go, python to scala, Go to rust, etc etc etc.
Re:Embracing Modern C++ Safely, Book Review by PaulDavisThe1st on Monday May 30, 2022 @11:24PM (#31565814)
I write software. In C++. Roughly 610,000 lines of C++. It's just fine, thank you very much.
Re:Embracing Modern C++ Safely, Book Review by oncewas on Monday May 30, 2022 @08:42PM (#31565076)
That's pretty silly, lots of c++ projects have changed languages over the years. We get that you like c++ but let's not be myopic.
Re:Embracing Modern C++ Safely, Book Review by imron on Monday May 30, 2022 @09:25PM (#31565275)
It's not silly at all, you're just not aware of the larger context the parent is speaking of (ironic considering accusations about myopia).

For example, the current c++ project I work on (for a large company) has over 1.5 million lines of c++, spanning over 5,000 files, with business knowledge and bug fixes spanning over 30 years.

It's not going to get rewritten in anything else, and the same goes for large amounts of other business software.

Re:Embracing Modern C++ Safely, Book Review by oncewas on Tuesday May 31, 2022 @08:06AM (#31568589)
Depending on what that business software is doing I wouldn't be surprised in a few hundred thousand lines were written in something else. Microsoft (https://medium.com/@tinocaer/how-microsoft-is-adopting-rust-...), etc, are all doing this right now. But yea if you are writing low velocity, non mission critical software, no need to bother. On the other hand, there may come a point in time where that c++ project gets a boost by factoring the critical parts out of it into a safe language...
Re:Embracing Modern C++ Safely, Book Review by imron on Tuesday May 31, 2022 @08:25PM (#31576575)
The one I’m working on is a behemoth and already has several hundred thousand lines of other languages (python, Java, scala) as part of it.

The c++ will be staying c++.

I don’t say this out of any affinity for c++(check my other comments for details), rather because for business reasons, the core of this system will always be c++.

In fact we a currently embarking on a multi-million dollar project to upgrade the application to run in the cloud and one of our biggest challenges is finding qualified c++ candidates.

Despite that, due to the complexity and scope of the application and years of business knowledge captured in obscure parts of the code, there is no consideration for it to be rewritten in anything else.

Re:Embracing Modern C++ Safely, Book Review by imron on Tuesday May 31, 2022 @11:58PM (#31577903)
P.S. the software is absolutely mission critical (responsible for a non-trivial % of total company profit), hence the reason it's not going to get rewritten without a very, very compelling business case.
Re:Embracing Modern C++ Safely, Book Review by bogeholm on Monday May 30, 2022 @07:39PM (#31564759)
Three sentences, each with the same thing stated twice - three tautologies.
Re:Embracing Modern C++ Safely, Book Review by ncmncm on Monday May 30, 2022 @09:39PM (#31565351)
I.e., you did not understand it.