logoalt Hacker News

Capricorn2481yesterday at 3:55 PM2 repliesview on HN

> I would actually say overall C++ is much more reasonable.

This is where I know that, some people, are not actually programming in either of these languages, but just writing meme driven posts.

JS has a few footguns. Certainly not so many that it's difficult to keep in your head, and not nearly as complex as C++, which is a laughable statement.

You've "seen null make it to the database," but haven't seen the exact same thing in C++? Worse, seen a corrupted heap?


Replies

const_castyesterday at 6:07 PM

I haven't seen null make it to the database, I've seen undefined. And here you demonstrate one of many problems - there's multiple null types!

In C++, there's only one null, nullptr. But most types can never be null. This is actually one area where C++ was ahead of the competition. C# and Java are just now undoing their "everything is nullable" mistakes. JS has that same mistake, but twice.

It's not about complexity, although that matters too. C++ is certainly more complex, I agree, but that doesn't make it a more footgunny language. It's far too easy to make mistakes in JS and propagate them out. It's slightly harder to make mistakes in C++, if you can believe it. From my experience.

show 1 reply
hombre_fatalyesterday at 4:24 PM

Yeah, I don't know how someone can say that with a straight face to other engineers.

It's like people just talk in memes or something.

This is how a lot of discourse feels these days. People living in very different realities.

Though in this case, seeing the most complex C++ app they've built would illuminate what's going on in theirs.

show 1 reply