T
19

Had a senior dev laugh at my grid code during a code review last month

I was in a Zoom call with this guy from a different team, showed him my product card layout using CSS Grid with a 12 column setup and nested grids for the content. He just laughed and said "why are you making this so complicated when Flexbox would work fine." I was honestly pretty embarrassed at first, but I asked him to explain why he thought that. He pointed out that I was over nesting and using grid where a simple flex wrap would do the same thing with half the code. That conversation completely changed how I think about when to actually use grid vs flexbox. Has anyone else had a senior dev call them out on overcomplicating layouts?
2 comments

Log in to join the discussion

Log In
2 Comments
the_jason
the_jason6d ago
Take it a step further and ask him if he's ever debugged a Flexbox layout that breaks in a weird edge case on a tablet. Sometimes the "simpler" solution just kicks the complexity can down the road.
4
lily_sullivan82
Oh man, @the_jason hits the nail on the head - I had a senior guy show me how my flexbox solution would absolutely break on a landscape tablet and I had to eat crow big time.
1