我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
当前回答
我很早就开始学习编程了。那时我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,我将它声明为一个向量。
其他回答
不用分析我就能知道性能问题出在哪里
我相信创建程序就像在课堂上教的一样……你和一群人坐在一起,讨论一个问题,想出一个解决方案,等等。相反,现实世界是“这是我的问题,我需要解决它,开始”,十分钟后你又遇到了另一个问题,让你没有真正的时间来有效地计划解决方案。
我仍然对以下的一些误解感到困扰——尽管我知道这些误解是正确的,但我仍然试图抓住它们不放:
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.
字节和字符实际上是一回事——“ASCII”只是将字节值映射到屏幕上的符号的一种方式。
阅读关于Unicode的文章真的让我大开眼界(尽管我仍然没有完全理解它)。
我曾经认为ie6的盒子模式是微软为了破坏与其他浏览器的兼容性而想出的一个邪恶的愚蠢想法。
大量的csing使我相信它更符合逻辑,并且可以使页面设计维护(更改块填充/边框/页边距)更容易。
想想现实世界:改变A4页面的边框宽度并不会改变页面宽度,只会减少内容的空间。