我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
当前回答
像Python或Ruby这样的动态类型语言不太适合用于大型项目。
其他回答
软件的质量会带来更大的销量。有时确实如此,但并非总是如此。
用汇编语言进行优化=重写。
When I first really understood assembly (coming from BASIC) it seemed that the only way to make code run faster was to rewrite it in assembly. Took quite a few years to realize that compilers can be very good at optimization and especially with CPUs with branch prediction etc they can probably do a better job than a human can do in a reasonable amount of time. Also that spending time on optimizing the algorithm is likely to give you a better win than spending time converting from a high to a low level language. Also that premature optimization is the root of all evil...
在很长一段时间里,我认为其他人对所有编程概念(设计模式、最新的新语言、计算复杂性、lambda表达式,只要你能想到的)都了如指掌。
阅读博客、Stack Overflow和编程书籍似乎总是让我觉得自己在所有程序员必须凭直觉知道的事情上落后于潮流。
随着时间的推移,我意识到我实际上是在将我的知识与许多人的集体知识进行比较,而不是单个人,这对任何人来说都是一个相当高的标准。现实世界中的大多数程序员都有完成工作所需的知识缓存,并且有不少领域是他们薄弱或完全不了解的。
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.
评论越多越好。我总是试图让我的代码尽可能具有可读性——主要是因为我几乎肯定是那个会修复我漏过的bug的人。所以在过去的几年里,我经常会收到一段又一段的评论。
最终,我明白了,有一个点,更多的评论——无论结构多么整齐——没有增加价值,实际上成为一个麻烦的维护。这些天,我采取了目录+脚注的方法,每个人都为此感到高兴。