Egregoros

Signal feed

Timeline

Post

Remote status

Replies

49
I haven't used C++ in a long time but I've never seen or heard of this style of declaration. Especially since "union" is a reserved word in 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.
I for one have never liked C++.

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.
We had "objects" in C they are called structs and guess what libtard, we can have deep inheritance to via macros or simple inheritance by putting a pointer to another struct in your child object

The tricks aren't even that complicated either!!

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.

Concept yes but unless you are implementing a really performance bottleneck thing it really isn't necessary.

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
I'm not a compiler designer obviously, but I think when everyone and their mother tells you preproc got out of hand, and everyone who is competent just rips it out completely, that should count for something.

>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.
I thought we were talking about comptime! 🥴

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.