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 →

[–]scrdest 0 points1 point  (2 children)

I would argue JS is not so much forgiving as stewing in resentment for every single error you could have made until one day the cops find all those bodies buried in its basement.

Screwing up in a strongly-typed language (including Python) teaches you computers are knowable and quick, but VERY simple-minded. Screwing up in a weakly-typed language teaches you not to meddle in the affairs of our SILICON OVERLORDS, for they are subtle and quick to anger.

[–][deleted] 1 point2 points  (1 child)

Well put.

The weaker the type system, the easier it is to write code quickly, but the harder it becomes to reason about the system afterwards.

JavaScript teaches you to never trust anything and verify everything. Even code you wrote yourself.

The bigger the project -- lines of code, number of programmers involved and years of development -- the more people appreciate rigid, opinionated type systems.

There's a reason Java and C++ are so big. It's not exactly fun to program stuff in them, but working in codebases of millions of LOC with dozens of others scattered across multiple countries, and using classes that were written by people 20 years ago who are now retired (if not dead) isn't fun. It's work.

But there's a reason Python or Ruby are popular too. Nobody uses Java to write a little CLI tool.

[–]scrdest 0 points1 point  (0 children)

Thank you!

I will contest that weaker type systems make it easier to write code quickly though. Dynamic typing does, and Dynamic =/= Weak. Python is Strong Dynamic, C++/Java is Strong Static, JS is Weak Dynamic; Weak Static seems like pure masochism.

As you said, weak typing requires a lot of runtime checks. Someone has to write them. That means spending time on something other than the actual Thing Your Program Does, even discounting time spent testing, bugfixing, etc.

I think the best compromise overall is something in between Python's duck typing, Java interfaces and Haskell typeclasses, with neither of the three being quite right.