TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

6 点作者 unfug超过 11 年前
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 条评论

brudgers超过 11 年前
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 未加载
zachlatta超过 11 年前
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 未加载
pasbesoin超过 11 年前
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.