Will this light fixture wiring pass inspection?
What is being created is a "switched neutral," which is not proper and not allowed according to the NEC. It's possible, but highly unusual, to run the hot through the switch instead of the neutral and create a switched hot with a separate neutral path back to the breaker. That would be better than a switched hot, but may still be disallowed by NEC and I would never encourage anyone to wire a fixture that way either. The wiring shown in your first diagram, or wiring that runs the line to the switch first and switches the hot there, are the proper methods to wire a switched light.