←back to thread

-2000 Lines of code

(www.folklore.org)
506 points xeonmc | 1 comments | | HN request time: 0.209s | source
Show context
jfengel ◴[] No.44382104[source]
In college I worked for a company whose goal was to prove that their management techniques could get a bunch of freshman to write quality code.

They couldn't. I would go find the code that caused a bug, fix it and discover that the bug was still there. Because previous students had, rather than add a parameter to a function, would make a copy and slightly modify it.

I deleted about 3/4 of their code base (thousands of lines of Turbo Pascal) that fall.

Bonus: the customer was the Department of Energy, and the program managed nuclear material inventory. Sleep tight.

replies(7): >>44382155 #>>44382420 #>>44382634 #>>44382701 #>>44383041 #>>44385840 #>>44390812 #
al_borland ◴[] No.44383041[source]
I work with someone who has a habit of code duplication like this. Typically it’s an effort to turn around something quickly for someone who is demanding and loud. Refactoring the shared function to support the end edge case would take more time and testing, so he doesn’t do it. This is a symptom of the core problem.
replies(3): >>44384293 #>>44386685 #>>44390754 #
Cthulhu_ ◴[] No.44386685[source]
But it's a false premise; the claim is that just copy/pasting something is faster, but is it really?

The demanding / loud person can and should be ignored; as a developer, you are responsible for code quality and maintainability, not your / their manager.

replies(1): >>44386996 #
1. al_borland ◴[] No.44386996[source]
I agree. I always take the time to clean things up along the way, but short term thinning is often incentivized and rewarded.