Re: Sub panel in closet
230.70(A)1,2,3
Service Disconnecting means shall not be installed in bathrooms.
A "SubPanel" is not a Service Equipment Disconnecting means.
404.1 Scope.
The provisions of this article shall apply to all switches, switching devices, and circuit breakers where used as switches.
404.4 Wet Locations.
A switch or circuit breaker in a wet location or outside of a building shall be enclosed in a weatherproof enclosure or cabinet that shall comply with 312.2(A) Switches shall not be installed within wet locations in tub or shower spaces unless installed as part of a listed tub or shower assembly.
312.2(A) would not apply.
However, 110.26(B) Clear Spaces.
Working space required by this section shall not be used for storage.
Also, The depth and Width are to follow 110.26(A)1,2,3 With the exception of 110.26(E) exception.
In exsisting dwelling units, service equipment or panelboards that do not exceed 200 amperes shall be permitted in spaces where the headroom is less than 6'6".
The differences between codes and opinions are irrelevant. While this is code, my opinion may differ. I once met a man working the the plumbing trade, who owned a very old house ,whose panelboard was in the tub/shower space. I came to work everyday waiting to hear that he was electrocuted.