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

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

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

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


当前回答

我的错误假设:虽然总是有一些改进的空间,但就我而言,我已经是一个尽可能好的程序员了。

当我刚从大学毕业的时候,我已经用C语言编程6年了,知道所有关于“结构化编程”的知识,认为“OO”只是一种时尚,并认为“天哪,我很好!!”

十年后,我在想“好吧,那时候我远没有我想象的那么好……现在我有了多态性的想法,以及如何编写干净的OO程序…现在我真的很好。”

所以,不知何故,我总是很好,但也总是比以前好得多。

在那之后不久,我终于有了“一些”谦卑。总是有更多的东西要学(还没有用像Haskell这样的纯函数式语言写一个合适的程序)。

其他回答

做事总有一种“正确”的方式。大学毕业后很长一段时间,我一直抱着这个想法。

当然,我意识到完成一项任务总有很多种方法。每种方法都有优点和缺点。查看可用的信息,做出决定,然后确保你能向你的老板证明这一点。

My co-workers were/are producing supposedly bad code because they sucked/suck. It took me a while to learn that I should first check what really happened. Most of the times, bad code was caused by lack of management, customers who didn't want to check what they really wanted and started changing their minds like there's no tomorrow, or other circunstances out of anyone's control, like economic crysis. Customers demand "for yesterday" features because they are stupid: Not really. It's about communication. If someone tells them it everything can really be done in 1 week, guess what? they'll want it in 1 week. "Never change code that works". This is not a good thing IMO. You obviously don't have to change what's really working. However, if you never change a piece of code because it's supposedly working and it's too complex to change, you may end up finding out that code isn't really doing what it's supposed to do. Eg: I've seen a sales commission calculation software doing wrong calculations for two years because nobody wanted to maintain the software. Nobody at sales knew about it. The formula was so complex they didn't really know how to check the numbers.

学习语言就是学习语法,以及标准库中最常见的部分。

字节码解释的语言(如c#或f#)比那些直接编译成机器代码的重置按钮慢。

好吧,当我开始有这样的信念时(在80年代),这是真的。然而,即使是在c#中,我有时也会想“把这个内循环放到一个。cpp -文件中是否会让我的应用程序运行得更快”)。

幸运的是,没有。

可悲的是,我几年前才意识到这一点。

人们会关心最佳实践,甚至一致性。