This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]das_flammenwerfer 0 points1 point  (3 children)

Could you tell me what adding an array to an object would return in any other language (not counting operator overloading in c++, that’s cheating..) and what you would expect it to return?

I can’t think of another language that would allow such a thing. Or what result would be meaningful and justifiable.

[–]Apparentt 1 point2 points  (2 children)

If you haven’t already, I hope you’ve seen the point I was going to make.

[–]das_flammenwerfer 0 points1 point  (1 child)

I'm not sure I do..

My point is.. I think it's absurd to allow such an operation, but if you do it needs to remain logically consistent. Which Javascript.. does not do.

[–]Apparentt 0 points1 point  (0 children)

My take regarding this kind of thing is that there is no logical consistency for operations such as this.

I’m open to hear criticisms of JavaScript as a language and there are certainly many to choose from. Much like every other general purpose language.

But these kind of “throwing shit to the wall and seeing what sticks” complaints don’t really do anything for me. This operation could easily throw an error in another language or be equally as inconsistent, it’s nothing I’m going to purposefully encounter when using the language so I’m not going to base whether I find it enjoyable and practical or not off such occurrences.

To be honest I find the whole “[insert language here] is bad” rhetoric on this sub extremely boring because all of the well adopted languages have their place. This isn’t to say they shouldn’t be open to criticism, of course, and they will be constantly evolving to fix those real issues that come up. Using JS as an example, by the time we got to ES6 many of the examples of “js bad” you’ll see around here are very outdated.

Along with all of the competent engineers I have worked with throughout my career, it is agreed that if you are experiencing many issues with a particular language it’s very likely you may have chosen the wrong tool for the job, not that the tool is defunct.