C++ eternally BTFOhttps://www.youtube.com/watch?v=7fGB-hjc2Gc
>>107837821There are definitely worse lingos I came across ...
>>107837821This is just bitching about shit not being easy for beginners
>>107838097not really. for example header files are plain retarded and will never not be retarded.
What's a better alternative to C++?
>>107838263There isn't any. C++ is a terrible language but there is no better language in its domain.
>>107838263D
>>107837821TL;DW
>>107838332C++ is the worst programming language of all time
>>107838126How do other compiled languages link functions between files? Do they just make a global symbol table off the definitions?Honest question
>>107837821I like the laissez-faire philosophy of c++there's no official compilerno official package managerno enforced code formattingno official community Discord serverand usually many ways of achieving the same goal, some more optimal than others but can suit different styles of programming.
>>107838332c++ sucks ass, hard, many reason givenc++ still will be used and wont die, reasons given
>>107838511To answer your question simply: Yes, they essentially create a global symbol table, but no, they don't just dump the raw function names into it (except for C).Most compiled languages (C++, Rust, Go, Swift, D) compile source files into Object Files (like .o or .obj). These object files contain a mini-symbol table. The Linker then combines these into one massive list to resolve connections.Here is the breakdown of how this works and how modern languages improve upon the old C model.1. The Universal Mechanism: "Provided" vs. "Required"regardless of the language, almost all compiled languages generate object files that contain two specific lists:Exports (Definitions): "I have a function named X located at memory offset 0x123."Imports (Undefined References): "I am trying to call a function named Y, but I don't know where it is."The Linker is a program that reads all the object files, finds the "Exports" from one file, and plugs them into the "Imports" of another.2. The Problem: The "Flat" NamespaceIn C, if you write void init() in File A and void init() in File B, the linker will crash with a "Duplicate Symbol" error. This is because C uses the raw name. The global symbol table is "flat."How C handles it:You have to manually prefix functions: audio_init, video_init.You use the static keyword to tell the compiler: "Do not put this name in the global symbol table; keep it private to this file."3. How Other Languages Handle It (Name Mangling)Modern languages (C++, Rust, Swift) allow you to have a function named init in ten different files without a collision. They do this by lying to the linker about the function's name. This is called Name Mangling (Symbol Decoration).They encode the namespace, the module, and sometimes the function signature directly into the name string that goes into the global symbol table.
>>107838511C: Uses raw names. Rely on the programmer to make names unique or hide them with static.C++: Uses Mangling. Encodes the class name and argument types into the symbol string.Rust/Swift: Uses Heavy Mangling. Encodes the package/crate name, module path, and a hash into the symbol string.Go: Prefixes the Package path.
>>107838263C.
>>107838263C
>>107838263>What's a better alternative to C++?properly using C++also possibly C++2 by Herb
>>107837821Bold claim when C# and dotnet exist