Thanks for the suggestion. I have two comments:
- I don’t like having having a
logger Loggerargument in the default creation function as in most cases the default will just work fine. Thus, I’d force regular users to always passnil, making the call more complicated. That might be not too bad right now, but I’d rather not end up with something likeNewFoo(3, nil, nil, nil). NewBarnot constructingFooseems reasonable. My intention was to hide the complexity for regular users. In most cases they don’t need to know and also don’t need to care that there even is theFooobject. Thus, adding it toNewBarmakes it more complicated for them without good reason. I’ll have to think about this a little more.