|
|
|
|
|
by jpittis
2542 days ago
|
|
> I typically find it very difficult to understand complex functions It seems to me like "complex" and "ability to understand" mean the same thing, so this phrase doesn't have much meaning. It's difficult to define "ability to understand" / "complex" without using either of those words in the definition. For example, you mention lines of code, nesting and multiple concepts. I tend to agree with your examples, however not necessarily the lines of code. I've seen single large functions that represent an algorithm in a way that's easier to understand than the implementation that breaks it up into tens of little functions. It made liberal use of comments to explain each section of code in the function. I believe its advantage was that when reading, you could simply scroll down the function line by line rather than having to jump all over the file. |
|