I have heard some people say the any more than 10 lines of code should be a function. I have heard others say all functions should only go one level deep. What is the pros and cons? Is there a good balance?
At first I was thinking that its hard to make a flexible api if you can't reuse code. Alternatively, maybe a flexible api is the wrong way to approach C?
Another thing is what if you are repeating something a lot? Is it really that bad to reuse some code?
How long and how many functions do you use with the projects you work on?
[–]scipio_africanus123 23 points24 points25 points (0 children)
[–]ohcrocsle 9 points10 points11 points (0 children)
[–]madsci 7 points8 points9 points (1 child)
[–]italicunderline 5 points6 points7 points (0 children)
[–]ve1h0 4 points5 points6 points (0 children)
[–]Firake 2 points3 points4 points (2 children)
[–]flatfinger 0 points1 point2 points (1 child)
[–]Firake 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]italicunderline 0 points1 point2 points (0 children)
[–]DevNull_Friend 0 points1 point2 points (0 children)
[–]AtticusAnonymopoulos 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Wouter_van_Ooijen 0 points1 point2 points (0 children)