
Hi !
Not my usual set of posts, however this keep me thinking a lot. It all started with this tweet; an usual joke about JavaScript, and how it works with types.

I noticed that some responses focused on the βyou need to know how the language worksβ before posting this. And it is correct, you need to know how JavaScript converts the elements into strings and then sort, to understand the crappy not so accurate output.
However, I am not a JavaScript expert, and I do not want to be one. And, when I use a tool or a programming language, I expect to have a nice learning curve; the previous example is not a nice βWelcome to JavaScript, where arrays and type conversions will make you think twice until you get it!β.
I’ve been doing a lot of Python programming, so I did the same exercise, and it worked as you may expect !

I also did a similar in C#, and it also worked !

Do not get me wrong, this is not an Anti-JavaScript post. JavaScript is awesome and is almost everywhere. I know a lot of awesome JavaScript programmers, who I really admire.
However as a developer, I expect to avoid something simple like an array sort issue. I will always focus on βthe code is clean and everyone will understand how it works, just read the code!β.
I am used to this as a C# developer; and I also found that Python is cool for this. But, sometimes, just sometimes, JavaScript looks like hell !
Bonus: An old post in my last JavaScript adventure.

Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.
More info in https://beacons.ai/elbruno