Why I HATE JavaScript

preview_player
Показать описание
I could have called this video "Roasting JavaScript Features", also I'm sorry if I offended any grandmas.

Before you write an angry comment please understand that this video was mainly a joke and I'm simply trying to point out flaws that could have been avoided :)

Рекомендации по теме
Комментарии
Автор

To all the programmers, do what you like. Learn which you're comfortable with.
No hate on this video but, guys you don't have to change your mind about JavaScript, it's not a bad language but every language has it's pros and cons.

I don't like JS too but it doesn't mean you're also gonna leave JS just because someone said on the internet that it's trash, not good for you etc etc.

Do what you love! 💪🏻

Love for the creator of this video, He showed the flaws of JS in a funny way! It was honestly entertaining!

wowski
Автор

My "favorite" thing about JavaScript is that most/all runtimes will throw an error saying "x is not defined" when you havent declared the identifier x and try to reference it. However if you declare x without initializing it, it will be "undefined" which is not "not defined" but also not defined either.

EDIT: As many have pointed out, it is the variable itself that is undefined in the first sentence, and in the second sentence it is the value of the variable that is undefined. And that makes sense. However to avoid confusion, this is exactly why in C++ for example you generally use two different words to describe those scenarios, where the declaration of a variable is the statement that will allocate the memory and give you a reference to that allocated memory and the definition will initialize that memory to your specified value (which you can either do seperately or combined in one statement). Therefore I would prefer if the JavaScript runtime would say "x is not declared" instead of "x is not defined". But that is just my personal preference.

MirkoCrafter
Автор

To be fair to Brendan, most people would do much worse if they had 2 weeks of time to make a language

awwastor
Автор

The Floating Point critique is quite unfair, nearly all languages do that, that’s what happens when you try to fit every infinite possible value between -10^15 and 10^15 in 64 bits of space

awwastor
Автор

as a programmer that works mainly with javascript
oh boy, you're right... when it works, it's convenient and even fast if you know what your doing
but when it doesn't... it's like trying to ride a bycicle without light, at the middle of the night, at a busy roadway, naked, your bike in flames and no brakes

akatsukilevi
Автор

I still remember learning Web development in 2019 and after HTML, CSS & bootstrap, they taught us JavaScript and since then I have given up on the entirety of web development.

Siddy_
Автор

i love making websites with C. im so sane im so normal, C error handling is amazing and totally does not make me want to hurt myself

yoman
Автор

A lot of English and Arabic songs come to mind about “I hate her but I want to …. her” 😂
I think the developer relation with TS and JS is not an affair. It is a threesome 😂

adhamabohasson
Автор

Functions being first-class-objects is why they can be passed around as variables, allowing you to do functional programming. I haven't really faced any issues with js classes in my 6 years of using it. I dispise it with all my soul but everything being an object has had no effect on me what so ever.

nosknut
Автор

“There are only two kinds of programming languages: those people always complain about, and those nobody uses.”

~ Bjarne Stroustrup

orvvro
Автор

JavaScript is like the English of programming languages

sneeznoodle
Автор

"why is everything an object"
ruby: *sweats nervously*

pesfan
Автор

1:57 + will do string concatenation in this case, so it calls toString on the array which returns "1, 2, 3, 4, 5". "" + "1, 2, 3, 4, 5" = "1, 2, 3, 4, 5"

missingsemi
Автор

All of JavaScript's warts are actually due to the insane backwards compatibility requirements of the web. The "===" vs "==" distinction, for example, exists due to the original implementation of "==" being buggy. By the time they could fix the bug, people were already using "==" as is. Such warts are an inevitability of programming language design. All other mainstream languages also have/had them, and their maintainers got rid of them by releasing newer "proper" versions of those languages. I point out "proper" because all ES standards are just additions, we literally can't deprecate JS warts because of that same reason. There's also the issue of just how broad the web is as a platform. The web moves fast, but for most of JS's history (pre 2015), it really was a toy language. When you have so much at stake and so many opinions floating around, reaching a consensus just isn't that easy.

For JS fanatics: learn as many languages as you can. Try not to tie your professional identity to any particular technology and if you really want something to be great, point out its flaws so that we can remedy them better. It's important to understand that people weren't writing nearly as much JS as they are writing now just a few years back. For some problems, it makes sense to check out other, more stable, ecosystems with far fewer moving parts. Even though modern JS is for the most part a general purpose language, its growth is still tied to the web - and probably no one understands better than you how imperfect the web is.

For JS haters: JS isn't going anywhere. In fact, it's getting better. You have absolutely no excuse not to learn and use JS at this point (where it makes sense to use it, of course). Although JS isn't a big idea language nor is it as remarkable as some other languages, there's much to find here. For example, JS isn't reactive by default. However, due to how easy JS makes passing functions around, JS frameworks offer some of the best reactive programming experiences out there.

raianmr
Автор

1:53 Why is everyone bashing on JS for that? You should bash IEEE and computers instead!

devhonk
Автор

0:11 NaN is included in the IEEE 754 floating point number standard and is used as the result of an invalid operation such as when dividing by 0. Instead of throwing an error, which would hinder user experience since JS is mostly used for client application, the NaN value is returned instead
0:33 the strict equality operator was added when a loose equality operator (==) already existed, and since browsers don't store JS runtimes as versions, and instead just update to the new versions automatically, you arent allowed to make breaking changes (i.e. you can't remove features), only add new additional features on top
0:48 JS uses prototypal inheritance, not objects, which is not something that JS is unique for, but makes a lot of sense for a dynamic and weakly typed language. Classes on the other hand, are inherently based on having a type system, which isn't the case in JS. Also the idea that "everything is an object" is as old as object oriented programming itself (obviously), and JS is also not unique in this regard as other OOPLs function in the same way (most notably Java)
1:08 As mentioned above, classes don't actually exist in JS. The "class" keyword is merely syntactic sugar for functions. The usual idea that classes are "blueprints" which can create instances of itself doesnt really apply in JS, and the closest you can have to it is functions which create an object with an internal [[prototype]] using the prototype that was defined in the function (prototype and [[prototype]] are not the same). This effectively simulates an "object factory". There's also the "new" keyword, which applies the function's prototype to the new object's [[prototype]], which, yet again, is just syntactic sugar for Object.create()
1:20 "undefined" is also something that isn't unique to JS and that plenty of other languages have, and I'm not talking about a null value. JS defines "undefined" as a unique type/value, but other languages have similar features. Every function in JS implicity returns undefined, unless specified otherwise. This is even found in what can be considered "safe" languages like Rust, where every function implicity returns (), which is an empty tuple, and empty tuples are often used in place of "undefined" in Rust
1:52 The DOM is simply a globally included API which allows you to modify, well, the DOM.
Floating point addition resulting in precision errors is also something not unique to JS, and is found in every single programming language, and every single program, because it is a fault of having only finite precision to represent decimal numbers in computers, and not a problem with JS.
"new String()" is the more explicit way to write a string literal. Under the hood, it's the same, and using double/single quotes or backticks to define string literals is simply syntactic sugar for this.
Finally, adding any value to a string implicitly casts that value as a string. This is a deliberate design choice, because the idea is that web applications should never crash, even if they produce undefined behavior. Instead of crashing your browser when incompatible types are added, JS simply forcibly casts values so that no such errors can occur

okie
Автор

I've been actively using JS for five years and I've seen all kinds of nonsense. However, I'm still hungry for more 😋

mirzaleka
Автор

"0.2+0.1 is not that" that has nothing to do with js tho

nothappyz
Автор

Loose type system is already a very known flaw of JavaScript, and is the main reason that typescript is a thing. Also NaN is necessary when a floating pointing computation is invalid, i.e 0/0 is NaN. You can't use null of undefined because those are object values, not floating point values. And divide needs to return a fp value.

dmsalomon
Автор

Went from python to js, I honestly cant believe js is standard language used for web dev… I get that everyone just uses frameworks but js is rediculously inconsistent and needlessly complex.

garrettmoon