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

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

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

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


当前回答

对Unicode的全面支持是成功将软件部署到亚洲地区的先决条件。

其他回答

In the early days, most personal computers had a cassette tape interface for loading and storing programs. I did not have a computer at this time but read everything I could get my hands on (mostly magazines) that had anything to do with computers (this was the late 70's - no internet for me). For some reason I was under the impression that programs were executed directly from the cassette tape and that the only reason computers had any RAM was to store variables while the program ran. I figured that when the code had to execute a jump instruction, it would somehow rewind or advance the tape to the correct position and continue from there.

OOP的好处是你可以重用对象,而实际上它是通过创建一个具有相同接口的新对象来重用其余的代码。

实际上,对象可能占代码的2%,因此重用只会给您带来2%的好处。真正的好处是通过创建一个新对象来重用其他98%的代码,从而允许所有其他代码完全不同。现在您重用了98%的代码。把一个东西写为一个对象所花费的时间延长3倍是值得的。

例如,如果你有一个绘图程序,突然有一个你想要绘制的新形状,你只需要改变ShapeObject(同时保持界面相同)。项目中的其他内容都不需要改变。

在不浪费字节和CPU周期的情况下编写高效的程序是非常重要的。

但随着经验的积累,它与字节或CPU周期无关,它与你的思想流有关,连续的,不间断的,就像一首诗。

本质上,不要太努力。

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

通过实现客户想要的东西来满足客户——不幸的是,这意味着客户知道他想要什么。