25
Pro tip: stopped nesting my CSS selectors 10 layers deep after a senior dev showed me his 300-line file
He just scrolled through it in like 5 seconds and pointed at the screen, and I realized my code was basically a maze that only worked because I wrote it, has anyone else had that moment where you see clean code and instantly know you've been making a mess?
2 comments
Log in to join the discussion
Log In2 Comments
taylorcarr8d ago
Honestly, deep nesting works fine if you know what each layer does and keep your naming consistent. Clean code looks nice, but messy code still ships.
7
hugo_ellis8d ago
Messy code still ships sure, but it also sinks weeks of your life later when you come back to it and can't even remember what each layer was supposed to do. Your brain can only hold so many nested conditions before it starts guessing wrong about the logic. "Works fine" just means you haven't hit the bug that takes three days to trace through those layers yet.
1