2 ms·
I think the bit about the definition of multiplication could be applied to code as well: A source file necessarily contains all possible logic flows, no matter
by xg15 5y ago
I think the bit about the definition of multiplication could be applied to code as well: A source file necessarily contains all possible logic flows, no matter if a flow represents the main operation, an obscure special case or parts that are completely unused or practically unreachable. This can easily hide the "gist" of a function among heaps of clutter.
I think some tool would be interesting that took a code traces or coverage information and generated a view of a code file where each line has a font size dependant on how often that line was executed. Ideally, "important" lines would end up with a large font, while special cases, error checks etc would become "fine print".
I'd be curious if this would help making codebases easier to understand.
- WanderPanda 5y agoThat is exactly what profilers do. Xcode gives you a heatmap of what percentage of the execution time has been spent in a particular function (at least in ~2013 when I used this function the last time)
- xg15 5y agoTrue, but I haven't seen profiling results actually applied back to the actual code file, line-by-line.