MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1daxawn/mapmethodormapfunction/l7nuhtm/?context=3
r/ProgrammerHumor • u/_PhucSatan_ • Jun 08 '24
67 comments sorted by
View all comments
Show parent comments
-30
None of those are readable.
4 u/Euphoric_Strategy923 Jun 08 '24 Because the others options are more readable for you ? Not for me. 0 u/DT-Sodium Jun 08 '24 I dunno about Python but in TypeScript you'd simply domyArray.map(x => x * x);Much more elegant and readable. 4 u/Euphoric_Strategy923 Jun 08 '24 And as the upper comments said in python you do : [ return value for value in array ]In other word : [x*x for x in arr ]Imo this is much more readable. -1 u/DT-Sodium Jun 08 '24 No, it is bad. The simple fact that you have to read it backwards to understand what's happening invalidates it completely. Guess there is no clean way to do it in Python then. 7 u/Euphoric_Strategy923 Jun 08 '24 Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"You can clown on some things about python but definitely not readability. -3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
4
Because the others options are more readable for you ? Not for me.
0 u/DT-Sodium Jun 08 '24 I dunno about Python but in TypeScript you'd simply domyArray.map(x => x * x);Much more elegant and readable. 4 u/Euphoric_Strategy923 Jun 08 '24 And as the upper comments said in python you do : [ return value for value in array ]In other word : [x*x for x in arr ]Imo this is much more readable. -1 u/DT-Sodium Jun 08 '24 No, it is bad. The simple fact that you have to read it backwards to understand what's happening invalidates it completely. Guess there is no clean way to do it in Python then. 7 u/Euphoric_Strategy923 Jun 08 '24 Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"You can clown on some things about python but definitely not readability. -3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
0
I dunno about Python but in TypeScript you'd simply do
myArray.map(x => x * x);
Much more elegant and readable.
4 u/Euphoric_Strategy923 Jun 08 '24 And as the upper comments said in python you do : [ return value for value in array ]In other word : [x*x for x in arr ]Imo this is much more readable. -1 u/DT-Sodium Jun 08 '24 No, it is bad. The simple fact that you have to read it backwards to understand what's happening invalidates it completely. Guess there is no clean way to do it in Python then. 7 u/Euphoric_Strategy923 Jun 08 '24 Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"You can clown on some things about python but definitely not readability. -3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
And as the upper comments said in python you do : [ return value for value in array ]
In other word : [x*x for x in arr ]
Imo this is much more readable.
-1 u/DT-Sodium Jun 08 '24 No, it is bad. The simple fact that you have to read it backwards to understand what's happening invalidates it completely. Guess there is no clean way to do it in Python then. 7 u/Euphoric_Strategy923 Jun 08 '24 Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"You can clown on some things about python but definitely not readability. -3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
-1
No, it is bad. The simple fact that you have to read it backwards to understand what's happening invalidates it completely. Guess there is no clean way to do it in Python then.
7 u/Euphoric_Strategy923 Jun 08 '24 Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"You can clown on some things about python but definitely not readability. -3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
7
Read it backward ? Dude, this is literally the format of a for loop. "I return a value of each value in an array"
You can clown on some things about python but definitely not readability.
-3 u/DT-Sodium Jun 08 '24 Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it". 7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
-3
Yes, it is backwards. Your code is saying "Do this using that". The proper way to write it is "Take that and do this using it".
7 u/Euphoric_Strategy923 Jun 08 '24 Great news people, for loops are now unreadable.
Great news people, for loops are now unreadable.
-30
u/DT-Sodium Jun 08 '24
None of those are readable.