News for hackers. Stuff that matters.
Re:Python 3.11 in the Web Browser by bb88 on Sunday March 27, 2022 @12:19AM (#30817672)
Javascript will be 30 years old in 3 years. It's been successful, sure, but it's also been controversial and a lot of language mistakes have had to be carried forward. The 5 minute "wat" talk still lingers in my head about those basic mistakes.

"Oh they fixed that in Typescript."

But they could have fixed it with practically any other language as well.

Re:Python 3.11 in the Web Browser by asiachick on Sunday March 27, 2022 @01:44AM (#30817993)
The Wat talk is mostly BS for laughs. It's hilarious but to someone familiar with the language it's a bunch of stuff you'd mostly never run into. Some are even outdated.

Like he makes fun of the fact that Array(16).toString() prints 15 commas. In the context of the talk it's funny but in reality, what would you expect. You made a array with 16 empty elements. Array.toString() calls toString() on each element and separates them by commas. Why is that unexpected?

He then shows Array(16).join("wat") which is the same as the previous except JS uses "wat" between elements instead of ","

"wat" + 1 is string + number coerced to string so string + string. string + is defined as concatenation

"wat" - 1. There is no override for - for a string so numeric minus tries to add a string to a number and returns NaN. Ok, why is that unexpected? When will this bite you. You shouldn't be adding numbers to string or strings to numbers. I've been programming JS for ~20 years, I don't remember running into any of these issues.

I've also never tries to add to arrays, add an object and an array, add an array and an object, nor add 2 objects. It's funny that the language does something but so what.

You wanna talk about a language that sucks try bash. Meanwhile I've had no problems shipping 100s of projects in JS. (also, C, C++, C#, perl, python, assembly, others)

Re:Python 3.11 in the Web Browser by lenkite on Sunday March 27, 2022 @09:49AM (#30820213)
> Javascript will be 30 years old in 3 years

Python is already >31 years old.. Python is even older than Java. It is so slow - can barely crawl compared to other languages. Maybe we should retire grand-daddy Python ?

Re:Python 3.11 in the Web Browser by bb88 on Sunday March 27, 2022 @04:12PM (#30823646)
Or maybe just have google invest resources to make it faster like they did with JS?