News for hackers. Stuff that matters.
Re:“C is how the computer works” is a dangerous mindset for ... by shadowgovt on Wednesday April 01, 2020 @09:42AM (#22748395)
And for JavaScript, that space doesn't include buffer overruns or memory safety, unless you do something very exotic and implement your own indirected memory access in JavaScript (in which case, you've sort of dug your own grave). because undefined behavior literally means undefined behavior, C++ gets to bring to the table all of the failure modes JavaScript brings to the table in addition to the plethora of ways unchecked memory indirection can go wrong.

There are circumstances where you want the features C++ brings to solve a problem. But solving a problem with dynamite is still solving a problem with dynamite; there's a lot more ways it can go wrong than solving the problem with a steam drill, to torture an analogy a bit.

Re:“C is how the computer works” is a dangerous mindset for ... by adev_ on Wednesday April 01, 2020 @11:23AM (#22749599)
> But solving a problem with dynamite is still solving a problem with dynamite; there's a lot more ways it can go wrong than solving the problem with a steam drill, to torture an analogy a bit.

Excepted that a language is not absolute, is not dynamite or not dynamite. It is what you do of it depending of the subset you use. C++ is not exception.

Re:“C is how the computer works” is a dangerous mindset for ... by shadowgovt on Wednesday April 01, 2020 @01:21PM (#22751169)
Agreed. But I won't reach for a language that lets me treat all my program's working memory as an undifferentiated integer-addressable array of bytes if I don't need that to solve the problems I'm trying to solve.

... which goes back to the topic of the HN post; that's only one way to look at the state of a running program, and it's a way that has strengths and weaknesses. The utility of it comes at the cost of the program failing in ways programs in other languages structurally cannot fail (unless you do something truly exotic, like implement a subset of a C++ compiler or interpreter in that language).

Re:“C is how the computer works” is a dangerous mindset for ... by spopejoy on Thursday April 02, 2020 @01:03AM (#22756359)
C++ has always been the language that "has a safe subset to use but nobody can agree what that subset is".

JS is ... well, JS

This is at least for me the first time I've seen them discussed in the same breath, which is revolutionary: C++ the language bringing a blue screen to a desktop near you; JS the language bringing your startup to its knees.

I guess I never realized that while they are polar opposites, there are probably some subtle cultural similarities that would make for some hilarious unearthing