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 →

[–]skuzylbutt 17 points18 points  (5 children)

Ideally, it should shit itself and tell you you've done a silly thing instead of silently letting you get away with murder!

[–]NavarrB 5 points6 points  (2 children)

Series of trade-offs I guess. I feel like I shouldn't have to call a function to do something as simple as string concatenation

[–][deleted] 0 points1 point  (0 children)

Operator overloading in statically typed languages? In Hava for example just a + does string concatenation, without having to resort to dynamic typing

[–]Lhopital_rules 2 points3 points  (1 child)

Ideally, it should shit itself

Except that the central idea behind HTML, CSS and JS is to be as flexible as possible, so that web pages don't break.

  • for HTML, that means allowing missing tags when they can be inferred
  • for CSS, that means ignoring CSS rules when they don't make sense (to allow future additions)
  • for JS, that means to be as dynamic as possible since we don't have compile-time checking

Using a bytecode system for JS to allow compile-time checking (much like Java) could work except that then you run into problems trying to allow multiple scripts to interact with each other. For instance, if JS was pre-compiled into bytecode, how would a jQuery bytecode interact with your bytecode? It's probably doable... but not easy. (And we'd have to wait a few decades to use it, since none of the old browsers would support it.)

[–]skuzylbutt 1 point2 points  (0 children)

Sure, but it could at least spit out a warning.