I have a programming horror story i'd love to share
In grad school I am taking an OS course where we are writing our own OS (called yalnix for those of you that have done it before). Basically we are implementing a simplified OS on an emulated machine.
So i'm working in my group and I was going through and adding more features last night. I need to add some more process queues for devices that we are adding support for. In doing so the program stops working so I look into the code to see what was going on. Basically one of my partners decided every time we make a scheaduling decision he would read every queue there is and if they are all empty he would then call the sys_call exit which is a function that kills a process for various reasons (why he would be calling that beats me). So in the syscall exit it then checks to see if a process invoked it or a the other function if it is the other function it halts the machine.
Anyway this solution while ultimatly correct was unessarly complicated and inneffiecent. So I added a counter every time we kill a process and if the number of processes we kill is ever equal to the ammount we have created I halt the OS (as per the assignment instructions). I then proceed to remove his code.
Later he finds out I did this and throws a huge fit because his code was correct. Even though adding more devices required a lot more work because of it and it was effecient. I tried to explain to him his solution wasn't ellegent. It used functions to perform jobs that weren't within the context of that function, required many lines of code, and scaled poorly. I basically replaced it with 3 lines of code that was a simple killed++ and an if.
Here is my question for you, if you were working on a project and someone else found much better solution than you used to implement some function would you be pissed if they replaced it?
This isn't the only time something like this has happend either. Early on before our kernel ran he wrote a vital function that was holding up the whole kernel. It didn't work and he was debugging it, at the same time I was debugging it trying to figure it out also. Then I noticed in the FAQ it talked about this problem, i did what the FAQ said and it then worked. He through a huge fit because I debugged his code.
Should programmers working in teams really be so proud of there work that they let it inhibit the entire development process? Or was I out of line in both of these cases? What do you guys think?
I'd think a buisness wouldn't care who fixed it as long as it got fixed, you have a team for a reason and you need to work with the team. It isn't a compitition it is a team if the project fails everyone fails, if the project succeeds everyone succeeds.