我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
我正在对初级(也许是高级)软件工程师所犯的常见错误和错误假设进行一些研究。
你坚持时间最长、最终被纠正的假设是什么?
例如,我误解了整数的大小不是标准的,而是取决于语言和目标。说起来有点尴尬,但事实就是这样。
坦率地说;你有什么坚定的信念?你大概坚持了多长时间?它可以是关于一种算法、一种语言、一个编程概念、测试,或者任何关于编程、编程语言或计算机科学的东西。
当前回答
代码越少越好。现在我知道,有时候如果代码行数更多,就更容易阅读/理解,这是值得的
其他回答
做事总有一种“正确”的方式。大学毕业后很长一段时间,我一直抱着这个想法。
当然,我意识到完成一项任务总有很多种方法。每种方法都有优点和缺点。查看可用的信息,做出决定,然后确保你能向你的老板证明这一点。
用汇编语言进行优化=重写。
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...
后藤是有害的。
现在我们决定是继续还是中断。
作为一名老的过程式程序员,当我第一次开始为一个业余项目用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.
这个:
SomeClass object(initialValue);
这:
SomeClass object = initialValue;
保证在c++中是等价的。我认为第二种形式肯定会被解释成第一种形式。并非如此:请参阅c++初始化语法。