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

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

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

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


当前回答

html元素id和name属性是可以互换的。

事实证明,带有'name'属性的元素是相关的/被使用的。引用post等和'id'属性用于DOM引用。

其他回答

XML名称空间(或者更糟,格式良好)在某种程度上比没有它们要困难得多。

一个非常常见的错误,甚至在W3C!

作为一名老的过程式程序员,当我第一次开始为一个业余项目用Java编程时,我并不真正理解OO。编写了大量的代码,却没有真正理解接口的意义,试图通过将所有东西都强制放到继承层次结构中来最大化代码重用——当一个层次结构无法容纳清理时,希望Java具有多重继承。我的代码成功了,但我现在对早期的东西感到畏缩。

When I started reading about dynamic languages and trying to figure out a good one to learn, reading about Python's significant whitespace turned me off - I was convinced that I would hate that. But when I eventually learned Python, it became something I really like. We generally make the effort in whatever language to have consistent indent levels, but get nothing for it in return (other than the visual readability). In Python, I found that I wasn't doing any more effort than I had before with regard to indent levels, and Python handled what I'd been having to use braces or whatever for in other languages. It makes Python feel cleaner to me now.

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

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

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

我一直认为,任何为任何语言编写任何代码的人都会使用编辑程序。

I was working with a client of mine who had me on mostly as support and to write some of the more complex things for him. Well one day he messed up a file, big time. He accidentally saved over three hours worth of his own work, and when I asked him why he didn't save more often he replied with, "because I wasn't done". Naturally, this was not an acceptable answer, and I poked and prodded a little further. I eventually came to find out that he he has never used any editing program, EVER! Not even notepad.exe! He had been using an online CPanel editor for files! It didn't even have a 'Find' function. He couldn't ever save until he was done because he was editing the live file on the site!

不用说,我很惊讶,他至今仍在使用CPanel编辑器……

在c++中,很长一段时间我都在想编译器在给纯虚方法定义时拒绝你。

当我意识到我错了时,我很吃惊。

很多次,当我告诉别人为其抽象类提供其纯虚析构函数的默认实现时,他/她都用大大的眼睛看着我。我知道接下来会有一场长时间的讨论……这似乎在c++初学者中是一个普遍的信念(我认为我自己也是如此)。我目前还在学习!)

Wikipedia链接到c++的纯虚拟方法