SNCA:C++

From Soyjak Wiki, the free ensoyclopedia
(Redirected from C++)
Jump to navigationJump to search
C++ is ARYAN
btw, if that matters
Don't mention to the C++ developer how bad their language actually is, lest they start leaking

C++🗝️ is a general purpose programming language that is used for all sorts of software, from game development to embedded systems. It is the language of choice for chuds everywhere, although some troonslop such as Touhou Project was written in C++ o algo. It extends the C language with additional concepts and features and has a larger standard library, and it originally began as an extension of C with object oriented programming support. Some similar languages to C++ are Java and Rust (which trannies transheart). Learning it will make you a racist chad. It is literally better than C in every way. It is also somewhat similar to C#, which itself is based on Java and is the language used by a lot of slop game engines such as Unity and Godot. C++ is the language of Unreal Engine and most game development SDKs are C++. Linus Torvalds, the creator of Linux, however, seethed about it, just like he seethed about Java.

It has been used by some Jewish companies such as Microsoft to create coal such as Windows, because it is suited for high-performance applications.

Despite its Aryanity[Nobody says this], Terry Davis has referred to its creator, Bjarne Stroustrup (a Danish and thus Aryan chad), as a nigger. This might just be him seething about the language itself doe (actually bjarne is a nocoder cnile subhuman).

Memory and type safety improvements[edit | edit source]

WARNING: WORDSWORDSWORDS
This page or section is just one big wall of text.


C++ solves a lot of memory issues that C originally had.

  • C++ has RAII (or "Resource Acquisition is Initialization"), which is a pattern that automatically releases resources once they go out of scope. In C you would have to call ::free(), but in C++ an object automatically calls delete on itself once it goes out of scope (unless it's a pointer o algo).
  • If you were using pointers, you could use smart pointers which do the same thing but for pointers.
  • C++ introduces scoped enums with enum class, over C enum.
  • Collection types such as std::vector offer bounds checking with .at() and automatically resize themselves (meaning you don't have to use ::realloc() like you would to resize an array in C). You can also use std::array<T, N> instead of T[N] which is safer and more idiomatic or something.
  • C++ has a built in std::string type instead of relying on char[] for strings (which is a bare minimum for most languages nowadays), and ensures that a raw block of memory doesn't get used as a string.
  • C++ adds copy and move semantics.
  • C++ decreases reliance on the preprocessor, which is heavily used by C but is much less type safe due to performing literal text substitution:
    • Instead of using #define to define macro constants, you can use constexpr to define constants and functions known at compile time, which don't occupy any memory at runtime but remains type safe. This feature was so gemmy it was backported to C23. It is like a stronger version of const.
    • Instead of using #define to define functions or bypass function call stack overhead, you can use inline to tell the compiler to substitute the function body.
    • To avoid recompiling translation units multiple times which occurs when you #include header files, you can use modular translation units and import them so they are only compiled once and do not require include guards.
  • Instead of using void* (void pointers) to write generic code, you can use templates to make generic code. You can restrict templates using concepts for increased safety as well.
  • C++ has easier error handling: you can throw exceptions or return std::expected<T, E> (omg just like rust sisters!!!), unlike in C which relies on return codes. In C++ you can use try/catch blocks to do cleanup upon errors.

Criticism[edit | edit source]

Somebody call fuckin' Soyberg!
The following page or section was written during a schizo episode.
You WILL remind the author to take his meds.
Bjarne Stroustrup and the C++ committee are trans btw, if that matters.
> Now, there was a nigger, who came up with this: std::cout << "Hello, world!" << std::endl and that's pretty niggerlicious. <
Terry Davis


We have more in common than previously thought!

Despite its aryanity there are a lot of things that make C++ bad.

  • Poorly designed standard library that includes a lot of random features picked up over the years.
    • C++ doesn't separate its standard library into namespaces like every other language, so everything gets dumped in to the std namespace
    • A lot of features that no one asks for get added to the language but important features like networking, process management, or an improved OS API never get added meaning you have to use some external library like Boost. So you basically have to use some shitty library maintained by a 'cord troon implying the standard library isnt shitty itself, but at least in Rust it's easy to that whereas in C++ it's a pain in the arse.
    • The features that get added to C++ are either dead on arrival because they were designed by a sub-80 IQ drooling retard or no one cares about the feature, or compilers take forever actually implementing the feature (for example modules).
    • Minecraft Bedrock edition is buggy as shit
    • C++ names all its symbols in snake_case, even classes and constants. For example instead of UniformIntDistribution like most languages would name it, in C++ it is uniform_int_distribution.
    • The standard library is distributed through headers and not modules, and in order to prevent distortion of symbol names by the preprocessor (because headers are processed by the preprocessor while modules are not), all symbols in the standard library are suffixed with underscores and random capital letters resulting in goofy aah skibidi yapping error messages in Ohio. No other language has this problem (except maybe C), because no other language still uses headers geg.
  • Extremely niggerlicious error messages that no one can read, especially from any code involving templates.
  • using is avoided like the plague in C++, though for no good reason. The usual story you hear is using namespace std; is for plebs or something, but this is pretty retarded reasoning. Could you imagine writing Java with no import statements or C# with no using statements? That's pretty much the same thing but I guess C++niggers put up with it because writing std:: is five extra characters and once again they dumped everything into that namespace.
  • Unlike Rust which has a very simple and official build system, cargo, C++ has no official build system which means you have to use something like CMake which is a scripting language for configuring your build system. Also CMake is a build system generator, not a build system. This means you have to use CMake to generate the actual build system (like Make or Ninja), which is usually extremely verbose and difficult to manually write yourself.
  • Including third party libraries is extremely difficult. Unlike Rust which has repositories like crates.io, in C++ there are no official package managers or repositories to get stuff from so you have to either use microshit jeetslop like vcpkg which doesn't even work or conan which is also a pain in the ass to set up. Or you can use CMake FetchContent which also sucks nigger bbc geeeeeeeeg. Or you can literally just copy header files in to your include directory like a troglodyte.
  • C++ is not officially distributed, it is actually standardized by a committee which consists mostly of nocoder boomer trannies who suggest features and vote them in to the language. This also doesn't mean that there is an official C++ release, it means compilers have to implement their shitty specification and they often never finish. For example GCC and Clang still have features from C++17 that are unimplemented.
    • The committee, being run like a tranny anarchist committee that never decides on anything just like the CHAZ from the BLM protests in 2020, never passes any features and C++ basically only gets two or three new features every three years, unlike Java which gets huge updates twice a year.

Example[edit | edit source]

import std;

using std::mt19937;
using std::runtime_error;
using std::uniform_real_distribution;

/**
 * @brief Determines whether the tranny should ack based on a given probability.
 *
 * @param ackProbability An (unsigned) integer between 0 and 100 representing the chance of acking.
 * @return True if the random probability is less than the ackProbability; otherwise, False.
 */
bool shouldAck(unsigned int ackProbability) noexcept {
    static mt19937 gen(std::time(0));
    uniform_real_distribution<float> dist(0.0f, 100.0f);
    return dist(gen) < static_cast<float>(std::clamp(ackProbability, 0, 100));
}

/**
 * @brief Main function that decides whether to ack or scream TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!! based on probability.
 *
 * @param argc The number of command line arguments.
 * @param argv An array of command line arguments.
 * @return Whether the program executed successfully.
 *
 * @throws std::runtime_error
 */
int main(int argc, char* argv[]) {
    if (shouldAck(41)) {
        throw runtime_error("ACK!!!!"); 
        // geeeeeg nusoijeets throw exceptions instead of returning std::expected 
        // ^ meds its supposed to crash the program not return gracefully
    } else {
        std::println("TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!!"); 
        // because std::println is keyed and iostreams suck
    }
    return 0;
}

Gallery[edit | edit source]

C++
is part of a series on
Soyience™

Visit the Soyence portal for more.
"We are all just hecking star dust or something!"
Peer reviewed sources [-+]
Fields of science [-+]
Science in praxis [-+]
Theoretical branches [-+]