# less_retarded_wiki

main page, file list (652), source, commit RSS feed, report abuse, stats, random article, consoomer version

# C++

C++ (also C--, C卐卐 or crippled C) is an object-obsessed joke language based on C to which it adds only capitalist features and bloat, most notably object obsession. Most good programmers such as Richard Stallman and Linus Torvalds agree that C++ is retarded and also tragic in that it actually succeeded to become mainstream. The language creator Bjarne Stroustrup himself infamously admitted the language sucks but laughs at its critics because it became successful anyway -- indeed, in a retarded society only shit can succeed. As someone once said, "C++ is not an increment, it is excrement". C++ specification has over 2000 pages :D You could fit several novels in that space.

C++ source code files have the extensions `.cpp` or `.cc` (for "crippled C").

Still at least it's not as bad as Rust or Python, we could say C++ is "bearable" -- horrible in design and philosophy but fine in performance and AT LEAST it's similar to C so programs in C++ may potentially be unfucked.

## Examples

Here is our standardized divisor tree program in C++:

    #include <iostream> // include standard I/O library
    using namespace std;

    // recursive function, prints divisor tree of x
    void printDivisorTree(unsigned int x)
    {
      int a = -1, b = -1;

      for (unsigned int i = 2; i <= x / 2; ++i) // find two closest divisors
        if (x % i == 0)
        {
          a = i;
          b = x / i;

          if (b <= a)
            break;
        }

      cout << '(';

      if (a > 1)
      {
        printDivisorTree(a);
        cout << ' ' << x << ' ';
        printDivisorTree(b);
      }
      else
        cout << x;

      cout << ')';
    }

    int main()
    {
      while (1) // main loop, read numbers from the user
      {
        unsigned int number;
        cout << "enter a number: " << flush;
        cin >> number;

        if (!cin.fail() && number < 1000)
        {
          printDivisorTree(number);
          cout << endl;
        }
        else
          break;
      }

      return 0;
    }

## See Also

- C
- C#
- Java
- Python

Powered by nothing. All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.