this post was submitted on 22 Mar 2024
226 points (94.5% liked)

Programmer Humor

35311 readers
204 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] merthyr1831@lemmy.world 44 points 1 year ago (5 children)

If C++/C were real languages for real programming they'd enforce this in the compiler.

No sane language designer would say "it is imperative that you do not implement your class in its header file" then write a compiler designer to say "oh you implemented your code in the header file? lol lmao that rocks"

They have played you all for fools.

[–] SubArcticTundra@lemmy.ml 18 points 1 year ago (1 children)

I actually like how much freedom C++ gives you. As long as it is fed valid code, it does not give a fuck about how you choose to structure your project

[–] tyo_ukko@sopuli.xyz 2 points 1 year ago (1 children)

That freedom becomes misery on the instant you have to start maintain the code from some other free spirit, whose style is totally different from yours.

[–] DraughtGlobe@feddit.nl 2 points 1 year ago

Or the free spirit was actually you yourself but from three months ago

[–] Lauchmelder@feddit.de 6 points 1 year ago

not saying it's good design, I ditched C++ long ago. at least the C++20 modules API is gonna fix this, right guys?

[–] brisk@aussie.zone 4 points 1 year ago

Header files aren't part of the C++ language at all.

Also mandatory "C++/C is not a language"

[–] stingpie@lemmy.world -4 points 1 year ago

If C++/C were real languages for real programming they'd enforce unreadability in the compiler.

No sane language designer would say "It is imperative that you write the most unreadable code possible" then write a compiler that says "oh your code doesn't triple dereference pointers? lol lmao that rocks"

They have played you all for fools.