Hacker News new | ask | show | jobs
by blumomo 1610 days ago
Good read about how learning in general and learning to become a more experienced programmer especially is related to various types of “cognitive load”, a hypothetical model in learning psychology.

I'm in the camp of writing code in a way that requires a higher „germane cognitive load“ in juniors for the benefit of writing less but more robust, extendible and fast/easy to read code for seniors. I acknowledge that this method only works best for programmers with a longer background in practicing our craft. That is why junior engineers who work with me are given more time to learn the levels of abstractions that our systems are made up. This extra time allows to build up mental models around the abstractions — which increases the junior’s germane load and thus slows their speed for shipping code modifications. Maybe in the future, we will see distinct micro services in our systems which evolve together with involved engineers: services written and maintained by junior programmers will better support intrinsic cognitive load and avoid too much germane load, and as the service’s responsible programmers will grow so will the seniority and thus the level of abstractions of a service grow to eventually reduce lines of code written while increasing robustness and extensibility of the code. As such a transition requires a higher germane cognitive load — using the terminology from that article — juniors will need to be assigned new system services which can reflect their current capabilities: significant more but easy to read code due to less abstractions.

The article ends with a well balanced summary catering for all levels of programming seniorities, read: inclusion.

> Producing maintainable software depends on readable code, and readable code depends on controlling cognitive load. Successful abstractions minimise cognitive load - particularly, they avoid extrinsic load, and provide a smooth transition from germane to intrinsic load. Creating ever higher layers of abstraction just to reduce the number of keystrokes we need to make may not always be the right thing to do. Instead, by recognising that code reading is essentially a learning process, and considering how each line of code we write will be processed in the mind of the reader, we increase our chances of creating understandable, maintainable software.