Every kid is different and I try to never second-guess others' parenting style.
Rules and limits are important and I agree the screen offers quicker gratification, so we as parents must set and enforce those rules.
That said, this changes the subject a bit, as we were talking about learning to code.
That's empathically not an instant gratification and we should not equate time spent in front of screen with time spent learning, expanding understanding of logic, cause and effect, structure, etc. And while kids are happy to spend hours gaming, I haven't seen many (in my social circle) that would be happy spending hours debugging some Python, Lua or Sketch code.