3 ms·
It's nice if after typing `file.` you see what functions you can use. But what if there end up being too many options? What's next, a fuzzy finding search box f
by sureglymop 1y ago
It's nice if after typing `file.` you see what functions you can use. But what if there end up being too many options? What's next, a fuzzy finding search box for all possible functions? Contextually relevant ones based on the code you've already written?
- hnlmorg 1y ago> But what if there end up being too many options? That would suggest the file object needs to be refactored and split. > What's next, a fuzzy finding search box for all possible functions? Contextually relevant ones based on the code you've already written? IDEs already provide both those options.
- sureglymop 1y agoI understand, I think I moreso wanted to hint that there may still be more room for exploration when it comes to things like this. However, while I agree, I do want to challenge you to explain/show if and why this is the case (I know that you wrote "suggest"): > That would suggest the file object needs to be refactored and split.
- hnlmorg 1y agoI don’t want to overly generalise because there aren’t such things as absolutes with programming. But this was the thinking behind my comment: If you have dozens of methods then that might be an indicator that your object is too large in size and thus consumes too much memory even for simple tasks. It also might be a symptom that you’re trying to do too much with that object so perhaps some methods should be generalised, if possible. Or maybe the object is already too generalised and what you actually need is a more specific object that inherits some of the initial objects design? It might be that some of those methods should have been private, or even functions. Ultimately, it could be an indicator that the object is either badly designed or has evolved to the point that it’s now ready for a refactor. But it could also be the most optimal way to approach that problem too. In some situations. However it’s a good point to pause and reflect on whether the pain/reward threshold has been crossed.