Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree mostly in that Lua and Javascript are both similar, and like I said in my post above, I could see myself saying the exact opposite if Lua had been included in the browser.

The things I do not like about Javascript can easily be shot down in an argument. Some of it was having to work with Javascript (and it's evil cousin JScript) in the 90s and early 00s.

The type coercion and in the early days people used '=='. I think === did not even appear until ie6?

[] == ![] // true

The lack of a lot of easy helper functions in the standard lib. That now are provided by people writing a bunch of stuff in the npm ecosystem.

The npm ecosystem itself. Lack of security. Lack of... curation? (Also, all this would have probably happened anyway if Lua was in the browser)

I also think javascripts long history has created a legacy of different paradigms

variable declaration var, let, const

function declaration

function f1() {}

const f2 = function() {};

const f3 = () => {};

const obj = { f4() {} };

There is a lot of stuff like this in javascript. I could probably make a blog post about it. But the above gives the general idea of my complaints.



In practice you don't run into these issues often. I'm annoyed when you see different function declaration conventions in the same codebase, but generally () => is used for either one line functions or inline lambdas, and function foo(){} for everything else. Nobody uses var anymore.

The implicit conversions is a definite footgun tho.


Funny you mention nobody uses var anymore when I just saw a post on here yesterday that perf critical code still uses var since it's faster


Bundlers will convert let/const to var, assign classes and functions to var etc but generally people don't write it themselves unless they want to (ab)use its semantics for performance reasons.


Do people often use bundlers for the backend?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: