r/ProgrammerHumor • • Jun 21 '18

Thanks Brendan for giving us the Javascript

Post image
3.1k Upvotes

302 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jun 21 '18

[deleted] — view deleted comment

15

u/caerphoto Jun 21 '18

It's not so much an issue of static typing, as it is one of JS's original design goals to try to never crash.

Ruby, for example, isn't statically typed, but will quite happily throw exceptions if you try to do things like 1 + "1" or even just "foo" + :bar.

(although it can do implicit conversion if you define the appropriate methods, e.g. to_str(), but thankfully the core classes have sensible definitions)

5

u/Xheotris Jun 22 '18

I actually love JS for that. Types were not up to snuff back then, and you don't want your website crashing constantly, nor do you want to take the time to make a formal proof of your photo gallery widget.

It's quick and dirty and durable. Like a bulldozer. It's a stupid tool for treating a patient, or doing your taxes, or a thousand other things, but if you need to just plow through a problem as fast as possible, boy does it go!

6

u/caerphoto Jun 22 '18

Sure, for its original intended use it's fine, but these things have a tendency to outlive intended purposes.

I'm working on an application at my job that was put in place as a temporary measure that needed to be up and running ASAP and would only be needed for a few months. Many design decisions were made on this assumption. This was 5 years ago, and it's vastly outgrown its original purpose, and it's been a heck of a struggle to bring it up to date

Btw don't take this as me hating on JS – I'm actually really rather fond of it.

9

u/[deleted] Jun 21 '18

static strong typing

Isn't it?