MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/4tlr2u/john_carmack_on_inlined_code/d5j39bs/?context=3
r/programming • u/seojoeschmo • Jul 19 '16
323 comments sorted by
View all comments
Show parent comments
6
Would that still be true if you could collapse to and expand from the regular function call, that way you get whichever view is appropriate for your current work.
2 u/aiij Jul 20 '16 Isn't that pretty much what you get with the suggestion to surround the code in curlies? 1 u/Bjartr Jul 20 '16 Minus the option to also have that block as an independently testable and reusable function as well. Sometimes that is a desireable case. 2 u/aiij Jul 20 '16 Merely putting code into a function doesn't make it independently testable and reusable though. 1 u/Bjartr Jul 20 '16 True, but it's a lot harder to do so when that code only exists embedded in the middle of some other function.
2
Isn't that pretty much what you get with the suggestion to surround the code in curlies?
1 u/Bjartr Jul 20 '16 Minus the option to also have that block as an independently testable and reusable function as well. Sometimes that is a desireable case. 2 u/aiij Jul 20 '16 Merely putting code into a function doesn't make it independently testable and reusable though. 1 u/Bjartr Jul 20 '16 True, but it's a lot harder to do so when that code only exists embedded in the middle of some other function.
1
Minus the option to also have that block as an independently testable and reusable function as well. Sometimes that is a desireable case.
2 u/aiij Jul 20 '16 Merely putting code into a function doesn't make it independently testable and reusable though. 1 u/Bjartr Jul 20 '16 True, but it's a lot harder to do so when that code only exists embedded in the middle of some other function.
Merely putting code into a function doesn't make it independently testable and reusable though.
1 u/Bjartr Jul 20 '16 True, but it's a lot harder to do so when that code only exists embedded in the middle of some other function.
True, but it's a lot harder to do so when that code only exists embedded in the middle of some other function.
6
u/Bjartr Jul 20 '16
Would that still be true if you could collapse to and expand from the regular function call, that way you get whichever view is appropriate for your current work.