r/ProgrammerHumor • • Jan 28 '23

Meme C++

Post image
53.9k Upvotes

1.5k comments sorted by

View all comments

Show parent comments

107

u/marti_2203 Jan 28 '23

Some of these things are solutions from different periods (smart pointers and the things before it, ifndef and pragma once) but I think the inheritance and CRTP solve vastly different problems. And thank you for reminding me about .cc vs .cpp

20

u/merlinsbeers Jan 28 '23

vs .C vs .CC

No really. There were people using .c for C and .C for C++. On Windows.

3

u/marti_2203 Jan 28 '23

When did this happen? What is the history behind this???

2

u/throw3142 Jan 28 '23

lmao I had no idea. Wait aren't filenames case insensitive on Windows? That's even worse!

7

u/[deleted] Jan 28 '23

I've heard that using POSIX subsystem for Windows (introduced in WinNT 3.1) you could achieve case sensitivity on Windows.

35

u/throw3142 Jan 28 '23

Yeah I totally agree, each of these variants is different for a reason, and each one has its place. That doesn't stop them from being mixed together in weird combos and making the codebase completely unreadable lol

5

u/marti_2203 Jan 28 '23

Legacy spaghetti code sprinkled with technical debt, my favourite

1

u/[deleted] Jan 28 '23

Can you even do CRTP without inheritance? It's more like a very specific case of inheritance, utilizing the C++ template system.

2

u/marti_2203 Jan 28 '23

Yeah, but the CRTP makes it such that there is no vtable iirc and that was the big thing