Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
466 views
in Technique[技术] by (71.8m points)

documentation - How to convince people to comment their code


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The best way to convince a person is to make them realize it on their own. Make them debug well commented code. It will show them what good commenting looks like - comments are no use unless they really convey relevant information (which is usually the "why", because the code describes the "what"). They will notice how easy it is. Then let them get back to some of their old code. They will notice how hard it is. You have not only shown them what not to do, but what to do (this is more important). You don't have to do any more. What's more, you don't have to try and convince them verbally. They simply must understand the need to comment code in their own way. This is of course, assuming that the code that needs to be commented is not self explanatory.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...