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?


当前回答

与其让他们写代码,不如让他们维护代码。

除非他们不得不维护他们那堆冒着热气的意大利面,否则他们永远不会明白自己在编码方面有多糟糕。

其他回答

通过例子。告诉他们正确的道路。

慢慢来。不要因为他们的每一个小错误就立刻痛斥他们,要从真正重要的事情开始。

他们可能也认为你的风格很糟糕。让团队一起讨论一套一致的编码风格指南。同意某事。这是否适合你的风格并不是问题,选择任何风格只要它是一致的才是重要的。

介绍代码标准的思想。关于代码标准最重要的事情是它提出了代码库的一致性(理想情况下,所有的代码都应该看起来像由一个人一次编写的),这将导致更容易理解和可维护的代码。

代码标准的想法是一个很好的想法。

但考虑一下不要说什么,尤其是因为这是为了好玩,而且大概是和你的朋友。这只是代码……

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