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
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
57 points

Caution: Finding something that one hates more than one’s self does not take away the initial self loathing. Attempting to mollify or subdue the lesser by observation or interaction with the latter may result in something greater than the sum of its parts and oh boy, Jeffery Christmas, now we’re in for a bad time.

permalink
report
reply
41 points

I guess that’s how Java was born.

permalink
report
parent
reply
18 points

Java was conjured, not born.

permalink
report
parent
reply
2 points

I really don’t understand the hate that Java gets. I would use Java any day over C# if given the chance

permalink
report
parent
reply
47 points

I love c++.

That is all.

permalink
report
reply
18 points

Some people have weird fetishes too, I won’t judge.

permalink
report
parent
reply
15 points

That’s okay, everyone has the right to be wrong.

permalink
report
parent
reply
2 points

Pfft. You’re just afraid of pointers.

permalink
report
parent
reply
3 points
*

And I love references. Bring on the Rust lifetimes!

permalink
report
parent
reply
1 point

It’s not a right if it’s wrong

permalink
report
parent
reply
4 points

Me too. Have been programming in C++ since I was 10 years old. The first programming language I’ve learned and the one I still love using today where appropriate for the task at hand.

permalink
report
parent
reply
45 points

Boy oh boy, you gonna hate like a sith if you find out how sh*tty python is.

permalink
report
reply
43 points

Or bash.

So incredibly annoying too read.

permalink
report
parent
reply
Deleted by creator
permalink
report
parent
reply
9 points
*
Deleted by creator
permalink
report
parent
reply
12 points

I believe the reason is that bash is backwards compatible with sh and sh only has [ ], not [[ ]]

permalink
report
parent
reply
2 points

[[ is not a POSIX shell feature.

permalink
report
parent
reply
8 points

So many footguns. Use python in place of bash.

permalink
report
parent
reply
0 points

tbh i would rather use assembly than python.

permalink
report
parent
reply
3 points

Perl calls to you. Admire its beauty.

permalink
report
parent
reply
0 points
*

cries in hours spent trying to walk through pretty but obtuse JAPHs

permalink
report
parent
reply
2 points

Bash is so bad. I literally use it every day and have written many Bash scripts, yet I’m constantly having to search for how to do things in it because syntax is so bizarre and difficult to remember. Need to do a for loop over lines in a file? You can bet I’m googling the syntax for it. I have a general idea for what it looks like and know what to search for, but no way in hell can I write it correctly in the first few tries.

String manipulation is the absolute worst. Have fun getting to learn the unreadable syntax of most sed and awk programs (the only thing most people have memorized is find and replace). Stuff like “split a string of comma separated ints and add them up” are way harder in Bash than in Python, despite the fact I often need to do stuff like that in Bash. Well, in the terminal anyway. Sometimes I’ll just use Python, but Python’s weakness is executing programs and getting their output, which is nowhere near as convenient as it is in Bash.

Side note, isn’t it weird that for a language where flags like --foo bar are so commonly used, there’s no built in or standard tools for accessing flags?

permalink
report
parent
reply
12 points

What don’t you like about Python?

permalink
report
parent
reply
13 points

The syntax, the syntax-highlighting, venv creation and usage, having to import everything even inbuild types, have fun checking what a third party library has for functions and what they need :D Async is a hecking mess, documentation is another (bad) story.

permalink
report
parent
reply
19 points

I’m sure the syntax highlighting is entirely dependent on what editor you use, and is not a property of the language itself.

permalink
report
parent
reply
5 points

I’ll throw a real petty one out there… indentation.

permalink
report
parent
reply
8 points

???

permalink
report
parent
reply
6 points

You forgot your indentation and a third party docs is outdated. Now try and debug it with this error message:

Not enough value to unpack (expected 2, got 1) (not any stack trace btw) documentation was terrible. :D

permalink
report
parent
reply
7 points
*

Huh? The Python Stacktrace is great. What kinda fucked up library were you using that it prints the error code instead of raising an exception?!

Also don’t think outdated library docs are a fault of Python 😅 In much the opposite way, I’ve found Python’s standard library to be really great, reducing the number of random third party libraries needed. (Looking at you, JavaScript)

permalink
report
parent
reply
3 points
*

You forgot your indentation

Sounds like a problem for someone who is writing the code on a toilet paper or whiteboard. Most people have some sort of hackable editor/IDE that handles the indentation and code blocks.

obfuscated error messages

Just don’t use libraries which print or log exceptions without raising it :)

permalink
report
parent
reply
31 points

Although I haven’t used it since college, I actually liked C++ especially once I understood pointers.

permalink
report
reply
38 points
*

Everything is fine within the scope of a college course or project.

Where C++ breaks down is large, complicated projects where you colaborate with other developers over multiple years.

I worked in C++ for almost a decade, and while there were a few good projects I encountered, most suffered from one or more of the following problems:

  • C++ has so many parts, everyone picks a subset they think is “good”, but noone seems to fully agree on what that subset is.
  • A side effect of the many possibilities C++ offers to compose or abstract your project is that it allows for developers to be “clever”. However, this often results in code that is hard to maintain or understand, especially for other developers.
  • Good C++ is very hard. Not everyone is a C++ veteran that read dozens of books or has a robust body of knowledge on all its quirks and pitfalls, and those people are also often assigned to your project and contribute to it. I was certainly never an expert, despite a lot of time and effort spent learning and using C++.
permalink
report
parent
reply
10 points
*

Just use C. It solves all those problens given the most complicated feature is pointers and those hard aren’t to understand.

permalink
report
parent
reply
6 points

While C is certainly better for some problems in my experience, it too is very hard to use in large projects with a mix of developers, and it is unsuitable for most higher level applications in most companies.

I think C has its place in the world still, which is mostly confined low level embedded, kernel space and malware. I do believe that the market segment that used to rely on C++ is today better served by either Go or Rust, depending on the project.

That said, while I LOVE working with Rust, it suffers from many of the same issues I mentioned for C++ in my comment above when working in a mixed skillset team.

permalink
report
parent
reply
2 points

So would there be a happy medium between C and C++? A C+, if you will.

permalink
report
parent
reply
3 points

There is actually a C+, also called “orthodox” C++ https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

permalink
report
parent
reply
1 point

Yes, use C++, but with extern "C" for everything so you can easily interface with other software. That limits you to no classes or namespaces, but internally you can use smart pointers, vectors, maps and actual strings.

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.8K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments