编程风格重要吗?有多重要? [英] Is Programming Style important? How Important?

查看:19
本文介绍了编程风格重要吗?有多重要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

去年我正在对一个团队成员的代码进行故障排除,但它缺少缩进和注释.我正在和他谈论这件事,告诉他这不是一个好主意,但他被冒犯了.他比我聪明,或者当然受过更多教育.

Last year I was troubleshooting a team member's code and it was lacking indents and comments. I was talking to him about it telling him it was not a good idea but he got offended. He was/is smarter than me or certainly more educated.

从那以后我发现他申请了微软,当他们让他做一个双向链表实现时,他写的时候没有缩进或评论,说他没有时间担心风格.(这是一封电子邮件提交,需要 2 小时才能完成)

Since then I found out he applied to Microsoft and when they had him do a doubly linked list implementation, he wrote it without indentation or comments, stating that he did not have time to worry about style. ( It was an email submission for which there were 2 hours to complete )

微软没有给他回电话.....你认为他们如何回应,你会如何回应?

Microsoft did not call him back..... How do you think they responded, how would you respond?

这里有任何来自 Microsoft 的人可以建议他们在这种情况下会做什么吗?

推荐答案

没有程序员是孤岛.有一天,有人将不得不阅读他们的代码.之前在这里重复过很多次:

No programmer is an island. Someone is going to have to read their code one day. It's been repeated here many times before:

总是像终结者一样编码维护您的代码将是一个知道你在哪里的暴力精神病患者直播.-- Martin Golding (也许)

也就是说,如果他们的风格足够好,那么在招聘程序员时还有其他更重要的事情需要评估.但是,如果他们完全拒绝使用注释或试图使他们的代码对其他人可读,那就是破坏交易了.

That said, if their style is adequate, there are other much more important things to evaluate when hiring a programmer. But if they utterly refuse to use comments or attempt to make their code readable to others, it is a deal-breaker.

这篇关于编程风格重要吗?有多重要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆