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

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

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

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


当前回答

@Kyralessa: It's worth noting that on most processors, in assembly/machine language, it's possible for functions to return someplace other than their caller while leaving the stack in good condition. Indeed, there are a variety of situations where this can be useful. One variation I first saw on the 6502, though it works even better on the Z80, was a print-message routine where the text to be printed immediately followed the call instruction; execution would resume after the zero terminator (or, as a slight optimization when using the Z80, at the zero terminator, since letting the zero byte be executed as a NOP would be cheaper than trying to avoid it).

有趣的是,在许多现代语言中,函数都有一个正常的退出点(将在调用之后恢复执行),但也可以通过抛出异常退出。即使在C语言中,也可以使用setjmp/longjmp来模拟这种行为。

其他回答

我可能花了几天时间试图减少业务层使用的内存,后来才意识到项目的WinForms (GUI)使用的内存是应用程序其他部分的4倍多。

所有面向对象语言都有相同的面向对象概念。

Java接口=方法的接口。 Java接口是针对需要具有多重继承的特定于语言的解决方案。Ruby的mixin尝试解决同样的问题。 Javascript中提供的开箱即用的继承与Java实现继承的方式非常不同。

该条件检查如下:

if (condition1 && condition2 && condition3)

以不确定的顺序执行…

就查询性能而言,SQL WHERE子句中整数的位比较实际上是免费的。

碰巧,对于前50万行左右来说,这在某种程度上是正确的。在那之后,它被证明是完全无联合国的。

I thought I'd be coding for 8 hours straight. Realistically, I get 4 hours a day of coding, 1 hour for lunch, 1 for coffee breaks, and 2 for screwing around / chit chatting/ stack over and under flowing. Prior to working, I thought that all clients would be idiots and don't know two craps about computers. Boy was I wrong on that one. Sometimes, we get projects by people who can do it better than we can, they just don't have the time to do it. I thought cubicles were bad, Right now I love them :D I actually moved from a door-ed office to a cubicle. I like the openness. All programmers are not athletic. I thought that I was the only one that goes to the gym. Where I work, at least 10 of us go to the gym every day at 5 am. I thought there would be no women programmers. A couple of our leads are ladies.