-4

I had a conversation with my CTO regaring using CSS Grid, and the question that I heard the most was “Why use grid, that’s not supported in old browsers if we have to write flexbox fallbacks anyway? Why don’t we just build with flexbox?”

And it got me thinking. A big advantage of CSS Grid for me is writing less code. But if I have to write fallbacks, I’m effectively writing grid code AND flexbox code, which is more work. So that argument kinda makes sense I guess?

What would you answer to that?

max
  • 366
  • 3
  • 9
  • 1
    This question is either too broad, opinion based or requires discussion and so is off-topic for Stack Overflow. If you have a specific, answerable, programming issue, please provide full details. – Paulie_D Dec 26 '17 at 11:25
  • 1
    Please review [**How to ask**](http://stackoverflow.com/help/how-to-ask) questions on Stack Overflow and what types of questions [**can be asked**](http://stackoverflow.com/help/on-topic) and what types [**should be avoided.**](http://stackoverflow.com/help/dont-ask) – Paulie_D Dec 26 '17 at 11:25
  • The absolutely best way is common sense, and its fancier expression "progressive enhancement", where you need to check up on which browser level your target group are at, and go from there. – Asons Dec 26 '17 at 12:41

1 Answers1

0

Here is some arguments why.

  • You could do a lot more with design. Think about all the workarounds you need to implement in order to have something simple as 100vh... Your designers will be happy if they have you on their team.
  • Lot less duct taping solutions, see above.
  • New features makes your code better, maintenance will be a lot better, you code in general will be more clean. This actually means less work in the feature.
  • Performance, browsers that support new features will have lot less code to use, this is not true ofc for every new feature out there.
  • More work with fallback solution, yes, that might be true. But if you are always writing the same fallback solutions to the same features then you are doing something wrong, search the web, there might be a solution already there, if not make your own internally and reuse it on other projects, thus you will have to make a fallback solution only once.
  • You want your developers happy, if there is a way to use new features (and there is almost always a way), you should use it. Motivation kind of a thing.
  • If NOT then those features will never get used anyway since people will stick the old ways thus there is no need for browsers to implement in the new versions because guess what no one is using those new features thus we don't need them. But we all know we need them.
  • New features will eventually becomes standard (if we actually use them), you want to have team that is already proficient in those new technologies, thus you can sell yourself better to the client.

As for grid css layout, check this one --> https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/CSS_Grid_and_Progressive_Enhancement

Also, this kind of question is better fit for the Quora or something similar, not stack.

Nikola Mitic
  • 1,298
  • 3
  • 11
  • 23