3 ms·
Nice article. I learnt some stuff. WRT to length of a statement, look at how many operations are being done. If it’s doing something like filtering that should
by aunty_helen 4y ago
Nice article. I learnt some stuff.
WRT to length of a statement, look at how many operations are being done. If it’s doing something like filtering that should be 2-3 ops on the same line. Perfect application of a comprehension with an if statement.
If it’s 5+ different things jammed into a comprehension, you’re failing PR. Don’t think it needs to hit 2 LOC before refactoring.
Build a list, take a property, call a function with that value, iterate, if something, else something, all on one line?? Aren’t you clever. Now, let’s write professional code.