"...I have a 50mm Nikon lens afs 1.8 g lens, is this better than the 50mm 1.8 af d lens..." Jim Bianco what genre do you wish to use it in... and on what camera body? Anyone who attempts to answer your query without the aforementioned information certainly isn't a Nikon Ambassador nor are they working in a camera store...
Jim the answers one typically receives on UHH forums is by those who possibly need to validate and justify their own purchase decisions out of a perceived fear that they may have inadvertently chosen a less popular piece of kit (according to their peers here on UHH)...
That said I would caution you on accepting anything Ken Rockwell has to say on his portal... while he does amass lots of useful data he unfortunately draws inferences that can be at best questionable.
For comparing optics DxOMark was for the longest time a most trusted source, albeit sadly like many others in the drastically collapsing Photo Marketplace DxOMark no longer is activity testing much of the newer gear releases...
Here is DxOMark's test results on the AF-S 50mm f/1.8g
https://www.dxomark.com/Lenses/Nikon/Nikon-AF-S-Nikkor-50mm-F18G And here is DxOMark's test results on the AF 50mm f/1.8D
https://www.dxomark.com/Lenses/Nikon/AF-Nikkor-50mm-f-1.8D-mounted-on-Nikon-D800E__814You'll have to select your camera body rather than using the Nikon D800e
Then click on Measurements... then Sharpness... then Field Map
This will allow you to get your head around how each optic actually preforms at differing apertures...
btw, I've done this analysis long ago and the newer AF-S 50mm f/1.8G literially blows the AF 50mm f/1.8D out of the water... at ALL APERTURES! and across the frame... so much for the hearsay latent within this thread....
Ok, since I don't have clue on what your intended use is I can only give you my choice on a 50mm prime... Long ago I purchased the AF-S 50mm f/1.4G since I wanted the beautiful bokeh it is known for... while the AF-S 50mm f/1.8G actually out preforms it in acuity there sometimes are other compelling reason's to choose an optic...
The down side of the AF-S 50mm f/1.4G optic is it's odd filter size of 55mm which at first I was not happy having to buy another Nikon NC Clear filter for... That was until I purchased the amazing AF-P 70-300mm f/4.5-6.3 DX ED VR lens... This also has a 55mm filter thread... Good show Nikon!
FYI: the AF-S 50mm f/1.4G prime is one of the few FX lens that I personally have found to work extremely well on DX and yields a fabulous 75mm portrait lens... with compelling bokeh... enough said
Hope this helps Jim Bianco
I wish you well on your journey... namaste