➡️ http://cybre.space/@lifning utilise witches.town. Vous pouvez læ suivre et interagir si vous possédez un compte quelque part dans le "fediverse".

W-what are namespaces meant to do in C++? How do they work? What is up with headers and function declarations?? WHAT IS GOING ON WITH STATIC FUNCTIONS????

@Fenreliania Namespaces are just an organizational thing, you don't need to use them if you don't want, or you can put everything in the same namespace.
Header declarations are a legacy from C, and are needed for the compiler building one file to know the functions in another file.
"static" can mean one of three things, depending on context. In a class, it's just like C# or Java, common to all instances. In a function, it's a variable in static memory. Outside either, it's local to the file.

@impiaaa @Fenreliania static in a class, static in a function, and static on a _variable_ in a namespace (e.g. a "global" variable) all mean "allocate this variable in static memory when the program is executed"

static as a function modifier is...basically unrelated, i think C overloaded the keyword because they wanted to avoid adding more keywords to the language early on

@chr y'know, I know we're living in an age where a new LLVM frontend is made every day, but they're all so high-concept. I wish someone would make a "better C," just the same thing but without all these inconsistencies and ambiguities.

@chr @impiaaa they did that, it's called D - i mean, Go - i mean, Rust - i mean, uhh... I'll get back to you

@lifning @chr see, that's my point, I know of all of those, and none of them are anything like C

@lifning @chr Compiled to native, ABI compatible, no or optional dynamic memory management, no intrusive safety or privacy mechanisms, clear scoping rules, familiar syntax… Though I'll be honest, I might be willing to switch to *anything* that has a converter.

@chr @impiaaa Cython? Gambit Scheme? they're better languages that compile to C code and let you selectively pop the hood, anyway 👀

@lifning @chr I've considered Cython, but it's still basically dynamic. And, are you really suggesting a Scheme as a serious C replacement? 😆

➡️ http://cybre.space/@lifning @lifning

@chr @impiaaa i mean, every language is a worse version of lisp, right? 😏

· SubwayTooter · 0 · 1