Re: big function vs many small functions
- From: gremnebulin <peterdjones@xxxxxxxxx>
- Date: Tue, 25 Sep 2007 13:36:19 -0000
On 25 Sep, 13:30, teke...@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?
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?
Separate functions. I've seen code with switches inside switches.
Nasty.
.
- References:
- [Q] big function vs many small functions
- From: t.j.
- [Q] big function vs many small functions
- Prev by Date: [Q] big function vs many small functions
- Next by Date: Re: [Q] big function vs many small functions
- Previous by thread: [Q] big function vs many small functions
- Next by thread: Re: [Q] big function vs many small functions
- Index(es):
Relevant Pages
|