It's not the worst tbh. It looks bad out of context, but given how UDP works, you need some value that represents a specific "connection" to the server.
So what does "magic number" do? Does it cast some magic? Or does it identify a UDP Connection? If the latter, why isn't it named "UDPConnectionID" or something similar? Wouldn't that be much more readable?
Someone who is familiar with UDP would look at this code and know what a "magic number" is, because it's the correct term. UDPConnectionID could actually introduce confusion by creating a new term, rather than using the accepted canonical term for this value.
38
u/gu3st12 Jun 09 '20
It's not the worst tbh. It looks bad out of context, but given how UDP works, you need some value that represents a specific "connection" to the server.