News for hackers. Stuff that matters.
Re:C++ Is an Absolute Blast by pjmlp on Monday December 23, 2024 @11:17AM (#42495471)
While it is a great language, ir would profit from less "lets code C with C++ compiler" attitude.

Basically it is like renaming those JavaScript files from .js to .ts, and keep coding as if nothing else is available as productivity and safety improvements.

Re:C++ Is an Absolute Blast by ablob on Monday December 23, 2024 @11:31AM (#42495602)
Having read the article, nothing really stands out to me as "C with C++ compiler".

It talks about ranges, shared/unique pointers, lambdas... Essentially a lot of things C is lacking. I don't know where exacly the overlap you're insinuating comes from.

Re:C++ Is an Absolute Blast by pjmlp on Monday December 23, 2024 @12:06PM (#42495866)
Where did I mentioned the article?
Re:C++ Is an Absolute Blast by rickmode on Monday December 23, 2024 @01:36PM (#42496580)
Pronoun confusion. The second pronoun is ambiguous.

Since we are all “hackers” here, I’ll be pedantic…

“While it is a great language…”

The “it” pronoun clearly refers to the C++ language, as I’m sure you intended.

“…ir would profit from less ‘lets code C with C++ compiler ’ attitude.”

The “ir” — presumably a typo for “it” — can refer to the article or C++. Given that this thread is about an article, the second “it” referring to the article is a natural assumption.

Re:C++ Is an Absolute Blast by pjmlp on Monday December 23, 2024 @05:00PM (#42497949)
It with typo refers to C++.
Re:C++ Is an Absolute Blast by thefourthchime on Monday December 23, 2024 @12:29PM (#42496012)
I feel like an abused spouse after C++. I now avoid:

- Inheritance - Reference counting - Threading - Templates - Classes if possible - Hidden memory allocation - Anything that looks clever

Anytime I use them I get flashbacks to some mangled mess of templated threaded classes with some memory leak that shows up after 3 days.

I remember writing C++ and trying to figure out how the design would work between these classes, I would end up with something complicated and not entirely correct. Eventually, I thought, what if I did this in C? What would it look like, 90% it turns out with 90% less design and code (and bugs).

Re:C++ Is an Absolute Blast by pjmlp on Monday December 23, 2024 @12:40PM (#42496126)
There is no rule that requires "programming in C++ proper" being equal with using 100% of the language standard.

There is a middle layer, without having to keep repeating all the security flaws of coding in plain C.

Re:C++ Is an Absolute Blast by unclad5968 on Monday December 23, 2024 @10:12PM (#42499447)
You don't have to use any of that and you still get lots of nice things like range based for loops, STL containers, algorithms, namespaces, and constexpr.