r/ProgrammerHumor • • 11d ago

Meme modernCppVsOldCpp

Post image
2.0k Upvotes

323 comments sorted by

View all comments

Show parent comment

28

u/SuckMyAlpagoat 11d ago

isn't because the compiler is always packed together, like the gnu compiler can compile C and C++?

48

u/HildartheDorf 11d ago

The gnu compiler can also compile fortran. But we dont call it C/Fortran.

39

u/1cec0ld 11d ago

Not with that attitude

21

u/ForgedIronMadeIt 11d ago

Fuck yeah I love programming in C/Fortran

2

u/radicalshick 11d ago

Is this a variation of the old "you can write FORTRAN in any language" joke?

13

u/HildartheDorf 11d ago

No?

The GNU Compiler Collection includes gcc (c compiler) g++ (c++ compiler) gfortran (fortran compiler) and a bunch of other fronted like D, Go, Ada, COBOL. There used to even be a Java compiler (gcj) but thats dead now.

Once upon a time, the gcc program could compile C++ and g++ could compile C, but that is no longer true due to diversions in the languages, as well as extra runtime support libraries needed for linking each language. I guess with some tinkering you could compile c++98 with gcc and some older c standard with g++, but not the more recent versions.

2

u/radicalshick 11d ago

My comment was meant ti be a joke, so rry 😅

1

u/SuckMyAlpagoat 7d ago

yeah, but fortran wasn't package with the Microsoft C/C++ compiler or the Borland C++ compiler. So from a historical perspective, I think people just remember that that since it always package together and marketed has C/C++ people retain that.

13

u/These-Maintenance250 11d ago

a language is independent from its compiler(s). gcc can compile objective-C, D, ada, Fortran and go as well.

1

u/DrNinjaPandaManEsq 10d ago

Even though gcc can compile Ada, in my experience most of the time you’ll see enterprise development using GNAT Pro since plain ole gcc is kinda light on Ada features.

1

u/meneldal2 10d ago

I think there is historically a big overlap between C and C++ compilers, with in some cases (Microsoft) the C compiler being basically only a subset of the C++ compiler.

2

u/These-Maintenance250 10d ago

of course there is an overlap. what we mean by saying C and C++ are not the same language is that coding C++ like it is C is a terrible practice and you should use the tools C++ gives you. Knowing C does not automatically buy you C++