Since finding a work environment where you work solely with top-level talent is exceedingly rare (especially outside of tech-hub areas), it's important to figure out how to maximize the talent that you have available.<p>What techniques/rules have you implemented that help teach devs the importance of things like: SOLID Principles, Law of Demeter, Principle of Lease Astonishment, etc.?<p>I work in a fairly standard corporate environment. Initially we tried to just enforce these things solely through code reviews, but it seems like they just mechanically make the suggested changes without really learning why it matters. Even most junior devs seem to have an academic grasp of things like the Single Responsibility Principle, but at some point during implementation that falls apart.<p>In my experience this has been a common theme across environments (both large and small) that I have dealt with and I'm very curious to hear how others are handling it.
In my first CAD job, the way standard practices were ingrained was by having junior team members, i.e. me, be assigned to check the work of more experienced team members. It got fresh eyes on established habits, it exposed me to more complicated work and hence more complicated issues, and made reviews a two way street - I learned to see things through the eyes of those reviewing my work, and those further up the food chain did not get a free pass to the idea that the-right-way-is-whatever-way-I-do-it.
I've found that detailed code review before code makes it to master helps enforce these principles and sets a precedent for future code. Gerrit is a nice tool for this <a href="http://code.google.com/p/gerrit/" rel="nofollow">http://code.google.com/p/gerrit/</a>.
By example. Seriously.<p>I've been plenty of places where the edicts are passed down to the... "little people". They/we can end up jumping exhaustedly through endless rounds of process.<p>Then, the shit hits the fan, or a senior manager simply can't be bothered, and process is suddenly out the window.<p>Imagine the impression that leaves on everyone who's been running the process maze.<p>Demonstrate that it matters and serves a purpose. And keep it sane.<p>All the rest is just talk.