3 ms·
one programming style that i think makes things worse is the "how many calls can i make on a single line" programming style. MyObjecter.GetObjectRelatativeTh
by jimjimjim 11y ago
one programming style that i think makes things worse is the "how many calls can i make on a single line" programming style.
MyObjecter.GetObjectRelatativeThingy(ThingyHolder.WhatsMything(IndexKeeper.Get(), OtherWhatsIt.BuildOther( MoonCheese.Intensify(true)))
It's probably a result of the letterbox effect of widescreen monitors and IDEs with horizontal toolbars and status bars.
Is there anything wrong with expanding the idea of 'one purpose per function' into 'one purpose per line' and split it all up into multiple lines with temp vars inbetween.
this gives you benefits of:
- short lines and simple ideas
- easier to set break points
- allows for adding logging between calls.
- allows for setting debug watches on the temp vars
- the compiler tidies any temp vars away so there shouldn't be any extra copying.
- kungtotte 11y agoI like Raymond Hettinger's idea of one concept per line. Sometimes that means having two or even three functions on a single line, sometimes one.