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

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

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

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


当前回答

在很长一段时间里,我认为糟糕的编程是发生在边缘的事情。正确做事是标准。我现在没那么天真了。

其他回答

至少6年来,我一直坚信,每个问题都只有一个解。

完全不知道不同复杂性的多种算法、空间/时间的权衡、面向对象、功能和命令式、抽象级别和无法确定的问题。当那种幸福的天真被打破时,它打开了一个充满可能性的世界,关上了坐下来建造东西的大门。我花了很长时间才弄清楚怎么选一个然后用它来运行。

我在计算机科学课程中所学的Karnaugh地图在编程中永远找不到实际用途。

:

for (int i = 0; i < myObj.variable; i = i + 1)

优化为:

int j = myObj.variable; 
for (int i = 0; i < j; i = i + 1)

哇,当我意识到它们每次都在运行时,我停止在j的地方放入函数调用!

原因:

for (int i = 0; i < myObj.variable; i = i + 1){ 
    if (function_argument == NULL){ 
        myObj.variable++; 
    } else { 
        printf("%d", myObj.variable);
    }
}

并不等同于:

int j = myObj.variable;
for (int i = 0; i < j; i = i + 1){ 
    if (function_argument == NULL){ 
        myObj.variable++; 
    } else { 
        printf("%d", myObj.variable);
    }
}

任意的例子,但是您可以看到优化将如何改变执行。

“这次会成功的”

I thought I'd be coding for 8 hours straight. Realistically, I get 4 hours a day of coding, 1 hour for lunch, 1 for coffee breaks, and 2 for screwing around / chit chatting/ stack over and under flowing. Prior to working, I thought that all clients would be idiots and don't know two craps about computers. Boy was I wrong on that one. Sometimes, we get projects by people who can do it better than we can, they just don't have the time to do it. I thought cubicles were bad, Right now I love them :D I actually moved from a door-ed office to a cubicle. I like the openness. All programmers are not athletic. I thought that I was the only one that goes to the gym. Where I work, at least 10 of us go to the gym every day at 5 am. I thought there would be no women programmers. A couple of our leads are ladies.