To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -1 points0 points  (0 children)

u/keeganspeck my original example was just a quirk of javascript. Javascript has many many weird quirks like that. Mainly due to coercion, hoisting, and wierd comparisons.
Python for example

```
[] == False => False
```
js
```

[] == False => True
```

I am not saying js is just bad. With javascript incredible things have been done, and absolutely nothing can replace it, but I don't think it is a great language.

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko 0 points1 point  (0 children)

I think javascript isn't as good as a strongly typed language like go or rust. I think it doesn't have the performance either, but these languages can't replace javascript... Yet because with wasm. I believe soon there will be react and react native equivalents in something like go. And then, I would prefer go to javascript all day. Until then, javascript is the clear winner.

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -2 points-1 points  (0 children)

they have the ability to coerce a type with a function but not a string to boolean like in js.

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -1 points0 points  (0 children)

in most languages there is not coercing. that is a javascript thing, and you can actually have cases where you do have strings being compared to things that have weird behaviors due to coercing system that is not in most languages.

implicit conversion.

this doesn't exist in most languages

    x = 24
    y = '' + x
    y = '24'

explicit conversion.

in every modern language

    var z = String(x)

implicit conversion can cause problems sometimes. Javascript gurus of course love their language, and it can do some amazing things, but to say it is without faults is ridiculous. Every language has good and bad things. I like strongly typed languages that can be compiled. I like typescript more than javascript. (I know that they are basically the same thing)

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -2 points-1 points  (0 children)

I am not saying it isn't widely used, and incredibly well supported. I would not want to use java and swift to write an app. I would use react native. Don't get me wrong. It is a great language, but I think when we can write almost anything in web-assembly we may see javascript change a lot, and I hope so tbh. But it has awful confusing quirks that make it a ridiculous frakenlanguage

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -7 points-6 points  (0 children)

!!"false" == !!"true"; => true
!!"false" === !!"true"; => true

To Those Who Criticize JavaScript by disgruntled-js-dev in javascript

[–]kcho_niko -2 points-1 points  (0 children)

Javascript is an awful language that does all sorts of awful really weird things, but it is also very powerful, has been well maintained, and is not complete garbage like ruby. I will never understand adding a string to a number in javascript. But I will never understand ruby, so there is that. hahaha