What to name a method
- by coffeeaddict
I'm debating what to name this method.
CloseCashTransaction(Cash.Id, -1, true);
or
CompleteCyberCashTransaction(Cash.Id, -1, true);
or neither are good?
In business terms/process by sending in these 3 values I'm essentially "closing the transaction" or "completing the transaction" in our workflow.
However on the developer side, I cant' infer wtf "Complete" or "Close" means. It forces me to look into the internals of the method. My struggle is that I try to name methods to infer what they are doing. Complete is just way too general and forces the consumer of the method to dive into the code every time I use words like this.
When I see stuff like this all over code, I have to take so much time to figure out what they are actually doing. And if the comments suck, I end up having to look at all logic in that method because the comments nor the method name really infer what's going on.