Google does not allow access to their tiles outside of their public APIs, from section 10.1.1 a of the Google Maps/Google Earth APIs Terms of Service:
No Access to Maps API(s) except through the Service. You must not
access or use the Maps API(s) or any Content through any technology or
means other than those provided in the Service, or through other
explicitly authorized means Google may designate. For example, you
must not access map tiles or imagery through interfaces or channels
(including undocumented Google interfaces) other than the Maps API(s).
That is why the solution you linked to is necessary: it loads and uses the Google Maps API to load Google's map tiles (including imagery).
You can continue to use legacy modules (modules created with dojo.provide, dojo.require and dojo.declare) with the latest version of the JS API until we (Esri) move to Dojo 2.0 which will remove support for legacy modules. This is still several JS API releases away since Dojo 2.0 isn't out yet. Hopefully the author of that code will re-write it as an AMD module as I think it is still the best way to use Google tiles with the JS API.