|
|
|
|
|
by Fr0styMatt8
4054 days ago
|
|
I agree with you in principle but find that code editors let me down in that regard. Say I split a function up into a few sub-functions because it's getting big. Now I have the problem that I'm jumping forwards and backwards through the code when I want to explore what that function does: SomeMassiveFunction()
{
SubfunctionA();
SubfunctionB();
SubfunctionC();
SubfunctionD();
} SubfunctionA()
{
}
.... In this case, SubfunctionC() might end up a few pages down in source code. So now it's a context switch to go there and then go back. Now this can be somewhat avoided with good function names (so you don't HAVE to jump backwards and forwards) and keyboard shortcuts (to make the process quicker), but it's still a trade-off that I think needs to be kept in mind. |
|
In the best case you should be able to follow the logic without diving into the other functions, only looking at their implementation details as that particular detail becomes relevant.