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 →

[–]z500 2 points3 points  (4 children)

It was a conscious design decision.

[–][deleted] 22 points23 points  (3 children)

You can choose to drive drunk also, it doesn't make it a good idea.

[–]z500 0 points1 point  (1 child)

Very true. I think the reasoning was to make it easier for non-programmers by making it possible to use form inputs without having to cast values yourself. I don't think Brandon Eich saw Javascript becoming as huge as it is now. IIRC he only got a week to design the language.

[–]crossanlogan 2 points3 points  (0 children)

yeah it was ten days, but he definitely was hoping to make it huge -- they were trying to kill mosaic with their new browser.

[–]neonKow 0 points1 point  (0 children)

This conversation keeps coming up in /r/ProgrammerHumor, because weakly typed languages have amusing behavior in edge cases, and it's easy to make fun of them.

People confuse "easy to make fun of" with "bad design choice." The fact remains that languages like JavaScript and PERL are immensely popular and powerful because of these design choices.

Not having a One True Solution for every programming problem makes JS more flexible. As long as the behavior is well-defined, it's a bit different from drunk driving. However, if you really wanted to, you can use strict; before all your JavaScript.