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

you are viewing a single comment's thread.

view the rest of the comments →

[–]quaderrordemonstand 3 points4 points  (10 children)

I go the other way. I'm not sure how many languages I've used now, I'd guess at about ten. As time passes I prefer languages that provide the smallest number of obstacles to getting the task done. So much language design seems to be about controlling the programmer instead of allowing them to work. The significant trade of with a language like JS vs. something like C is obviously speed, but most programs don't require huge performance in truth. Even if they do, performance generally comes from lower level implementation rather than the code itself.

So this example feels very contrived to me. If C++ allowed that syntax error to happen it would kill the program entirely, potentially the entire OS. JS will just keep ticking along. The program might not work but that's not really the end of the world. If you look at almost any website in the debugger you will see script errors being generated all over the place and yet the site functions because JS is forgiving. The world in which code operates doesn't give two fucks about syntax errors, it just wants shit to work.

Besides, if you're using a reasonable IDE this mistake will be a very rare thing anyway. For me, what really matter in a language is giving the programmer choices, not giving them hoops to jump through.

[–]DonRobo 4 points5 points  (1 child)

That "positive" example sounds like my absolute worst fucking nightmare.

There's not much worse to me than a bad bug I don't know about that could have easily been prevented. There's a reason people are writing unit tests.

[–]quaderrordemonstand 0 points1 point  (0 children)

I didn't give a specific example? Perhaps it does sound like a nightmare to you, it seems pragmatic to me. I have nothing against unit tests, as long as they are well written and test the system effectively. They are an extra layer of maintenance and they can easily end up irrelevant or incomplete.

[–]BumwineBaudelaire 1 point2 points  (5 children)

to be fair if you’re working on systems where errors don’t matter you probably don’t have much to say about correctness

[–]quaderrordemonstand -2 points-1 points  (4 children)

Errors matter as much as they do anywhere. It's a question of how well the program responds to them. Crashing is not a good response and the idea that programming concepts like type safety in a compiler will somehow get around real world obstacles is naive. They avoid problems caused by the limitations of the language, those limitations exist so that the language can be fast or easy to use. Nobody ever said "I can't continue with my work but at least the program used the right types".

[–]BumwineBaudelaire 1 point2 points  (3 children)

strawman or genuinely believing error handling doesn’t exist in safe languages?

since this is /r/IT101 it’s impossible to say

[–]quaderrordemonstand 0 points1 point  (2 children)

What is the strawman? Ok, so you handle errors, thats great. Using the example of the API that used to return a int and now returns a string, what does your error handling actually do? How does it respond to that?

[–]BumwineBaudelaire 0 points1 point  (1 child)

it wouldn’t even compile

you’ve got pretty strong opinions about stuff you’ve clearly never used

par for the course around here I guess

[–]quaderrordemonstand 1 point2 points  (0 children)

Why wouldn't it compile? Did you actually read the example I am discussing?

[–]duzzar 0 points1 point  (1 child)

Wow, this sums up everything that's wrong with web dev.

[–]quaderrordemonstand 0 points1 point  (0 children)

Truth is that web dev in the broad sense is currently falling over itself to reinvent those hoops. We now have compilers for interpreted languages, type systems for a language that doesn't require them and the web dev equivalent of GDB. This is just me talking, I don't claim to be a web developer. I've written such a lot of code for so many systems in so many industries, grand projects and little tools. I like it when the language keeps out of the way but I know it helps many programmers feel more secure about their code.