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

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

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

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


当前回答

以前从未见过整数提升… 并认为'z'在这段代码中可以容纳255:

unsigned char x = 1;
unsigned char y = 2;
unsigned char z = abs(x - y);

z的正确值是1

其他回答

私有成员变量是实例私有的,而不是类私有的。

理解指针和递归是非常困难的。

VB6中的Integers与。net大小不同。

VB6可以进行位级操作。

专业程序员制作没有bug的软件。

所有的语言(大部分)都是平等的。

在很长一段时间里,我认为语言的选择对开发过程的难度和项目成功的潜力并没有太大的影响。这绝对不是真的。

为工作选择正确的语言与任何其他单个项目决策一样重要/关键。

c++在本质上比所有其他语言都要好。

这是我在大学前几年从一个朋友那里收到的。我带着它很长一段时间(我现在脸红了)。只有在与它一起工作了2年左右之后,我才能看到它们的裂缝是什么。

没有人,也没有什么事是完美的,总有改进的空间。

我很早就开始学习编程了。那时我14岁左右。我有各种疯狂的想法,但不要问我准确的时间,因为那是很久以前的事了。

Ok, so, I believed for a while that if you use the term synchronize in Java, then Java solves this nasting synchronizing thing for you I believed for at least half a year, likely more, that static typing would improve performance. I believed that freeing something would return memory back to the OS. I believed that malloc calls boil down to checking if there is enough free space on the OS, so malloc would be inexpensive. I thought a long while that Java was built with all the benefits and flaws of the other languages in mind, into a "perfect blend" that would take the best properties of the other languages and reject the mistakes. I vastly overestimated the number of cases where LinkedLists outperform ArrayLists. I thought that NP-hardness was a proof that no INSTANCE could be solved efficiently, which is trivially false, for a while. I thought that finding the best flight-plan on travel agency web sites would take so long because of the "Travelling Salesman Problem", as I proudly chuckled to my relatives (when I was small, alright?!)

还能想出更多。不知道我坚持了多久。对不起。

PS: 啊,好吧,这个被清除得并不慢,但我看到新手时不时地这样做,所以我想你可能会感兴趣:我还认为要存储不确定数量的东西,你需要为每个东西声明一个新变量。所以我要创建变量a1 a2 a3…,而不是使用一个变量a,我将它声明为一个向量。