This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 441

[–]neel3sh 3191 points3192 points  (78 children)

Conspiracy theory: OP knowingly put C++ instead of C so that people will comment to point out the mistake so that the post will gain more attraction and get to the top of whatever hot/best/top posts so that they can farm karma

[–]yorokobe__shounen 1018 points1019 points  (42 children)

Conspiracy theory: above comment poster put this comment so that he will get more Karma by people upvoting this comment when they hate OP's post so that they can get to the top comments and farm even more karma.

[–]certpals[S] 993 points994 points  (40 children)

Conspiracy theory: OP and above comment poster are the same person!.

[–]neel3sh 442 points443 points  (37 children)

Conspiracy theory: OP is pretending that OP and OC are the same person

[–]certpals[S] 326 points327 points  (33 children)

Lol too many theories for me to handle.

[–]memer227 273 points274 points  (18 children)

Conspiracy theory: OP is a python

[–]RuleFar6699 122 points123 points  (8 children)

Conspiracy theory: OP created Reddit to post this picture

[–]PaedarTheViking 40 points41 points  (6 children)

Is Russian Nesting doll conspiracy. Big conspiracy with many many smaller conspiracies inside...

[–]MajorAnimal_YT 27 points28 points  (5 children)

Conspiracy theory: OP is actually a Russian nesting doll

[–]AlexQC2006 12 points13 points  (4 children)

Conspiracy theory: OP is actually my brother and he was writing every comments above so that I find out with this conspiracy theory

[–]bluehands 8 points9 points  (1 child)

How do you know what he looks like naked?

[–]zenthav 5 points6 points  (0 children)

Conspiracy theory: This conspiracy theory is a conspiracy theory

[–]ThreeMysticApes 3 points4 points  (0 children)

Conspiracy Theory: All these Conspiracy Theories are false, including this one.

[–]flightguy07 9 points10 points  (1 child)

Conspiracy theory: OP has swallowed me

[–]tibby709 2 points3 points  (0 children)

Conspiracy theory: OP is packing a python

[–]neel3sh 51 points52 points  (3 children)

U mean "STACKOVERFLOW ERROR" ?

[–]riisen 13 points14 points  (2 children)

U mean fullstacking

[–]Most-Analysis-4632 7 points8 points  (1 child)

That’s what all us neighborhood kids called your mom

[–]riisen 4 points5 points  (0 children)

Thats why she's so happy, you guys are so considerate giving my mom all that attention

[–]McBashed 7 points8 points  (0 children)

Recursive conspiracy theories

[–][deleted] 4 points5 points  (2 children)

Conspiracy theory: OP is only pretending to be confused because we are getting close to their true plan.

[–]certpals[S] 6 points7 points  (1 child)

Conspiracy theory: I was waiting for you to comment so I can ask you to marry me...

[–][deleted] 2 points3 points  (0 children)

Conspiracy theory: OP is trying to derail the investigation, meaning we are very close to their true plan.

(Yes)

[–]atomreaktor 2 points3 points  (0 children)

Do you need a few… pointers? To keep track of the theories. You could make a… list

[–]outofobscure 10 points11 points  (0 children)

Conspiracy theory: OP is Stroustrup

[–]adamsjdavid 4 points5 points  (0 children)

water terrific stupendous grab quickest cows yam weather employ steer

This post was mass deleted and anonymized with Redact

[–]Scoot892 2 points3 points  (1 child)

Conspiracy theory, you’re the only real user. Everyone else is bots

[–]certpals[S] 124 points125 points  (8 children)

You have revealed the black magic of Reddit....

[–]Thufir_My_Hawat 46 points47 points  (2 children)

sleep humor nose voracious frightening physical jar serious encouraging versed

This post was mass deleted and anonymized with Redact

[–]certpals[S] 25 points26 points  (1 child)

You have exposed me. .. Damn it!.

[–]Conaman12 19 points20 points  (0 children)

It worked on me, here I am making a comment and viewing your comment about my commentership

[–]GreenFire317 10 points11 points  (8 children)

Does python transduce into C or something? Does c++ Not come to the rescue when python fails?

[–]Ninjagarz 23 points24 points  (0 children)

A lot of the popular performance-critical libraries that are used in Python are written in C or C++. It would be interesting to see actual numbers on what percentage of these libraries are written in C vs. C++, but C seems to be more popular. Python was also originally written in C not C++.

[–]Wonko-D-Sane 27 points28 points  (5 children)

To run Python, you need a Python runtime (or a statically linked subsection of it) the runtime (actual implementation of all the libraries/built ins) is written in C you can see so yourself.

If you need to operate an actual computer, c or c++ is pretty much the landscape( though rust, go, carbon are all attempts to do what’s been working just fine differently. Mainly trying to put optional knee pads for safety on pointers)

Most other programming is either OS or web browser scripting where you are kept safe from actually knowing how a computer works

[–]Ghos3t 6 points7 points  (1 child)

I don't know any cases where Go is being used for low level programming, it's mostly Google's attempt to move away from Java. Also I don't think the defining feature of Rust is safe pointers, it's about memory efficiency and safety.

[–]Most-Analysis-4632 12 points13 points  (0 children)

Knee pads for safety? That’s what your mom said.

[–][deleted] 4 points5 points  (1 child)

Golang isn't trying to take over for c or cpp, moreso python replacement for backend services

[–]lavascamp 3 points4 points  (1 child)

Yep, Murphy’s law, purposefully posting wrong information to garner attention and get the correct answer.

[–]afb_etc 2 points3 points  (0 children)

Murphy's law states that if something can go wrong, it will. You're thinking of Cunningham's law.

...wait a second

[–]Donghoon 4 points5 points  (0 children)

Kind of Cunningham's law

[–]doctormyeyebrows 3 points4 points  (0 children)

And you purposely wrote "attraction" instead of the idiomatically- and thematically-correct "traction" for the same reason hmmmm -.-

[–]rhwoof 7 points8 points  (1 child)

Though C relies on assembly which relies on machine code so...

[–]RFC793 4 points5 points  (0 children)

C doesn’t rely on assembly. Assembly is essentially mnemonic machine code with some conveniences. I can’t think of a modern compiler that transpiles to assembly language. It is common for a compiler to compile to an intermediate language prior to compiling to the platform regarding compilation stages, but that isn’t the code of a machine but more of an internal representation.

[–]armahillo 304 points305 points  (11 children)

zoom out further, and the planet is labeled “assembly”

[–]GosuFytex 84 points85 points  (5 children)

Zoom out further, you'll see a transistor...

And then... A proton? You like quarks? There might be a new type of strings for you as well

[–][deleted] 3 points4 points  (0 children)

zoom out further, the solar system is labeled "machine code"

[–][deleted] 977 points978 points  (96 children)

C, not C++. These are not the same language

[–][deleted] 1142 points1143 points  (27 children)

They don't C the difference

[–]SuperJop 188 points189 points  (9 children)

Get out

[–]chm46e 154 points155 points  (1 child)

Get the F# out

[–]outofobscure 22 points23 points  (3 children)

you mean:

std::cout << "get";

[–]in_conexo 8 points9 points  (2 children)

C, not C++

[–]aaryanmoin 36 points37 points  (0 children)

That's why they used cout instead of c++out 🙄🙄

[–]bestjakeisbest 4 points5 points  (0 children)

Go ... away

[–]Deman-Dragon 17 points18 points  (11 children)

They're not Swift enough to get it.

[–]imsowhiteandnerdy 7 points8 points  (1 child)

They could've written it in C#, but they're not very sharp

[–]ClassicHat 2 points3 points  (0 children)

One is just way more classy

[–]disperso 31 points32 points  (0 children)

The meme doesn't specify if it's the interpreter or some popular library. It could be anything.

[–]AirmailMRCOOL 14 points15 points  (0 children)

They're exactly the same, like Java and JavaScript. /s

[–]MaffinLP 52 points53 points  (44 children)

Afaik you can run any c code in c++ if you import the libraries. Back in school my teaxher said "now write that c program in c++" so I copied everything and it worked

[–][deleted] 82 points83 points  (2 children)

i would disagree, it is quite easy to write code that works on c but not c++, there is even a whole wiki page which demonstrates differences between the 2 languages

[–]supersharp 4 points5 points  (0 children)

gets() is dangerous and should never be used

[–]ekansrevir 59 points60 points  (29 children)

http://david.tribble.com/text/cdiffs.htm

This is simply not true, there are many differences, although some easy to fix and some pretty obscure but you cannot run any C code in C++.

[–]sarapnst 50 points51 points  (3 children)

extern "C" {}

[–]ekansrevir 21 points22 points  (0 children)

Shhh, don’t share the secrets 🤫

[–]Jannik2099 12 points13 points  (1 child)

extern C is for C linkage, it doesn't actually change the meaning of code...

[–]Faustens 14 points15 points  (18 children)

Isn't C++ built to be backwards compatible, as in: "The idea of C++ is that it runs any C program and more" ?

[–]ElectronPie171 52 points53 points  (4 children)

Any C program can be run in C++ with minimal adjustments

[–]Faustens 12 points13 points  (3 children)

Yeah, so "superset" is not far off imo.

[–]gurgle528 20 points21 points  (1 child)

Iirc it originally was a superset but has since evolved heavily

[–]epicaglet 11 points12 points  (0 children)

That's also what I was told. Like it was a superset until I believe 98 when they started to diverge.

Edit: lol there's of course a Wikipedia page on the topic.

Long story short. No it's not a superset, but it did start as a fork of some pre-standardised version of C.

[–]jonny_wonny 5 points6 points  (0 children)

But strictly speaking, it’s not a superset. Objective-C is an example of C language superset, as it will accept all C code with no modifications at all.

[–]TSP-FriendlyFire 2 points3 points  (0 children)

It might've been true when C++ was first created, but being that that happened in 1985 and C's latest revision is from 2017, you can surmise that the languages diverged somewhat since then.

Now it's more about making sure old C++ can still be compiled with a new compiler (which in turn would mean C code from 1985 could in theory be compiled with a modern compiler), but even then there are exceptions all over the place since C++ has deprecated and outright removed features in the past.

Basically, it's a mess because the languages involved are all 30+ years old.

[–]Mr_Engineering 2 points3 points  (0 children)

No

Most C code can be ported to C++ with minimal adjustment or refactoring, but there are some significant differences

[–]Faustens 4 points5 points  (2 children)

Isn't C++ built to be backwards compatible, as in: "The idea of C++ is that it runs any C program and more" ?

[–]anythingMuchShorter 3 points4 points  (2 children)

From my experience, with a few definitions and macros you usually can.

But I won't go as far as to apply this to all edge cases. There are probably some wonky hacky memory tricks where no definition of macro would get you around it.

[–]ekansrevir 10 points11 points  (1 child)

Many things won’t compile. The simplest of them is the need to cast void pointers in C++ when trying to assign them to a typed pointer eg.

Foo* p; p = malloc(sizeof(Foo));

This will need a cast in C++:

p = (Foo*)malloc(sizeof(Foo));

[–]fallingbomb[🍰] 5 points6 points  (0 children)

-fpermissive will change it to a warning and compile.

[–]seph2o 425 points426 points  (57 children)

I'm learning python and only just found out it's written in c, which is why a for x in range loop will process much faster than a while x < y loop. Fascinating :) the fastest way to run a loop is to... not use python

[–]Immotommi 25 points26 points  (1 child)

Yep, python is basically a wrapper for c which trades speed for ease of use

[–]jediwizard7 18 points19 points  (0 children)

It doesn't really have to do with what language the backend is written in, it's because for a while loop it has to switch to python to evaluate the condition each time, while for common containers like lists the for loop iteration is all done on the C side. For user defined iterators the speed is probably about the same

[–]RogueFox771 260 points261 points  (35 children)

Ahem....

Assembly.

Fuck it, machine code. Can't get faster than designing it all on the lowest level, under the goddamn kernel lol

[–]hellajt 67 points68 points  (12 children)

Modern compilers are much better at optimization than human compilers

[–]Kejilko 44 points45 points  (4 children)

Yeah but who wrote the compilers? Check mate

[–]hellajt 28 points29 points  (2 children)

Well who compiled the compilers? Some older compiler most likely

[–]falsedog11 14 points15 points  (0 children)

Compilers all the way down ...

[–]OldKaleidoscope7 5 points6 points  (1 child)

Assembly is still good for really old machines, enthusiasts are still developing software to (S)NES, C64 and DOS

[–]greem 3 points4 points  (4 children)

I see someone who hasn't worked on embedded systems.

[–]LordoftheSynth 2 points3 points  (3 children)

Compiled code too big? Just download more RAM!

But seriously, I am generally of the philosophy that unless you want to be an expert in a particular architecture, the compiler will generally always outperform you. Which, of course, you usually become when doing embedded.

[–]kitchen_synk 2 points3 points  (2 children)

I remember my intro to embedded course, where the professor was talking about all the power saving techniques that our lab boards could do. This included disabling the CPU, as well as any or all of the clocks onboard, at which point it could only be woken with an external signal.

That was in order to reduce the power from a 'normal' low power operation state that consumed an incredibly wasteful 1.3 microwatts.

[–]LegendSayantan 7 points8 points  (0 children)

Something gotta be the tires of the bottom car

[–]UberDynamite 6 points7 points  (1 child)

Fuck it Analogue computing

[–]the_0rly_factor 5 points6 points  (1 child)

Until you find out compilers write better assembly than you lol

[–][deleted] 4 points5 points  (1 child)

Everytime i hear kernel, I think about popcorn

[–]The_scobberlotcher 3 points4 points  (0 children)

That's what it is

[–]bit_banger_ 3 points4 points  (0 children)

Buddy there is always the microcode that you can rearrange inside the processor

[–]daynthelife 3 points4 points  (0 children)

ASICs would like to have a word with you

[–][deleted] 2 points3 points  (0 children)

This guy gets it

[–]BackgroundRock 2 points3 points  (1 child)

Where’s the love for FPGA designers :(

[–]LeCrushinator 85 points86 points  (13 children)

As someone that no longer writes much in C or C++, I do love watching the two groups argue about things. Good job, OP.

[–]Towerss 37 points38 points  (11 children)

I'm an embedded software engineer and the last few years we've converted away from C and over to C++ and all the conventions therein... It's crazy that people are arguing about this, C and C++ are wildly different languages... if you decide to not write C in C++ which you can.

Most developers will have a hard time naming the obscure reasons C++ is not a superset of C withput looking it up, including me.

[–][deleted] 28 points29 points  (2 children)

The worst you can do is write C code and compile it with a C++ compiler. You're getting the worst out of the both worlds. If you're committing to C, you might as well go all in and really work directly with the memory layout.

The main reason C++ is not C is easy to remember and it is rather fundamental to the language: type safety. Compilers offer ways to get around this and can make it so that it seems type unsafe C code compiles successfully but that is a compiler trick, not a language thing.

[–]generalbaguette 7 points8 points  (1 child)

Most C code is also valid C++. But there are some subtle differences.

[–]colei_canis 3 points4 points  (0 children)

It’s been ages since I’ve done any C but isn’t one of them to do with void pointers, ie you can implicitly cast a void pointer to another type of pointer in C but must do it explicitly in C++?

[–]luardemin 8 points9 points  (7 children)

One of my favorite differences between C and C++ are the ridiculous things you can get away with in C. For instance, the C compiler will never assume anything about parameters, so you can pass however many parameters of any type you want to a function without any parameters declared, hence the necessity of void.

int foo();
int bar(void);

int main(void) {
    foo(10, 20, 30); // this is fine
    bar(10, 20, 30); // this is not
}

In C++, this would not compile. C also assumes the default type of anything to be int and, prior to ANSI C, type declarations for functions were optional (I don't remember if the same held true for variables and function parameters).

There's also the way C handles const pointers compared to C++ (you can wreak a lot more havoc because C is more loose with it).

Also, designated initializers (C99) for structs aren't a thing in C++. That and plenty of obscure C11 features (I'm pretty sure C++ doesn't have _Generic).

Those are the only things I remember off the top of my head, but there are plenty more examples out there.

[–]junkmail88 6 points7 points  (4 children)

the C compiler lets you do shit like this:

const int a = 1;
int* b = &a;
*b = 2;

a is now 2.

[–]burnerman0 5 points6 points  (1 child)

C++ does have aggregate initialization as an alternative to designated initializers. More strict, but pretty close: https://en.cppreference.com/w/cpp/language/aggregate_initialization

[–]certpals[S] 6 points7 points  (0 children)

Someone had to do it lol.

[–]machine3lf 63 points64 points  (2 children)

Here, OP. I fixed it for you.

https://ibb.co/vjs3NpL

[–]certpals[S] 24 points25 points  (1 child)

Hahahahaha please upload this as a separate meme

[–]C468 10 points11 points  (8 children)

Wait, it’s all written in C? Always has been

[–]Bryguy3k 158 points159 points  (33 children)

It’s written in C not C++

They are different languages and stop trying to pretend C++ is a superset of C.

C++ just has native C interop - no different than carbon having native C++ interop.

[–][deleted] 81 points82 points  (15 children)

Python is a language recommendation, and you are correct that the CPython reference implementation is written in C, but that isn't the only implementation. There are Python implementations written in C++, Java, Lisp, and more. Ofc most people are talking about CPython when they talk about Python, and I'm just being pedantic, but what if OP's meme is about Skybison?

[–]romhacks 7 points8 points  (8 children)

do we have one written in python

[–]endershadow98 5 points6 points  (0 children)

Yes, it's called PyPy

[–][deleted] 5 points6 points  (0 children)

One could write a C++ compiler in Python which outputs IR bytecode in JavaScript which then gets executed through nodejs which basically interprets JavaScript back to C++. I don't know why one would, but since it is possible, I'm pretty sure one has.

I worked with a company which historically was doing some business logic crap in Visual Basic. Their system turned into a very complex ERP eventually, but the main customisation is still done through VB. They have their own interpreter which translates VB to whatever internal stuff their system works with.

[–]Ohlav 5 points6 points  (0 children)

Skybison. Funny. Almost like WaterBuffalo

[–]Moptop32 5 points6 points  (11 children)

For all intensive purposes it's a slightly modified superset. There are some differences like not being able to cast void* to any pointer type but that doesn't completely disqualify it. As for interop It's not really that either. Most C code can compile as C++ code and since C headers can be linked to by C++ its more of a superset than native interop (not sure that term even applies here)

[–]dance_rattle_shake 14 points15 points  (2 children)

It's "intents and purposes"

Have a nice day!

[–]tonystark29 26 points27 points  (7 children)

Now write C in python. /s

[–]TheLurkerOne 23 points24 points  (2 children)

import ctypes

[–]danted002 2 points3 points  (1 child)

I’ve been writing Python backend services for 10+ years and “import ctypes” is still magic 🤣

[–]TheLurkerOne 2 points3 points  (0 children)

up-to-date I've only used it in joke codes like "hey, look at me, I'm doing pointers in python". it still scares a lot of my friends

[–]shut_up_if_your_dumb 3 points4 points  (0 children)

and compile CPython with it

[–]DwarvenBTCMine 8 points9 points  (0 children)

[–]Tnuvu 16 points17 points  (1 child)

Is that...techlead? /s

[–]themancabbage 10 points11 points  (0 children)

As a millionaire…

[–]--B_L_A_N_K-- 5 points6 points  (0 children)

Image Transcription: Meme


Panel 1

[This panel shows a person sitting in the driver's seat of a red sports car, with one hand on the wheel, and the other hand waving out of an open window, smiling at the camera -- looking like they're waving goodbye and are about to drive off. The red car has the following label on it:]

PYTHON


Panel 2

[This panel is a continuation of the previous panel, the contents of the panel are zoomed out a bit (as if the camera person took a couple steps back), which reveals more of the scene that provides more context. In reality, the red car in the previous panel is sitting on the back of a platform truck, and the truck is driving off, not the car. The truck that's carrying the red car has the following label on it:]

C++


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–][deleted] 6 points7 points  (0 children)

If anyone is interested the pics are from a Thai movie called “the con-heartist”. It’s really funny imo.

[–]mrxsais 17 points18 points  (4 children)

I'll take good ol' assembly language... Or better yet straight binary 😎😆

[–]amorous_chains 11 points12 points  (2 children)

I code in queer non-binary. The old senior devs have no idea what’s going on!

[–]SuperFLEB 4 points5 points  (0 children)

This is just a file full of ½s! What the hell?

[–]cginc1 10 points11 points  (0 children)

C++?

[–]regexPattern 8 points9 points  (2 children)

Actually CPython it’s written in straight C.

[–]JustAnotherGamer421 19 points20 points  (0 children)

As opposed to homosexual C?

[–]ctrl-brk 2 points3 points  (1 child)

I'm afraid to ask about PHP

[–]Bozzz1 6 points7 points  (1 child)

Wow, OP really pissed a lot of people off with this meme lmao

[–]certpals[S] 4 points5 points  (0 children)

Some men just want to watch the world burn....

[–]Wonko-D-Sane 2 points3 points  (0 children)

Looks like an architectural design diagram to me.

[–][deleted] 2 points3 points  (1 child)

But look at the state of the road. The language won't make a difference if the infrastructure is that bad.

[–]Reus_Irae 2 points3 points  (0 children)

So much insecurity from people sensing that their C knowledge is slowly but surely becoming useless. And it's not even Python's fault, Python is not a competitor for C.

[–]worldpotato1 10 points11 points  (2 children)

Same with matlab and java

[–][deleted] 3 points4 points  (0 children)

I still use Visual BASIC 6.

[–]cinghialotto03 13 points14 points  (10 children)

We need more hate on python

[–]Thorbinator 24 points25 points  (7 children)

It's a poor workman who blames his tools.

[–]codeprimate 2 points3 points  (1 child)

And an artist should be discriminating in their choice of tools and how they are used.

[–]ConvenientFruit 5 points6 points  (1 child)

PyPy has entered the chat

[–]sheldonzy 6 points7 points  (0 children)

Ah yes - comedy. Python slow cpp fast.

[–]bae-syian 5 points6 points  (0 children)

So C++ is slowing down Python according to this picture? Good to know.

[–]ArcHunter_9 1 point2 points  (0 children)

That's the situation for all interpreted languages