C
Paradigm | Multi-paradigm: You name it we've got it unless it's useful |
---|---|
Creator | Bjarne Stroustrup |
Stable release | ISO/IEC 14882:2014 / 15 December 2015 |
First appeared | 1983 |
OS | cross-platform |
Filename extensions | .cc .cpp .cxx .c .hh .hpp .h .hxx |
Discipline | Severe typing |
Website | isocpp.org |
Under the influence of | |
C, Medusa-2, ADA, Pascal, SNOBOL, ML, Methamphetamine | |
Bad influence on | |
ADA-95, D, Sumatra, Forth, C#, Rust, PHP, Javascript, Java, Go, FORTRAN, Matlab, assembly, BASIC, COBOL, R, Your Children | |
Wikibooks | |
C=C 1 Programming at Wikibooks | |
C=C 1 (also refered to as C ) is a programming language derived from C by programming language algebra. It is one of the most successful practical jokes ever played on nerds who take ideas like object-oriented programming seriously. It was also a pioneer of the technique of catching people off guard by introducing new features every five years or so that are too hard for the compilers to get right first time, and that, even when they do get it right, are incompatible with the old language in surprising and unpredictable ways. Every Gopher knows that Bjarne Stringsoup complicates the C spec every three years in order to sell more books to unsuspecting programmers.
Other advanced features include pairs of keywords which look totally different but do almost exactly the same thing and having some keywords that get used everywhere to do a lot of totally different things.
It is, by definition, better than C, [1] but most people are too feeble minded to learn it, and usually die of an aneurysm when they begin to learn how to use templates. [2] Given the complexity of the language, only the best programmers can actually see it, and because of the necessary skills, the programs are always smaller, faster, and better than programs written in other languages, except any language that has been released after 2000.
In C programming language from which C inherits its 0.1% of problems, C means increment the value of C. But the expression C itself evaluates to the value of C. Which means C offers zero benefit over C, according to Rob "lol no generics" Pike who also has experience in creating languages that offer no practical advantage over C.
The language[edit | edit source]
The C language is a close relative of Gibberish, and is spoken by the people of Atlantis. However, nobody can study the language closely because Atlantis has yet to be found. But some nerds suggest it was spoken by early Aryans in the India as an average Indian understand C better than his mother tongue. Regardless here is a translation.
((C : Language) == (Gibberish : language)) && (Atlantis.people::operator<< == C ) && ! (person->CanStudy(C ) == false); Atlantis.location == NULL; catch(...) { Translate(*this); }
"C derives from the same language as Gibberish and the people of Atlantis output to a C stream. However a person can study C is false. The location of Atlantis is unknown. Ignore exception and translate this."
The C language supports OO programming by providing support for abstraction, encapsulation, inheritance, polymorphism, metamorphism, symbolism, neopaganism, satanism, communism, non-determinism and severe masochism. It gives programmers more control by allowing them to overload and override functions, while being backwards compatible with the C language's ability to overrun buffers.
The language is also incredibly hard.
#include <iostream>
int main() {
std::cout << "Goodbye World" << std::endl;
return 0;
}
is the same as Console.WriteLine("Goodbye World");
in C#. It is also equivalent to print("Goodbye World")
in Python.
History[edit | edit source]
C=C 1 was undoubtedly a Cold War conspiracy by someone against someone else. Ideas on who instigated it, and what their target was, vary considerably.
Some say C=C 1 was developed by hardcore Russian scientists who needed a computer language so hard to understand that it would keep the wages of computer scientists artificially high for decades to come. The language managed to infiltrate the telephone infrastructure of the USA and allies via AT&T Bell labs. Some rumored an AI known as Stroustrup to be the villain who caused this.
Others, however, argue that Bell Labs was part of a secret CIA-funded scheme to bankrupt the Soviet Union by encouraging them to base all their software technology on a programming language so un-cost-effective that it would devastate their economy. Shortly after rumors about C and AWK reached top state planners, Kremlin officials were regularly discussing the "curly bracket language gap" that had opened up between the superpowers. The CIA plot was so successful that the scheme was quite openly adopted by the Reagan administration to win the cold war.
C=C 1's immediate predecessor was C with Specs. This added a new keyword, class, which did exactly what struct did, only with more class. This was all very well at first, but the demand for more powerful obfuscation features was growing in the early 1980s, and soon class was doing all kinds of things.
By the end of the decade, even this wasn't obscure or confusing enough, and there was very little more that class could do. It was time for a whole new keyword, and template added a whole new layer of confusion.
C=C 1 is Born[edit | edit source]
C=C 1 is currently the top choice for programmers when it comes to the art of computer programming. Created to be the replacement of all other programming languages, it has mutated far too much to be controlled. It has gained an almost sentient mind. It actively seeks out new host computers, finding and destroying all other languages on the hard drive, including English.
With the added functionality of OOP, C=C 1 continues to be a severe threat to the computer world. Many have fallen victim to its merciless attacks on their PCs, losing most, if not all of their archived pornography and txt files.
It is even believed that C=C 1 has taken over half of Asia's government, using their resources to plan an attack that will end the reign of VB.NET and D?.
Design Principles[edit | edit source]
Some important design principles have been established to guide the development of the language and are listed here:
⚜ 𝕴𝖋 𝖎𝖙 𝖜𝡣𝖗𝖐𝖊𝖉 𝖎𝖓 𝕾𝖎𝖒𝖚𝖑𝖆, 𝕬𝖉𝖆, 𝕸𝖊𝖉𝖚𝖘𝖆-2 𝡣𝖗 𝖆𝖓𝖞𝖙𝖍𝖎𝖓𝖌 𝖊𝖑𝖘𝖊, 𝖎𝖙 𝖜𝖎𝖑𝖑 𝖜𝡣𝖗𝖐 𝖎𝖓 𝕮=𝕮 1.
⚜ 𝕿𝖍𝖊𝖗𝖊'𝖘 𝖓𝡣𝖙𝖍𝖎𝖓𝖌 𝖆 𝖋𝖊𝖜 𝖒𝡣𝖗𝖊 𝖈𝖚𝖗𝖑𝖞 𝖇𝖗𝖆𝖈𝖐𝖊𝖙𝖘 𝖜𝡣𝖓'𝖙 𝖋𝖎𝖝.
⚜ 𝕰𝖓𝖘𝖚𝖗𝖊 𝖘𝡣𝖚𝖗𝖈𝖊 𝖈𝡣𝖉𝖊 𝖇𝖆𝖈𝖐𝖜𝖆𝖗𝖉𝖘 𝖈𝡣𝖒𝖕𝖆𝖙𝖎𝖇𝖎𝖑𝖎𝖙𝖞.
⚜ 𝕭𝖊 𝖆𝖕𝖕𝖊𝖆𝖑𝖎𝖓𝖌 𝖆𝖓𝖉 𝖊𝖆𝖘𝖎𝖑𝖞 𝖒𝖆𝖗𝖐𝖊𝖙𝖆𝖇𝖑𝖊 𝖙𝡣 𝖌𝖚𝖑𝖑𝖎𝖇𝖑𝖊 𝖓𝖊𝖗𝖉𝖘.
⚜ 𝕰𝖓𝖘𝖚𝖗𝖊 𝖘𝡣𝖚𝖗𝖈𝖊 𝖈𝡣𝖉𝖊 𝖋𝡣𝖗𝖜𝖆𝖗𝖉𝖘 𝖈𝡣𝖒𝖕𝖆𝖙𝖎𝖇𝖎𝖑𝖎𝖙𝖞.
These principles are intended to contribute to the popularity of the language, not to its usefulness.
Code Example[edit | edit source]
It has been discovered that C provides a remarkable facility for concealing the trivial details of a program - such as where its bugs are.
The following is a small example of some dangerous C=C 1 code that, when compiled by Brazilian sweat shop children, it will donate all of Coca Cola's backup funds to charities around the world.
#include <mutation.h>
#include <iostream>
#include <string>
#include "evil.h"
#include "coca-cola.h"
// use the sexually transmitted disease namespace
// be careful when using its methods across multiple programs
using namespace std;
int main()
{
// decrypt the elephant konstant, or the program may spontaneously combust
parse(ELEPHANT);
// get the total amount of money
long double money = Cola.GetMoney();
// determine pimp factor
if (money > 10) {
Donate(money);
} else {
cout << "LOSERS!!!111!1!1" << endl;
KillAll(true); // It must be the [[apocalypse]]! Might as well kill everyone before [[Zeus]] does...
}
return 0; // everything worked fine! Have a great day :)
}
As you can see from the complexity of the code above, it is very difficult to learn this language. However, at least take some comfort in knowing that not all C=C 1 code is hard to learn. Consider the following typical Hello world program:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0; // it's very important, because you win, when ALL is Nothing ;}
}
Microsoft's C compiler called Visual C is a little different:
// whateverthenameis.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
int main()
{
using namespace std;
cout << "Hello, World!" <<;
return 0;
}
Running this program results in the output:
Hello <error locating A Working Programme.exe>
Inheritance[edit | edit source]
A class can bequeath another class to acquire its possessions when it dies. This is achieved by the lastwillandtestament keyword. Each class can also have a nextofkin relationship to other classes, which defines the behaviour when a lastwillandtestament has not been defined. If neither lastwillandtestament nor nextofkin have been defined, then C=C 1 will nominate somebody at random or pseudorandom. This is taught to students using the "has-a-bug"/"is-a-bug" heuristic.
Class Incest[edit | edit source]
A revolutionary feature of C=C 1 is the ability for two related classes to mingle. The resulting subclass usually is disabled and does not know what it inherited from who and how to access it. It needs special assistance to do this on behalf of the caretaker programmer.
Take the following code example
#include <iostream>
namespace incest {
class Parent {
protected:
int allowance;
};
class Momma : public Parent {
public:
void set_allowance(int x) { allowance = x; }
};
class Daddy : public Parent {
public:
void get_allowance() { std::cout << allowance << std::endl; }
};
class Child : public Momma, public Daddy { };
} // namespace incest
// it is integral that we segregate the incest in its own namespace along with making limited use of the sexually transmitted namespace in order to protect the rest of the program!
int main() {
incest::Child c;
c.set_allowance(5);
c.get_allowance(); // 0 ?????1onequestionmark??
}
A possible solution would be to explicitly tell the child how to get his allowance.
class Child : public Momma, public Daddy {
public:
int get_allowance() { return Daddy::allowance Momma::allowance; }
};
Namespaces[edit | edit source]
A unique characteristic of C=C 1 is that it lets your friends handle your private parts. With the std or sexually transmitted disease namespace now in the language, it is essential to have your private parts protected during public orgies.
Module structure[edit | edit source]
Also known as the "LEO" - linker error ocean. Like Goldilocks trying to find the porridge with the best specific heat. This header structure is overlinked:
LNK431**** ERROR "simple1.h": ______stdcall mishmash(scone, scone) void static already defined in "simple2.h" - ERROR LNK431**** ERROR "simple1.h": ______stdcall mishmash(scone, scone) void static already defined in "starch.h" - ERROR FATAL ERROR: Consult KB eubadeprogramar.hlp
Ooh, this one is underlinked:
LNK431**** UNRESOLVED EXTERNAL SYMBOL "simple1.cpp": ______stdcall mishmash(scone, scone) void static: See definition in "blech.h" FATAL ERROR: You suck
This one is just right! (Actually it can't exist without some serious kung foo'Lua):
#if !defined(CRAMIT_H__7012E9AB_0584_4C2C_BEF9_8066666666DB1__INCLUDED_)
#define CRAMIT_H__7012E9AB_0584_4C2C_BEF9_8066666666DB1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#pragma vsj_smart_mode 1
#pragma never_again_or_ill_smack_you
#endif // _MSC_VER > 1000
#ifdef HEADER_KARATE
____________ext_linkage void mishmash(void* scone, DANGLING* scone);
___________ext_linkage void runtime_type_safety(CLOWN* pDamnit);
#else
#ifdef HEADER_DEFENDO
#pragma breakayospine
#include "crosscompile.mak"
#else
#define __SYSTEM
#endif
#endif
#undef DANGER_BOMB
#undef CRASH_COMPILER
#endif // !defined(CRAMIT_H__7012E9AB_0584_4C2C_BEF9_8066666666DB1__INCLUDED_)
This veritable preprocessor armor is needed to combat the swarming masses of black and white garbage in the output screen, which is by design.
Data hiding[edit | edit source]
Data is something you should be ashamed of. C=C 1 offers the dedicated obfuscationist a plethora of ways of hiding the location of any data. With just a little work, it will become impossible for anyone else to see what your program does, or how it does it, with its data. All this is encapsulated, which is highly encouraged.
Exceptions[edit | edit source]
We can't always make exceptions. Except this one.
The Future[edit | edit source]
As technology continues to grow faster than Rosie O'Donnell's weight, we can only stand around wondering about the future and Paris Hilton's club raid the other night. It's obvious that these silicon machines we call computers far surpass human acumen, and who knows when we will one day will have Logitech keyboards jammed up our own asses.
However, that is not the current problem at hand. The challenge now is to apply the lessons learned from C to other languages and problem domains. Work has already commenced on projects such as BASIC , Gibberish , and Uncyclopedia . Exciting results are eagerly anticipated.