Clean Code Secrets: Push Ifs Up, Pull Fors Down Like a Pro

3 javatuts 3 5/26/2025, 1:47:50 AM jsdev.space ↗

Comments (3)

gnabgib · 2d ago
Doesn't even mention the original article Push Ifs Up and Fors Down from 2023 (662 points, 295 comments) https://news.ycombinator.com/item?id=38282950

Or the recent repeat (568 points, 9 days ago, 197 comments) https://news.ycombinator.com/item?id=44013157

Arnt · 2d ago
The original original may be Christopher Seiwald's "seven pillars of pretty code", which among other things suggested to do your ifs first and get rid of the rare cases, then handle only the common case with more complicated logic in the bottom part of each function.

An excellent article that you have to search for.

javatuts · 1d ago
Just because someone published an article on micro-optimization, does that mean we all have to follow it blindly?