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".

Comments

  1. Seems fine to me if you think about it as calling a setter.

    ReplyDelete
  2. Javascript I am dissapoint....

    ReplyDelete

Post a Comment

Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Java 8: Default Interface Implementations, The Diamond Problem, Multiple Inheritance, and Precedence

Tuning ext3 for performance without losing its data integrity potential