You've had some excellent suggestions in the comments but I have yet to see the following as a tactic to try that has worked for me.
Add a mentorship role to their responsibilities where they oversee the operational maintenance of the code they write, with one iron rule: to promote the mentees' advancement, the clever coder is not ever able to further git commit to code they wrote until the mentee commits N number of changes to a chunk of code/documentation/tests they're trying to understand. The more operational the setting, even up to and including live production support at a call center, the better.
Clever code stops delivering benefits when the overall group/organization cannot support it in live operations under contracted SLA's. Clever, immature coders invariably go through a phase where they learn there is a giant step function change between coding for themselves or a tight knit peer group of clever coders and coding for an audience. Clever, mature coders expand their tooling way beyond coding to deliver for an audience. There are ways to effectively, operationally support clever code, but those solutions aren't just implemented in code.
It didn't use to be this way when our industry was orders of magnitude smaller, but the economics of the software industry nowadays has changed the dynamic. Our industrialization phase currently favors and rewards solutions at scale maintained by organizations larger than most tight-knit clever coder teams can sustain. Such clever teams are still critical for startups or insulated projects within larger organizations, but the price tag of monetization is this type of maturation.
Add a mentorship role to their responsibilities where they oversee the operational maintenance of the code they write, with one iron rule: to promote the mentees' advancement, the clever coder is not ever able to further git commit to code they wrote until the mentee commits N number of changes to a chunk of code/documentation/tests they're trying to understand. The more operational the setting, even up to and including live production support at a call center, the better.
Clever code stops delivering benefits when the overall group/organization cannot support it in live operations under contracted SLA's. Clever, immature coders invariably go through a phase where they learn there is a giant step function change between coding for themselves or a tight knit peer group of clever coders and coding for an audience. Clever, mature coders expand their tooling way beyond coding to deliver for an audience. There are ways to effectively, operationally support clever code, but those solutions aren't just implemented in code.
It didn't use to be this way when our industry was orders of magnitude smaller, but the economics of the software industry nowadays has changed the dynamic. Our industrialization phase currently favors and rewards solutions at scale maintained by organizations larger than most tight-knit clever coder teams can sustain. Such clever teams are still critical for startups or insulated projects within larger organizations, but the price tag of monetization is this type of maturation.