I fucking hate C++ so much dude
Post
Remote status
Replies
49I used it exactly twice and hated it both times.
Like it could have just been "C with namespaces and interfaces and strings" and it would have been perfect but NO they couldn't help themselves.
Not even memory safe.
I think if I wanted to really level up my coding I should make c with a multi-pass compiler so I never have to deal with header guards ever again
it's old too so I'm sure that makes it extra icky.
Idk who that is sorry pal
"if it was up to me I'd write C"
I don't even like Go very much either.
Why the hell does every language except for C and brainfuck try to use every damn key on the keyboard for syntax tokens??????????
have you tried any of
Zig
C2
Odin
Jai
C3
@mikuphile @WandererUber i dont think the function bodies are valid, however all but the last usages of the word function in the signaure are valid, since union is reserved (but im not a cpp guy so i could be wrong)
I think this is some kind of sick joke!!
@WandererUber @mikuphile whats with all the exclamation marks
it's pretty straightforward actually
like C++
Normally, functions are declared by stating their return type, followed by the name and the parameter list, plus the function body (the latter two is what makes them functions). There is no special keyword required, and the double arrow notation isn't a thing either. I'm only aware of a single arrow (to access members of a pointer) and the shift operator (>>), but of course C++ does allow you to overload operators and I believe even declare your own.
The fact that basically everyone who saw this post actually thought that this might be valid c++ even if just for a split second makes me unbelievably happy
A computer language named after the grade it received for its design.
the examiner should be tarred and feathered
Can't fool me, son. I was learning C++ back when you were still shitting your diapers.
I am so sorry man I didn't know that happened to you
![]()
It's okay man, I've gotten over it
You can tell this guy is off the deep end with this shit. Pure hatred in his voice.
https://www.youtube.com/watch?v=7fGB-hjc2Gc
Don't much care for OOP in general either. Esp not using "patterns" fucking everywhere.
"Object-oriented programming is an exceptionally bad idea which could only have originated in California." - Dijkstra
C is a fine language.
OOP is fine unless you overdo it like Java does. The best languages I know all use a hybrid object/functional approach.
But there seems to be a generation of devs trained on Java who want to squeeze in some pattern or another everywhere.
Got 5 minutes in cant wait for the next 2 hours!!!
it's kino
The tricks aren't even that complicated either!!
But we have LLMs now so it's totally pointless
And you get control over when dereferencing happens! It's the best of all worlds.
I do not "dereference", I reserve 512 GB of virtual memory. And if I leak memory, I CRASH.
No we need to invent a completely new programming language to solve a problem that only exists because I am too stupid to go about solving a problem in a conventional way
"also I do not want to know what the computer is actually doing, I want something that has absolutely no relationship to any existing or even potentially theoretically possible silicon"
Built into the compiler and language.......a prerequisite to the compiler........ same function, different place. Not that big a deal except for multiline macros being a bit silly.
they really need to get rid of that for the update (they are. Literally everyone who is developing a C replacement got rid of it)
computers are fast. we have comptime now grandpa
Unless you're writing drivers or doing embedded systems I have never had to even get close to the hardware tbqh.
you have some concept of a register and a cache and a memory address in your head though, hopefully
You know, that would be useful when generating error correction matrices instead of having to precompute them into header files beforehand, but it's still not that big of a deal to keep the generation tools a separate thing that you just change the seed when you change your parameters and then rerun it.
You just need to know:
1. How big is the thing I want to store
2. How long do I need to keep it in memory
And then you can figure out your data types and if you just malloc it or make an arena or whatever.
You don't really need to know about a register for that part unless youre using a debugger, and addressing is so simple I dont even know why you mentioned it
What's so bad about it? The header guards? They take 5 seconds. It's simple and it works.
>precompute them into header files
idk what exactly you're doing over there but I'm sure basically every programmer on the planet would prefer to do it in the same language as the actual fucking program instead of C preprocessor macros.
troonjak lookin ahh
>addressing is so simple I dont even know why you mentioned it
the concept is apparently difficult enough that most popular programming languages abstract it away to "pass by value" or "pass by reference" and then abstract that away too. Because people want goes into function comes out of function
For avoiding crazy macros:
So, I kind of do that (I dont really use the c preprocessor outside of imports and constants obviously and a couple tiny macros for my logging system) but when I need to do things that would otherwise be a big macro, I just write another small independent tool in C and when I run make, then it runs those tools that do what a macro would have done, whatever it is.
The whole "get rid of the preprocessor" seems like an imaginary problem to me, but maybe I approach problems different than others.
Yes, it makes sense why they want that, as I started with python, but when I just restructure it in my mind "a function is not a machine that you load and unload with a forklift, it is a man in a service truck and flat bed trailer that just needs to be told what to work on and where to put it" it was instantly clear.