2011-10-21

Great example why JavaScript fundamentally sucks

This issue report describes a great case that shows why JavaScript fundamentally sucks.

By doing this...

window.location=window.location;

you assign a variable to itself. Unlike in JavaScript, doing this in any other statically compiled language is completely redundant, not to say "silly". In fact some compilers or interpreters would throw a warning or even an error if you try to do this in any other language.

However assigning a variable to itself isn't stupid at all in JavaScript because you have to do it, to "reliably reload the current window in Firefox / Chrome / IE / Safari".