3 ms·
I don't agree with the space in the users given example. If those were each 4-5 lines of distinct functionality it makes sense but if every line gets called "di
by twymer 16y ago
I don't agree with the space in the users given example. If those were each 4-5 lines of distinct functionality it makes sense but if every line gets called "distinct" and you have almost as much white space as text that's silly.
I definitely think it improves readability to break up these chunks of functionality. The problem, though, is I can't think of a good example that I don't think will have someone tell me to put them in two different methods...
- nitrogen 16y agoMaybe different philosophies apply to newer languages, but I've heard it said that in C your main functions should be more than just a list of function calls, and a function should only be extracted if it's either impossible to read otherwise, or used more than once. Maybe that's less important now that function call overhead is minimal compared to everything else. I will note, however, that function call overhead still adds up. Qt4 on GNOME is significantly slower delivering events than it needs to be, as every single call stack is over 50 methods deep.