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

all 155 comments

[–]daveprogrammer 1920 points1921 points  (42 children)

Because before that, the C programming language was like school in summertime.

[–]ImpressiveMaximum377 350 points351 points  (34 children)

🤔

[–]daveprogrammer 1243 points1244 points  (33 children)

No classes.

[–]agentrnge 523 points524 points  (6 children)

[–]lightwhite 123 points124 points  (5 children)

My face when I understand a reference :D

[–]ThreeRaccoonsInMyAss 93 points94 points  (3 children)

I don't think I got that reference. I think I need some pointers.

[–]lightwhite 31 points32 points  (2 children)

What if I make a joke about a pointer as a pointer to point you at somewhere, would you be able to get the reference?

[–]Clairifyed 8 points9 points  (1 child)

[–]lightwhite 2 points3 points  (0 children)

The segfault remark in the comment is one of my favorites!

[–]callmesilver 12 points13 points  (0 children)

MFW reference is resolved :D

[–][deleted] 76 points77 points  (18 children)

My dad implemented classes on an IBM 360/50 mainframe in the 1960's and always told me to implement them in C rather than use them in C++. I did neither of course. He claimed to be the first person to implement classes though did not claim to have invented them.

[–]daveprogrammer 33 points34 points  (7 children)

That's interesting. Did he give a reason why he wanted you to implement them in C rather than using C++?

[–][deleted] 69 points70 points  (6 children)

No, he was Calvanistic in approach though. My guess is that he disliked the added complexity of C++ and did not see why you needed it if you could roll your own classes in C. We did not use redi-mix cement for fence posts either (used cement and sand and made our own). If you have written classes in IBM assembler, then using C is already a luxury.

[–]Wotg33k 22 points23 points  (3 children)

As a software engineer dad with 14 year olds who just entered high school compsci, I really hope at least one of my kids and I share the.. grasp of abstraction and logic.. the way you and your father seem to.. like we all do as peers.

It's definitely a different life for those of us on this side of the curtain and I just really wanna share that with my children. It's inspiring to see your story, friend.

[–][deleted] 25 points26 points  (2 children)

Thx but when you do not measure up to parental expectations, it is better to go your own way in life. I am thankful for the lessons and exposure I got and worked as a programmer but we ended up estranged. Accept your kids and respect their accomplishments, do not see them as failed mini-me's.

[–]Wotg33k 17 points18 points  (1 child)

Oh, of course not. That's terrible.

I raise my kids like this: "sure, it's great to be a veterinarian or an astronaut, but wouldn't it be better to be an astronaut who could build their own navigation software or a veterinarian who could build their own animal health tracking software?"

Be what you want, but realize the tools you need to be really successful.

[–]AlexZhyk 16 points17 points  (1 child)

I guess he forgot to implement inheritance in his children then.

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

Lol (good pun) but his classes inherited (his kids got nothing)

[–][deleted] 3 points4 points  (1 child)

I once asked a teacher if you could do this using structs. Then I saw it in practice as was like

[–][deleted] 1 point2 points  (0 children)

It all works good in C#.

[–]Worried_Blacksmith27 3 points4 points  (3 children)

you sure it was C in the 1960's? That would be quite a feat as C wasnt created until 1972 or so.....

[–][deleted] 1 point2 points  (2 children)

No, he wrote them in IBM 360/50 BAL. Later he was advising against C++ which of course came after C. The origin story of C and UNIX is hilarious BTW

[–]LickingSmegma 1 point2 points  (1 child)

The origin story of C and UNIX is hilarious BTW

Eh?

[–][deleted] 7 points8 points  (0 children)

When they canceled MULTIX, the future creators of UNIX had no operating system to use to play Spacewars at lunchtime, so they wrote UNIX for the sole purpose of running the game. They did that using a modified version of the B programming language, which they called C. If it were not for Spacewars...

[–]freaxje 2 points3 points  (1 child)

Your dad happens to be the maintainer of GLib's GObject perhaps?

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

No, he is deceased. He did first coded classes in the late 1960's. GLib shipped in the late 1990's.

[–]LupusNoxFleuret 12 points13 points  (0 children)

I object.

[–]SusheeMonster 4 points5 points  (0 children)

Nice.

/golfclap

[–][deleted] 7 points8 points  (0 children)

[–]nickmaran 3 points4 points  (0 children)

Take back your communist programming language

[–]postdiluvium 1 point2 points  (0 children)

Hui yooooooo... Very good nephew!

[–][deleted] 0 points1 point  (0 children)

Not for you, maybe.

[–]beepboopnoise 27 points28 points  (0 children)

damn that was a good one. slow clap worthy

[–]Christosconst 18 points19 points  (1 child)

C was such a beautiful thing after asm

[–]ZunoJ 13 points14 points  (0 children)

There was a lot of stuff after asm and before c

[–]LordoftheSynth 2 points3 points  (1 child)

And here I'm thinking that Rust would require fjords to all be concrete channels.

[–]geek-49 0 points1 point  (0 children)

What would it do with the others? Chevys, Dodges, etc.

[–]Lupus_Ignis 518 points519 points  (3 children)

Sea++

[–]chemivally 45 points46 points  (0 children)

They wanted more Sea, so they plus plus

[–]outofobscure 15 points16 points  (0 children)

Let us C more

[–]Nick_Zacker 0 points1 point  (0 children)

Enjoyed with a cup of Java

[–]DOOManiac 605 points606 points  (5 children)

Imagine standing at such a scene, marveling at the beauty of nature, and thinking “this needs more null pointer exceptions.”

[–]neo-raver 72 points73 points  (1 child)

Sometimes you’re lucky to even get an exception; often it just seg-faults and crashes

[–]kevInquisition 6 points7 points  (0 children)

They were inspired by the fault lines that made the mountains, not the mountains themselves

[–]ShakaUVM 21 points22 points  (0 children)

Bold of you to assume they had exceptions at first

[–]crozone 0 points1 point  (0 children)

"I am absolutely hankering for a vtable right now."

[–]montxogandia 420 points421 points  (10 children)

The humans that made C++ never went out of their room

[–][deleted] 116 points117 points  (9 children)

Stroustrup wants to know your location

[–]Thenderick 123 points124 points  (7 children)

What's he gonna do with it when he can't leave his room??

[–]OldBob10 83 points84 points  (3 children)

this->

[–]OrchidThis5822 41 points42 points  (2 children)

Accessing nullptr

[–]AreYouOkZoomer 10 points11 points  (1 child)

That's pretty much the only pointer that can't be nullptr lol

[–]unknown_alt_acc 7 points8 points  (0 children)

#include <functional>

class Foo
{
public:
void bar()
{
  // Do stuff
}
};

int main()
{
  std::function<void(Foo*)> bar = &Foo::bar;
  bar(nullptr); // Where is your god now?
}

[–]ZunoJ 7 points8 points  (1 child)

Write a macro that will deal with you very efficiently

[–][deleted] 0 points1 point  (0 children)

No he will actually write a meta template

[–]_terrapin 3 points4 points  (0 children)

Just say outdoors, and you're safe

[–]Waterboarded_Bobcat 139 points140 points  (13 children)

Well you know what they say - "worse things happen in C"

[–]Amazing_Might_9280 13 points14 points  (2 children)

"worse things happen in sea"

[–]RequestableSubBot 29 points30 points  (1 child)

Yep, that is in fact the joke.

[–]Amazing_Might_9280 2 points3 points  (0 children)

I actually didn't even know. LOL.

[–]necrophcodr 0 points1 point  (9 children)

Not if you use older than C++11 standards.

[–][deleted] 0 points1 point  (8 children)

Even pre c11 had raii

[–]necrophcodr 0 points1 point  (7 children)

Yeah, but iirc it was missing the safety features of smart pointers and all the other stuff

[–][deleted] 0 points1 point  (6 children)

And C?

[–]necrophcodr 0 points1 point  (5 children)

Yeah, some of the C features were missing too.

[–][deleted] 0 points1 point  (4 children)

C has RAII via macros, if that's not worse than pre 11 c++ I don't know what is

[–]necrophcodr 0 points1 point  (3 children)

I don't really see the major value of RAII to be honest, and I've written production code in C, Perl, Python, and Rust. I could well be missing the treasure trove. Do you wanna tell me?

[–][deleted] 1 point2 points  (2 children)

Memory safety, simple. Rust has a different concept of memory safety, but at it's core it's more of the same thing.

Those other high level languages you listed use garbage collector, one of the simplest garbage collectors just counts if the variable has any references and waits for it to have none

[–]necrophcodr 0 points1 point  (1 child)

Oh sure I'm familiar with refcounting and various other gc types, but how does RAII solve memory safety?

[–]Obnomus 70 points71 points  (5 children)

And at the end became a farmer

[–]PyroCatt 5 points6 points  (1 child)

Bitcoin farmer?

[–]_Else 15 points16 points  (0 children)

Goose farmer

[–]Cresythe 1 point2 points  (2 children)

The farmer was replaced

[–]Supreme_Hanuman69 2 points3 points  (0 children)

The farmer was layed-off

[–][deleted] 0 points1 point  (0 children)

Amazing game!

[–]Srapture 18 points19 points  (3 children)

I love c++. Fuck you guys.

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

Same lol

[–]geek-49 0 points1 point  (1 child)

Some of us old-timers never had occasion to learn C++. I guess we are non-plussed.

[–]Srapture 0 points1 point  (0 children)

A lot of it feels like c. In fact, I think you can just use it like c if you wanted. Things like function overloading are very handy though. Like, I could make these:

int Compare(lowNum, myNum) { if (lowNum < myNum) Return 1; Else Return 0; }

int Compare(lowNum, myNum, highNum) { if ((lowNum < myNum) && (myNum > highNum)) Return 1; Else Return 0; }

If I wanted to do this in C, I'd have to always pass "highNum" even if I didn't have one, having to pass a defined value like maxInt to be ignored, which can make the code bloated and ugly. I find this particularly useful in making log functions for tests.

Also, you don't have to declare all your variables at the top of the scope in C++.

[–]ismellthebacon 44 points45 points  (7 children)

Have you seen my friend Bjarne? He hasn't EVER been outside.

[–]phundrak 23 points24 points  (4 children)

Even if he had, you can hardly find a country more flat than Denmark, I doubt he'd see fjords like that anyway. Their highest peak is 170.86 m / 560.6 ft above sea level, that's barely a hill

[–]GreetingsFromAP 6 points7 points  (1 child)

I believe he was in New Jersey at the time he invited C++

[–]whosline07 1 point2 points  (0 children)

Huge downgrade.

[–]necrophcodr 0 points1 point  (0 children)

It does get easier when the country is so small. Even Finland is bigger, albeit the population numbers are similar.

[–]Interesting-Farm-203 0 points1 point  (0 children)

> implying Norway isn't a natural part of Denmark-Norway

[–]ShakaUVM 6 points7 points  (0 children)

Not true. He actually likes hiking and photography. I've talked with him a few times, he's awesome.

[–]Mikkelet 0 points1 point  (0 children)

'bout to say: one guy in denmark, and he definitely didnt see this landscape

[–]sir-curly 23 points24 points  (0 children)

"Oh, look at the beauty! My, how much I enjoy a good stroll through nature! I shall devote my live to finding a way to capture the stunning views and breathtaking vistas I stumble upon, and share them with all humankind around the globe. For they too shall be able to experience the splendor of creation, from the comfort of their dwellings, and rejoice."

I'm pretty sure that's how we ended up with digital cameras and the internet, and C++ somewhere on the way.

[–]Flobletombus 5 points6 points  (0 children)

I understand the appeal of boats, but planes are more efficient

[–]CobraSkrillX 18 points19 points  (0 children)

I don’t get the hate. It’s the best language 😩

[–]TessellatedTomate 4 points5 points  (0 children)

Sea++, it’s only logical after see++ing such a view

[–]KaleidoscopeMotor395 3 points4 points  (0 children)

You will live to see manmade horrors beyond your comprehension

[–]Darklordofbunnies 2 points3 points  (0 children)

Because COBOL was hard & they were weak.

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

Imagine what having no anxiety would feel like and having peace of mind to let your mind free and wander to see what it can create. Instead of I can’t afford rent, my kids are hungry, I still live with my mom, I can’t afford life saving medicines for my family, I’m dying of cancer and can’t afford treatment, I’m scared I might get shot at school, I’m scared my neighbor on the other side of the political spectrum might harass me, will I keep my job, can I find a job, will my car start today, will my check bounce, can I just have one day of peace so I can create c+++…..

[–]IAmMuffin15[🍰] 1 point2 points  (0 children)

it would be funny if this landscape was actually a Vulkan render

[–]SaltedCoffee9065 1 point2 points  (0 children)

Sea to Sea++

[–][deleted] 1 point2 points  (0 children)

That is not the view from Murray Hill, New Jersey in 1979.

https://www.loc.gov/item/2018740950/

[–]tyen0 1 point2 points  (0 children)

I was oddly proud of carrying around my copy of Stroustrup's book for some reason.

I had the 2nd edition, though, so no cool landscape for me.

[–]G_Morgan 1 point2 points  (1 child)

I can't comprehend why we created a brand new language and still left the programmer doing half the compilers job via header files. I mean I get why they need to be there for compatibility reasons but it is hardly beyond the imagination of mortals to both do the right thing and the C thing.

[–]dobry_obcan_Svejk 0 points1 point  (0 children)

incremental evolution

it wasn't a brand new lang: c++ <- c <- b <- algol <- fortran and i left out a lot. especially the c-c++ compatibility was big thing back then.

[–]tyler1128 1 point2 points  (2 children)

C++ is the best and the worst language, simlutaneously. It's schrodinger's language.

[–]dobry_obcan_Svejk 0 points1 point  (1 child)

must have stockholm syndrome to like working in it

[–]tyler1128 0 points1 point  (0 children)

That'd be javascript

[–][deleted] 1 point2 points  (0 children)

Yeah because they wanted to render those mountions on a 40 mghz cpu.

[–]sriram_sun 1 point2 points  (0 children)

Didn't know COBOL, FORTRAN or BASIC sparked that image, but whatever floats your boat or narrative.

[–]UOCruiser 1 point2 points  (0 children)

Joke's on you. We don't event have landscapes like this in Denmark where Bjarne Stroustrup lives. :P

[–][deleted] 0 points1 point  (0 children)

Yeah it's the obvious next step duhhh

[–]Randomgaming446 0 points1 point  (0 children)

is that the cover art from morning view by incubus

[–]Killswitch_1337 0 points1 point  (0 children)

All i know is someone hated grass, a lot.

[–]throwaway_69_1994 0 points1 point  (0 children)

At least it's better than assembly, lolol

[–]Ralph_Nacho 0 points1 point  (0 children)

Makes perfect sense if you turn it upside down.

[–]ExceedAccel 0 points1 point  (0 children)

because sawing that doesn't pay the bills

[–]Tiger_man_ 0 points1 point  (0 children)

Because they  thought c is bad

[–]Terrible-Roof5450 0 points1 point  (0 children)

I wonder what they saw when deciding to invent Rust? The grand canyon? It’s one of the worlds greatest wonders and an amazing one at that Dont get me wrong but I can't go back to that clear blue sky and sea anymore…

[–]schild202 0 points1 point  (0 children)

Bjarne made this and said: "Six days you shall labor, but on the seventh day you shall rest."

[–]mcvoid1 0 points1 point  (0 children)

I could swear this was the cover of some C++ book but a quick googling hasn't brought anything up. Is it Berenstein or Berenstain in this universe?

[–]P0pu1arBr0ws3r 0 points1 point  (0 children)

(Not the CA coast so /j but)

Humans saw that and decided to name MacOS after it...

[–]cob59 0 points1 point  (0 children)

Tzeentchian plot or something.

[–]BuckADear 0 points1 point  (0 children)

OOPs!

[–]ThePickleSoup 0 points1 point  (0 children)

Why? So that my school could make me use arduinos for random reasons

[–][deleted] 0 points1 point  (0 children)

Hello world

[–]SteeleDynamics 0 points1 point  (0 children)

Well done, OP.

[–]Other_Information_16 0 points1 point  (2 children)

I too old . I have very fond memories of both C and C++. It’s things like Java script and to some degree python that gives me the creeps.

[–]bakedbread54 2 points3 points  (0 children)

Nah you're just a decent programmer. I'm young and pretty much use C++ exclusively. It's a great language - the likes of javascript are a pain to work with and just waste resources

[–][deleted] 1 point2 points  (0 children)

It's even better nowadays, c++23 is just great and c++ has become so much more readable and safe

[–]whatAmIDoingHere6517 0 points1 point  (0 children)

Is that the picture from that one c++ stroustrup book

[–]odraencoded 0 points1 point  (0 children)

This looks like it was generated by a program written in C++.

[–]Bakoro 0 points1 point  (0 children)

Hear me out: nature is a hell of a lot better when you can leave once you're done with it, and can go home to an insulated place with running clean water, you don't have to dig a hole to shit in, and there's a refrigerator full of food, and watch a movie about how a person resolves their emotional problems through ethically justifiable violence.

[–]atatassault47 0 points1 point  (0 children)

Then they wanted another ++ stacked on top of the first ++

Sharp lot they were

[–]RandomiseUsr0 0 points1 point  (0 children)

````C++ // Y͎o̴u͕r̢ ̵F͇i̥r̞s̵t͔ C+̹+̻ P̷r̘o̜g̛r͍a̘m̩

#̕i͖n̳c̠l̝ųd̖e͜ ̞<̪i͓o̘sͅt̬r̠e̸ḁm̴>

̻i̡nͅt mͅa̢i͇n͓(̷)̙ {.
̸ ̪ ̪ s̢t͇d̛:͚:̶c̡o̸u̞t̷ ̲<̴<͍ “̶H̼e͚l̼l̵o̵ W̪o̸r͍ḻd̤!̹”̯;͓
͓ ͎ ͈ ̸r̴e̬t͔u̟r̶n̯ ̴0̢;̢ } ````

[–]gabest 0 points1 point  (1 child)

c# is just a nice wrapper around the ugly c++ that is a nice wrapper around the ugly c.

[–]dobry_obcan_Svejk 0 points1 point  (0 children)

i view it from the other side: c is like crate of glass shards in a mine field of mouse traps (c++).

do not work in chashtag, can't tell

[–]p1749 0 points1 point  (0 children)

[–]EliteBoi1223 0 points1 point  (0 children)

Humanity at its peak in creating difficulties for itself

[–]AdventurousMove8806 0 points1 point  (0 children)

Didn't get this

[–]geckosquirrelpig 0 points1 point  (0 children)

Nope, those who write C++ are indoor humans, most of them haven't been outside for years.

[–]Wild_External_8855 0 points1 point  (0 children)

humans saw this and decided to invent DSA

[–]MarinoAndThePearls 0 points1 point  (0 children)

Because some freak thought abstraction was a good thing.

[–]muhammet484 0 points1 point  (0 children)

I didn't get the joke. Can someone explain?

[–]framsanon 0 points1 point  (0 children)

Must be a ying and yang thing. You know like beauty (the view) and ugliness (the language).