3 ms·
JS is not particularly accessible to beginners and makes it easy to write bad/dangerous code. A good programmer can write in anything, but it's the not-so-good
by askvictor 9y ago
JS is not particularly accessible to beginners and makes it easy to write bad/dangerous code. A good programmer can write in anything, but it's the not-so-good programmers that you have to worry about.
- austincheney 9y agoAgreed. To be a strong candidate for a web scripting language you need three things: * native lexical scope. This is how all web technologies work. * Minimal reliance on white space as syntax. The language needs to be portable. Overloading white space as syntax makes a language more brittle, particularly in distribution. * Immediate interpretation without a prior static compile step. This keeps the code open to examination and minimizes compile time delays. Find another language that doesn't have all the stupid crap that JavaScript has and yet still excels in those three points and I will agree upon a replacement.
- askvictor 9y agoWhile I don't agree with your second point, which seems to be there purely to exclude Python, I'll run with it so as not to devolve into religious war territory. How about Lua?
- austincheney 9y agoA line terminator on *nix isn't a line terminator on Windows, which is a big deal if line termination ends a statement, and that assumes the file isn't modified in transit.
- askvictor 9y agoAnd semicolons are optional in JavaScript, makes it whitespace sensitive I suppose.
- austincheney 9y agoYes and no. The language specification requires the use of semicolons. If a semicolon is not supplied the interpreter will insert it for you. That magical insertion step is referred to as ASI. I don't remember if ASI is mentioned in the spec (as I don't think it is), but at the very least it is a de facto standard as missing ASI breaks the web. As stupid as all that sounds... semicolons are actually required to terminate statements in JavaScript.
- askvictor 9y agoAnd yet somehow the web doesn't break when one programmer uses \r\n while another uses \n. What was your original point about line terminators in this context?
- austincheney 9y agoI suppose that goes to how the language defines line termination and whether that language is OS aware. JS is completely independent of its execution context. Python may achieve this as well, and if so, then I am wrong in my thoughts about Python. Here is how JavaScript does this: * https://www.ecma-international.org/ecma-262/#sec-source-text https://www.ecma-international.org/ecma-262/#sec-source-text * https://www.ecma-international.org/ecma-262/#sec-line-terminators https://www.ecma-international.org/ecma-262/#sec-line-termin... ASI is defined in the spec here: https://www.ecma-international.org/ecma-262/#sec-automatic-semicolon-insertion https://www.ecma-international.org/ecma-262/#sec-automatic-s...
- int_19h 9y agoYet somehow, Python doesn't have this problem - it simply treats both types of line terminators as valid. So do all other modern languages that rely on whitespace.
- ams6110 9y ago> JS is not particularly accessible to beginners and makes it easy to write bad/dangerous code That describes just about every programming language ever.