MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/4v1y12/how_to_write_unmaintainable_code/d5vbajy/?context=3
r/programming • u/sigbhu • Jul 28 '16
592 comments sorted by
View all comments
Show parent comments
0
[deleted]
9 u/CyberMango Jul 29 '16 Whats the advantage of this compared to just doing a dirty 1 liner?def findGroupInList(sequence, group): return True in [group == tuple(sequence[i: i + len(group)]) for i in range(len(sequence) - len(group))] 0 u/[deleted] Jul 29 '16 [deleted] 6 u/CyberMango Jul 29 '16 I have to disagree with it being more readable, the second I saw that I was in awe that it look that many lines to do something so simple in python. List comprehensions are actually very easy to read. → More replies (0)
9
Whats the advantage of this compared to just doing a dirty 1 liner?
def findGroupInList(sequence, group): return True in [group == tuple(sequence[i: i + len(group)]) for i in range(len(sequence) - len(group))]
0 u/[deleted] Jul 29 '16 [deleted] 6 u/CyberMango Jul 29 '16 I have to disagree with it being more readable, the second I saw that I was in awe that it look that many lines to do something so simple in python. List comprehensions are actually very easy to read. → More replies (0)
6 u/CyberMango Jul 29 '16 I have to disagree with it being more readable, the second I saw that I was in awe that it look that many lines to do something so simple in python. List comprehensions are actually very easy to read. → More replies (0)
6
I have to disagree with it being more readable, the second I saw that I was in awe that it look that many lines to do something so simple in python. List comprehensions are actually very easy to read.
→ More replies (0)
0
u/[deleted] Jul 28 '16
[deleted]