There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
The gateway doesn't need to use the DHCP service - it just needs to see the DHCP server. Although, I'm not 100% convinced that it actually does need to be on the same VLAN as the DHCP server at all. It just needs an interface on the VLAN where the Bonjour services will be located.
The gateway needs an interface in any VLAN where a Bonjour client or service exists, so it can respond to Bonjour broadcasts. So, if your gateway's management interface is on VLAN 172 but the clients are on VLAN 20, you'd need an interface on VLAN 20 from the gateway too. You'd need to add extra VLANs to the vNIC if you're running the gateway on VMWare.
On the HP switch you'd have...
vlan 20
tagged 1
vlan 172
untagged 1
On the gateway, VLAN 172 would be the native VLAN, and VLAN 20 would be tagged.