TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you teach/enforce programming best practices?

6 pointsby unfugover 11 years ago
Since finding a work environment where you work solely with top-level talent is exceedingly rare (especially outside of tech-hub areas), it&#x27;s important to figure out how to maximize the talent that you have available.<p>What techniques&#x2F;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&#x27;m very curious to hear how others are handling it.

3 comments

brudgersover 11 years ago
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.
评论 #6791100 未加载
zachlattaover 11 years ago
I&#x27;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:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;gerrit&#x2F;</a>.
评论 #6791023 未加载
pasbesoinover 11 years ago
By example. Seriously.<p>I&#x27;ve been plenty of places where the edicts are passed down to the... &quot;little people&quot;. They&#x2F;we can end up jumping exhaustedly through endless rounds of process.<p>Then, the shit hits the fan, or a senior manager simply can&#x27;t be bothered, and process is suddenly out the window.<p>Imagine the impression that leaves on everyone who&#x27;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.