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

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

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

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


当前回答

这种编程软件需要扎实的高等数学基础。

在我开始编程之前,我总是被告知要成为一名优秀的程序员,你必须精通高级代数、几何、微积分、三角函数等。

十年后,我只做过一次八年级学生做不到的事。

其他回答

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

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

幸运的是,没有。

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

. net结构体(c#和VB.NET)是引用类型,就像类一样。

我是在。net 1.0出现之前或之后的某个时刻“收到”这条智慧的(我不知道从哪里来的,它可能完全从我的脑海中冒出来,就像雅典娜从宙斯的额头上冒出来一样),并一直保存着它,直到大约4个月前Jon Skeet对这个概念进行了消除。

感谢乔恩。

附注:与编程无关,但我也相信(直到5分钟前)“阿波罗从宙斯的额头上长成了一个完整的阿波罗”。

我仍然对以下的一些误解感到困扰——尽管我知道这些误解是正确的,但我仍然试图抓住它们不放:

All stakeholders will make decisions about software design objectively. Those that aren't embroiled in writing the code make all sorts of decisions based entirely on emotion that don't always make sense to us developers. Project budgets always make sense - I've seen companies that are quite happy to drop [just for example] $50,000 a month for years rather than pay $250,000 to have a project completed in 6 months. The government for one loses their annual budget if they don't spend it - so spend it they will, come hell or high water. It astounds me at how many project dollars are wasted on things like this. You should always use the right tools for the right job - sometimes this decision is not in your hands. Sometimes it comes down from on high that "thou shalt use X technology" for this project, leaving you thinking "WTF! Who came up with that ridiculous idea?"... the guy paying your paycheque, that's who, now get it done. Programming ideology comes first and foremost, everything else is secondary. In reality, deadlines and business objectives need to be met in order to get your paycheque. Sometimes you make the worst decisions because you just don't have time to do it the right way... just as sometimes that word is on the tip of your tongue but the minute it takes to recall it makes you choose a different and less ideal word. There isn't always time to do it right, sometimes there is only time to do it - however that may be. Hence oft' seen anti-patterns used by so called experienced developers who have to knock out a solution to a problem 10 minutes before the presentation deadline for the software being delivered to your best client tomorrow.

当主流设计模式在计算机科学课上被引入时,我认为它们很棒。在此之前,我有8年的编程经验,对于如何创建好的抽象概念,我真的没有扎实的理解。

设计模式就像魔法一样;你可以做一些很棒的事情。后来我发现了函数式编程(通过Mozart/Oz、OCaml、后来的Scala、Haskell和Clojure),然后我明白了许多模式只是样板,或者额外的复杂性,因为语言表达能力不够。

当然,几乎总是有某种模式,但它们在表达性语言中处于更高的层次。现在我一直在用Java进行一些专业编码,当我不得不使用访问者或命令模式等惯例而不是模式匹配和更高阶函数时,我真的感到很痛苦。

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

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

z的正确值是1