JavaScript Sucks (2017)
Why JavaScript is the Suckest Language
JavaScript is truly the suckest language. There's no easy way to test object equality, forces you to change your code's algorithms, fundamentally.
and JavaScript syntax, is the worst possible. Code written by others is not readable.
why is js syntax unreadable? because
it has function expression, but it does not have the usual function programing languages's design to control it. JS is mostly imperative and prototype OOP, incompatible with function programing. Thus, you have passing function as argument and return function. This feature by itself, if used without fine control, creates incomprehensible code (e.g. y-combinator). (e.g. haskell has types, composition, currying, etc, to control complex function semantics.)
And JavaScript syntax is C/Java-like, provides no syntactic support for function programing. The passing function style becomes unreadable quickly. (e.g. lisp solves syntax problem by almost pure nested parenthesis, and haskell etc provides linear syntax (no parenthesis), and syntax that support semantic features such as currying, lambda, nesting, etc.)
Further, JavaScript design that was trying to emulate Java, created the following entities with exceptionally convoluted semantics.
- JS: this (binding)
- JS: prototype (property)
- JS: new (operator)
- JS: instanceof (operator)
- JS: constructor (property)
been thinking, to fix the js problem by removing some features, we'd gain a lot by,
- Ban the keyword
function. - Ban the keyword
this. - Ban the keyword
new. - Ban the use of property key
"prototype". - Ban the use of property key
"constructor". - Ban the keyword
delete. [see Delete operator] - Ban the keyword
var. - Ban
==.
JavaScript warts collection
start to collect the items.
- some methods works on other types. e.g. map on array-like.
- JS: String.prototype.repeat
JavaScript sucks
Spec Reading
- Reading JavaScript spec notes (2015)
- JavaScript Grammar is Not Context-Free (2016)
- JavaScript Syntax Complexity: Lookahead (2015)
- JavaScript sort, is fragile, and most complex, convoluted (2017)
- JavaScript Spec, Term “instance” is Not Defined (2017)
- JavaScript Spec Change on Date Time Zone Default (2022)
- The term INSTANCE in Object Oriented Programing
sucks
- JavaScript Sucks (2017)
- JavaScript is Truly Bad Language (2025)
- JavaScript Sucks. Variations of Looping Thru Array (2025)
- Xah JavaScript Style Guide for FP
- JavaScript, Write All If Statement as If Expression