skynetservices / skydns1

DNS for skynet or any other service discovery
MIT License
528 stars 54 forks source link

Server members are all private #66

Closed miekg closed 10 years ago

miekg commented 10 years ago

Why are all the members of the Server struct private? We now need accessor function like DNSaddr() and HTTPaddr() which just return a private member.

Why not make member for which it makes sense public? Would reduce the code a bit.

crosbymichael commented 10 years ago

One plus for getters is that it works with interfaces where fields do not. I can think of a few examples where we may want to make Server and interface in the future and would have to revert the public fields.

miekg commented 10 years ago

I don't like having code or writing code for some future event. On the other hand, it is probably not worth cleaning up at this point. On the other other hand, I might see what the actual code reduction is, if is really big, I might be tempted to make this change.