You are viewing a single thread.
View all comments
67 points

Come on. C++ isn’t thaaat bad. It’s actually kind of nice to use coming from C.

permalink
report
reply
44 points

It’s actually kind of nice coming from C.

I’m reading this and all I can think is “yeah, I too would rather lose a limb than let a necrotic infection spread.”

permalink
report
parent
reply
15 points

C sucks to write and take care of memory, but it’s nice for super efficient code for use on smart watches. Samsung ditched it (tizen- native apps written in C) in favor of wearOS (java?), and their battery life is now less than half what it was.

permalink
report
parent
reply
10 points

Ruuuuuuust

permalink
report
parent
reply
4 points

Holy hell Java on a Smartwatch?

permalink
report
parent
reply
5 points
*

I hate writing code in either language. But at least what C has going for it is that it’s waaaay simpler than C++. Simple can be a really good thing. Sure, all those cool features can save you time, but they can also be gotchas that will cause bugs.

Though it is a balancing act. Too simple and you’ll make mistakes due to how much you have to repeat yourself or using unsafe equivalents (like using preprocessor directives to mimic features that C++ natively supports).

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
Deleted by creator
permalink
report
parent
reply
9 points

It’s the amount of legacy it’s carrying on that drives me crazy. Many of the implicit default implementations are confusing. That’s where all these “rule of 3”, “rule of 7”, “rule of whatever” come from. The way arguments are passed into functions is another issue. From the call-side you (sometimes) cannot tell if you’ll end up with a moved value or a dangling reference. The compiler will not stop you from using it. Even if the compiler has something to tell you, it’ll do it on the most cryptic way possible. I’m grateful we have C++, it paid lots of my bills. But it’s also a pain in the ass.

permalink
report
parent
reply
2 points

The most recent C++ thing I worked on (not that recent, like 5 years or so ago) was a fairly new project and the people working on it were really passionate about C++. But it was C++ code that ran as a Python library and was using the official Python C bindings. Not sure why we didn’t use one of the unofficial C++ libraries, but the usage of that C library (and such a fundamental one) held things back. We wrote was was modern C++ (at the time), but big chunks would be a completely different style.

permalink
report
parent
reply
14 points

C++ was necessary, and truly great compared to its predecessor. But the world has marched on. Rust is the current benchmark.

permalink
report
parent
reply
4 points

Depends on the use case, for HPC c++ is still the benchmark.

permalink
report
parent
reply
4 points

Yeah, some of the world marches slower than other parts.

permalink
report
parent
reply
10 points
*
Deleted by creator
permalink
report
parent
reply
Deleted by creator
permalink
report
parent
reply
3 points

Is there a way to disable the old c++ features? Or some kind of linter that points them out and suggests the new ways?

permalink
report
parent
reply
8 points

I used COBOL to write a small program, and it’s not so bad either. Bonus is that your standards are lowered so much that Java feels concise.

permalink
report
parent
reply
3 points

Laughs in ADA

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.7K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments