Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

JS is fun. You're not

Name: Anonymous 2015-06-24 12:46

I'm serious and fuck you

Name: Anonymous 2015-06-24 13:14

JS is okay. I prefer a real Lisp with s-exp syntax and Lisp semantics. That'd make web programming so much more fun.

Name: Anonymous 2015-06-24 13:20

aids(function(x){
aids(x, function(y){
aids(y, function(z){
aids(z, function(a) {
1 == '1'});
});
});
});
});
});
});
});
});()[]};
});)()][];
});
});


Broken behavior across competing implementations: it is virtually impossible to use JS to do anything robust on the client side. JQuery tries to amend this, but inconsistency is still there.
Broken type system: it is weak and its automatic coercion astonishes: "1"+"2"=="12" and "1"+1=='12', but "1"-2==-1, "2"*"3"==6, and (x="1",++x)==2; 0==-0, but 1/0!=1/-0; [123]==123, but [123][0]!=123[0]. Even worse: [0]==false, but ([0]?true:false)==true, so (a=[0], a==a && a==!a)==true; Following statements are also true: []==![], Math.min()>Math.max(), " \t\r\n"==0, ",,,"==Array((null,'cool',false,NaN,4)), new Array([],null,undefined,null)==",,,", Array()==false, ''!='0', 0=='', 0=='0', false!='false', false=='0', false!=undefined, false!=null, null==undefined, NaN!=NaN, []+[]=="", []+{}=="[object Object]", {}+[]==0, {}+{}==NaN, despite (typeof NaN)=="number", so ("S"-1=="S"-1)==false. Given function f(n) {return n&&+n|0||0;}, we have f("1")==1, f("1.2")==1, f("-1.2")==-1, f(1.2)==1, f(0)==0, f("0")==0, f(NaN)==0, f(1/0)==0. No numerical tower or even obvious integer types: the only numeric type supported is an IEEE754 double-precision float, allowing for 9999999999999999==9999999999999999+1. Hacks like (x+y)|0 are employed to strip rational part.
Broken default value: whereas most languages have one universal singular value (null/nil/Void/whatever), JavaScript has four: "false", "null", "void" and "undefined", producing confusing and irregular semantics. Then undefined is not actually a reserved keyword, so undefined="broken" easily breaks code, although void 0 can be used instead of undefined; jQuery uses kludge like (function (undefined) {...}()) to ensure that undefined is undefined. Other redefinable symbols are NaN, Infinity, and the constructors for the built-in types.
Broken lexical scoping: unlike C/C++/Java/C#/etc, where variables introduced in an anonymous block within a function are only valid within that block; in JavaScript such variables are valid for the entire function. JavaScript employs unintuitive process called declaration hoisting, in which all function and variable declarations are moved to the top of their containing scope. If a variable is declared and assigned in one statement then the statement is split into two, with only the declaration getting hoisted. This produces a lot of subtle bugs, like non-obvious hiding of outer variables; other example is f in var f = function() {…} being present as undefined, while function f() {…} would always be defined. Every script is executed in a single global namespace that is accessible in browsers with the window object. The "with" statement is a benchmark example of bad design, because an innocent addition of a variable to a class breaks every place of its use, but the nightmare doesn't end here - the code using with is just unreadable, requiring hours to untangle the mess.
Broken syntax: semicolons are optional, but it only makes life harder, because newline can accidentally take place of a semicolon, in effect return{a: "hello"}; and return\n{a: "hello"}; (where '\n' is newline) mean completely different things: '\n' gets parsed as ';', resulting into just "return;" Finally, crippled syntax impedes functional programming: )}();)}();)}();)}();
Broken standard library: most built-in functions, given an invalid input, don't produce error or exception, but silently return some default, like new Date('garbage'), or even produce undefined behavior: parseInt("07")==7, but parseInt("08")==0 or parseInt("08")==8, because "the implementation may, at its discretion, interpret the number either as being octal or as being decimal". Even worse, parseInt('fuck') gives NaN, but parseInt('fuck', 16)==15 and parseInt(null, 34)==939407
Broken arrays: new Array() produces empty array; new Array(2,3) produces array with 2 and 5 as its elements; new Array(5) does not produce array with 5 as its single element; instead, it returns a 5-element array. In JavaScript an array with 2 elements can have length of 7, while an array with 7 elements can have length 2, because length property always returns the last numeric index, plus one. JavaScript has no out of bounds error: you can freely retrieve an element at any index and no error will be produced, even if element is undefined. JavaScript provides no reliable way to iterate array by index, instead for(var X in Xs) gives elements in completely undefined order.

IHBT

Name: Anonymous 2015-06-24 22:58

>>2
ClojureScript

Name: Anonymous 2015-06-25 9:50

>>3
need more promises

$q.all(aids, aids, aids, aids).then((x,y,z,a) => { 1 == '1' })

Name: Anonymous 2015-06-25 19:12

>>5
It's an elephant burrito just like Haskell.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List