Timeline for One-line functions that are called only once
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 28, 2017 at 13:32 | history | edited | Deduplicator | CC BY-SA 3.0 |
added syntax-highlighting
|
S Oct 19, 2016 at 13:35 | history | suggested | Wolf | CC BY-SA 3.0 |
simplified code formatting, fixed typos (interested in removing my downvote after rethinking this alternative aspect)
|
Oct 19, 2016 at 6:03 | comment | added | Wolf | @Kache I think it depends on whether you code object-oriented or not, in the OOP case, the use of member function keeps the design much more flexible. It really depends on the context... | |
Oct 19, 2016 at 5:59 | review | Suggested edits | |||
S Oct 19, 2016 at 13:35 | |||||
Oct 19, 2016 at 4:44 | comment | added | Kache | @Wolf OTOH, I prefer this to a function call in order to reduce the "abstraction depth" of code. IMO, jumping into a function is a larger context switch than an explicit and direct couple lines of code, especially if it just returns a boolean. | |
Jan 9, 2015 at 9:22 | comment | added | Wolf | I experienced this advice a bad idea: the bool and the condition distract attention from the core business of the function. Also, a style preferring local variables make refactoring harder. | |
Sep 12, 2011 at 20:01 | comment | added | dbkk |
The bool is particularly beneficial if the condition function name would be difficult or possibly misleading (e.g. IsEngineReadyUnlessItIsOffOrBusyOrOutOfService ).
|
|
Sep 12, 2011 at 15:15 | history | answered | cybevnm | CC BY-SA 3.0 |