I've been working with a small group of people on a coding project for fun. It's an organized and fairly cohesive group. The people I work with all have various skill sets related to programming, but some of them use older or outright wrong methods, such as excessive global variables, poor naming conventions, and other things. While things work, the implementation is poor. What's a good way to politely ask or introduce them to use better methodology, without it coming across as questioning (or insulting) their experience and/or education?


当前回答

可能在效果后有点晚了,但这就是一致认可的编码标准是件好事的地方。

其他回答

耐心再怎么强调都不为过。我见过这种完全事与愿违的事情,主要是因为有人希望现在就发生变化。相当多的环境需要进化的好处,而不是革命。今天强行改变,可能会给所有人带来一个非常不愉快的环境。

接受是关键。你的方法需要考虑到你所处的环境。

听起来你所处的环境有很多“个性”。所以…我不建议使用一套编码标准。你会发现你想把这个“有趣”的项目变成一个高度结构化的工作项目(哦,太好了,接下来是什么……功能文件?)相反,正如其他人所说,你必须在一定程度上处理它。

Stay patient and work toward educating others in your direction. Start with the edges (points where your code interacts with others) and when interacting with their code try to take it as an opportunity to discuss the interface they've created and ask them if it would be okay with them if it was changed (by you or them). And fully explain why you want the change ("it will help deal with changing subsystem attributes better" or whatever). Don't nit-pick and try to change everything you see as being wrong. Once you interact with others on the edge, they should start to see how it would benefit them at the core of their code (and if you get enough momentum, go deeper and truly start to discuss modern techniques and the benefits of coding standards). If they still don't see it... maybe you'll need to deal with that within yourself (especially on a "fun" project).

耐心。进化,而不是革命。

祝你好运。

Privately inquire about some of the "bad" code segments with an eye toward the possibility that it is actually reasonable code, (no matter how predisposed you may be), or that there are perhaps extenuating circumstances. If you are still convinced that the code is just plain bad -- and that the source actually is this person -- just go away. One of several things may happen: 1) the person notices and takes some corrective action, 2) the person does nothing (is oblivious, or doesn't care as much as you do).

如果#2发生了,或者从你的角度来看,#1并没有带来足够的改进,并且它正在损害项目,并且/或对你造成了足够的影响,那么可能是时候在团队中开始建立/执行标准了。这需要管理层的支持,但只有从基层做起才最有效。

祝你好运。我能感受到你的痛苦,兄弟。

我和和我一起工作的人有类似的情况。他们不像我那样接触编码,但他们在编码方面仍然很有用。

而不是我让他们做他们想做的然后回去编辑整篇文章。我通常只是让他们坐下来,告诉他们两种做事的方法。他们的方式和我的方式,从这里我们讨论了每种方法的优缺点,因此对我们应该如何进行编程有了更好的理解和更好的结论。

这是真正令人惊讶的部分。有时他们会提出一些连我都不知道答案的问题,经过研究,我们都对方法论和结构有了更好的概念。

讨论。 告诉他们为什么 甚至不要认为你总是对的。有时甚至他们也会教你一些新东西。

如果我是你,我也会这么做

我不是我项目的首席开发人员,因此不能强加编码标准,但我发现糟糕的代码通常会迟早导致问题,当它发生时,我有一个更清晰的想法或解决方案。

通过在当时不插话,采取更自然的方法,我获得了领导更多的信任,他经常向我寻求想法,并让我参与项目的架构设计和部署策略。

如果可能的话,确保他们明白你是在批评他们的代码,而不是针对他们个人。