DEV Community

Discussion on: Remembering that "functions are objects" can help in writing more concise code

Collapse
 
somedood profile image
Basti Ortiz

Indeed, JavaScript is a (very) flawed language. Indeed, JavaScript is a laughing stock for "real programmers" who code with more hardcore, lower-level languages. JavaScript was designed in just two weeks after all. I don't blame the community for belittling JavaScript despite its success and omnipresence nowadays.

However, I beg to differ on how you believe JavaScript's treatment of functions as objects is wrong. There is no right or wrong in programming languages. Each language was designed to be how it is for a good reason. It is unfair to say that a language feature is "wrong" because it is rare or unpopular.

Let's take Rust for example. Variables in Rust are immutable by default. Most languages are not designed that way. Would it be fair to say that Rust is "wrong" for having immutable variables by default? I wouldn't say so.

I hope you see my point here even if my analogy might be off. I don't mean to attack you or anything. Sorry if it comes out like that. I just felt the need to defend the language I love, you know?