我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。

你坚持时间最长、最终被纠正的假设是什么?

例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。

坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。


当前回答

当然,您可以查看FindBugs和PMD,但这些是我最喜欢的陷阱和技巧(所有Java):

字段没有被覆盖,而是被遮蔽。

没有显式的super。超级访问。

未定义构造函数的类具有隐式零参数构造函数。今年我犯了一个与此相关的实际错误。

要获得对内部类的父类的引用,可以使用“Outer”语法。这“消除方法调用或同步的歧义”。

在c++术语中,类是“它们自己的朋友”,该类的任何实例的私有方法和字段都可以从同一类的任何方法引用,甚至是静态方法。这将使我早期的一些clone()和copy构造函数简单得多。

在扩展类的静态上下文中可以访问受保护的方法和字段,但前提是该类在同一个包中。我很高兴flex.messaging.io.amf不是一个密封的包。

其他回答

编程是给后辈的,最好的项目经理是不会编程的人。

“这次会成功的”

临时的解决方案不是永久的解决方案 或者换句话说:变通办法不是永远的:))。

我一直认为,任何为任何语言编写任何代码的人都会使用编辑程序。

I was working with a client of mine who had me on mostly as support and to write some of the more complex things for him. Well one day he messed up a file, big time. He accidentally saved over three hours worth of his own work, and when I asked him why he didn't save more often he replied with, "because I wasn't done". Naturally, this was not an acceptable answer, and I poked and prodded a little further. I eventually came to find out that he he has never used any editing program, EVER! Not even notepad.exe! He had been using an online CPanel editor for files! It didn't even have a 'Find' function. He couldn't ever save until he was done because he was editing the live file on the site!

不用说,我很惊讶,他至今仍在使用CPanel编辑器……

我是一个优秀的程序员!