The tag has no wiki summary.

learn more… | top users | synonyms

96
votes
13answers
20k views

Is it OK to split long functions and methods into smaller ones even though they won't be called by anything else? [duplicate]

Lately I've been trying to split long methods into several short ones. For example: I have a process_url() function which splits URLs into components and then assigns them to some objects via their ...
3
votes
3answers
556 views

Should a method do one thing and be good at it?

"Extract Till You Drop" is someting I've read in Uncle Bob's blog, meaning that a method should do one thing alone be good at it. What is that one thing? When should you stop extracting methods? ...
42
votes
6answers
2k views

Refactoring into lots of methods - is this considered clean or not?

So, I watched as my colleague complained a bit about a project he has inherited from someone who is, shall we say, not very experienced as a programmer (intern left to his own devices on a project). ...
12
votes
8answers
689 views

How and why to decide between naming methods with “get” and “find” prefixes

I always have trouble figuring out if I should name a certain method starting with getSomething versus findSomething. The problem resides in creating helpers for poorly designed APIs. This usually ...
8
votes
2answers
313 views

Refactoring several huge C++ classes / methods. How to start? [duplicate]

Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count ...
2
votes
3answers
97 views

Efficient Summary calculation method or approach?

I have an object hierarchy with a number of leaf nodes that will contribute to summary values for the parent object (specifically: project cost and square footage). What's the most efficient way to ...