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

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

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

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


当前回答

我是一名初出茅庐的年轻开发者,希望从事专业的开发工作,因为这是我所热爱的,以下是我曾经持有的一些观点,这些观点都是我在短暂的经验中学到的,但都是错误的

当你根本不把用户界面和逻辑分开时,你最终会遇到的可怕的混乱是可以接受的,这也是每个人写软件的方式

不存在太多复杂或抽象的东西

一类责任——我从未真正有过这个概念,它对我来说是非常正式的

测试是我在卧室里编写代码时不需要做的事情

我不需要源代码控制,因为它对我所做的项目来说是多余的

开发人员什么都做,我们应该知道如何设计图标和做出漂亮的布局

Dispose并不总是需要结束符

任何类型的错误发生时都应该抛出异常

异常是针对错误情况的,很多时候只返回一个指示失败的值就可以了。我最近才明白这一点,我一直在说这一点,并且在很长一段时间内仍然抛出异常

我可以编写一个完全没有错误的应用程序

其他回答

假设我把代码写得很好,尽可能没有错误,这就是我能做的最好的事情。事实证明,有时候经理们更喜欢那些努力成为他们最喜欢的人,而不是把工作做好的人。

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.

我不知道在Javascript中除以0是无穷大(IEEE 754算术)。最近经历了惨痛的教训。

作为一名老的过程式程序员,当我第一次开始为一个业余项目用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.

不用分析我就能知道性能问题出在哪里