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

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

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

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


当前回答

@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来模拟这种行为。

其他回答

至少6年来,我一直坚信,每个问题都只有一个解。

完全不知道不同复杂性的多种算法、空间/时间的权衡、面向对象、功能和命令式、抽象级别和无法确定的问题。当那种幸福的天真被打破时,它打开了一个充满可能性的世界,关上了坐下来建造东西的大门。我花了很长时间才弄清楚怎么选一个然后用它来运行。

他说他懂编程,这肯定是真的!

当我在TI-83上编程时,我认为你不能给变量赋值。因此(忽略这是C代码,不是TI-BASIC)而不是编写

c = c + 1;

我会写

d = c + 1;
c = d;

当我学习+=和++时,我惊呆了。

在开始开发之前,您可以完全理解问题。

我曾经认为我是一个很好的程序员。在那个职位上干了两年。

当你在真空中工作时,很容易把房间填满:-D