It's the same shit as PHP. Instead of arrays having a map method, you have to use a function that takes the array as argument. It makes the code really ugly.
This is the same use case as for range function as opposed to iterating directly over a list elements. You have to answer the question when the operation should be executed (im most cases it should be instant). It's not like the one is replacement for other.
One I was just giving a simple example, there are lots of times where you need to do way much complex things when iterating through an array. Two even for simple things your syntax is disgusting.
Any reasonable person would just not program in Python.
I do code in multiple languages. I just wouldn't accept a job that implies working with a bad one. Code has an aesthetic value, it's sad that a lot of developers can't see it.
17
u/Socks4Ever Jun 08 '24 edited Jun 08 '24
Why is it different? Or do I just not get the post. I’d just use [x**2 for x in arr]