3 ms·
You keep saying this, but it doesn't make a lot of sense. Your initial pretense was that you always make 3 objects, so move it into a function. When people sh
by axaxs 5y ago
You keep saying this, but it doesn't make a lot of sense.
Your initial pretense was that you always make 3 objects, so move it into a function.
When people show how to accomplish that, you state 'well what about my test that doesn't need all three?'
Why are you testing things your code doesn't do?
- Arnavion 5y ago>When people show how to accomplish that, you state 'well what about my test that doesn't need all three?' You've phrased this as if I said this after I'd been given a solution for the initial problem. In reality, I mentioned this in the original post itself, but it seems many people didn't read it. It's almost like I have prior real-world experience of this problem, where I already went down the path of making common functions for all the creation and cleanup respectively, only to find that it doesn't help when all the functions don't create the same subset of things. >Why are you testing things your code doesn't do? I have no idea how you came to this conclusion.
- axaxs 5y agoHey, I didn't mean to come across as rude but when I reread it, it was. I wasn't expressing myself well, I apologize. I've been a Go mentor for years, and see how people take concepts they are used to and try to shoehorn them in, and complain they are ugly. In this case, when I first saw your examples, my thought was 'youre doing it wrong'. But not wrong as in incorrect, but now how the language was designed. If you truly care we can go through scenarios and I can tell you how I'd approach it. But in my past experience, when people find a paradigm they like, they tend to not listen.