Re: [Q] big function vs many small functions
- From: Steve O'Hara-Smith <steveo@xxxxxxxxxx>
- Date: Tue, 25 Sep 2007 15:34:38 +0100
On Tue, 25 Sep 2007 12:30:06 GMT
tekenen@xxxxxxxxxxx (t.j.) wrote:
Let's say that one has a function with a large switch statement with
many case statements.
One way of writing the function is to just place all of the code for
each case inside of the function containing the switch statement.
Another would be to have an individual function for each case statement.
Which way is better in terms of maintainability and frequency of bugs?
If you can get the switch down to readable size using an individual
function for each case that will help. OTOH if you cannot then it is probab
I recall reading something where someone actually studied this situation
and determined there was no meaningful difference between the two.
Anyone else come across the same thing?
--
C:>WIN | Directable Mirror Arrays
The computer obeys and wins. | A better way to focus the sun
You lose and Bill collects. | licences available see
| http://www.sohara.org/
.
- Follow-Ups:
- Re: [Q] big function vs many small functions
- From: Steve O'Hara-Smith
- Re: [Q] big function vs many small functions
- References:
- [Q] big function vs many small functions
- From: t.j.
- [Q] big function vs many small functions
- Prev by Date: Re: big function vs many small functions
- Next by Date: Re: [Q] big function vs many small functions
- Previous by thread: Re: big function vs many small functions
- Next by thread: Re: [Q] big function vs many small functions
- Index(es):
Relevant Pages
|