I like to comment my code as little as possible. Here's why. Even without the comment, the version that calls a named function is easier to read.

Taking pieces and naming them is usually more effective than commenting. Obviously there's lots of times this isn't enough and you need a comment, but people often double take when I say I try to avoid commenting code. #Swift

@tewha The difference between those two isn't really about comments. Or at least there are significant non-comment differences.

@atomicbird I totally agree. But each time I find myself wanting to write a comment, I think about restructuring instead. It’s an excuse. 😀

edit: or maybe a better way to think about it is that simple comments are a sign of code stink.

@tewha @atomicbird This aligns with the sentiment of Kernighan and Plauger: “Don’t comment bad code - rewrite it” as related in the 1993 “Tutorial on Good Lisp Programming style” by Peter Norvig (yes, that Peter Norvig) and Kent Pitman.

https://courses.cs.northwestern.edu/325/readings/luv-slides.pdf