Working with other people's code
Working on someone else's code might be challenging or not, dependind on your coding habits, the original coder habtis, and the sort of problem the code is solving.
I once had to work on a program somebody else wrote, and it was awful. The code was a huge mess. Pretty much it was a series of functions in which each one called the next one progressively passing all the data from the previous functions to next, makign the final functions a hige mess of input variables and just the arguments list was three lines long. The user inputs were handled horribly using tons of nested ifs. Comments were very vague and useless and variable names were not helpful. A lot of the time it was stuff like this
#Processing variable varSomeInteger
varSomeIntegerPlusTwo = varSomeInteger + 2
varSomeIntegerPlusTwoHalved = varSomeIntegerPlusTwo / 2
some_function(varSomeIntegerPlusTwoHalved) #Passing processed variable to function
The worst part is that since the program had to be able to pickup data halfway through the processing from a CSV file, the only solution the coder found was to have the program write a CSV file at that point of the processing and then parse it. So the working directory was a huge mess of old CSV files of processes that had ben run through it.
In the end I had to convince my boss that the whole thing was a complete mess and it would take less time to write the whole program all over again rather than trying to add new functionalities to that one.
people who do this drive me nuts, if you are not going to name it something useful , tell me WHY you are using the formula
I wrote two square root functions, one for coding space efficiency and one for execution speed efficiency and I was expected to explain just why the formula was different inn each one and how it made a difference
_________________
?The first duty of a human being is to assume the right functional relationship to society--more briefly, to find your real job, and do it.? - Charlotte Perkins Gilman
"There never was a good war, or a bad peace." - Benjamin Franklin
My favorite is finding lines of code that don't do anything...
a = b + c;
< bunch of code that doesn't do anything to update "c" >
a = a - c;
WTF is the purpose of "c"?
That and huge blocks of commented out code. That just drives me nuts. Why even leave it in there if it's no longer functional? If you want to keep older version code for reference isn't it easier to just keep an earlier version in a separate file? It's not like there's ever enough documentation to explain how to go back to the old version just by commenting/uncommenting lines. If the commented lines are left there for debugging purposes they should at least be documented as such. That or clean it up when you're done debugging.
Some of the most bizarre C/C++ code I've seen was some I wrote myself for a class years ago.
It recursively included itself. Each recursion would cover one variation of a routine.
It had a number of #define's that would have different values for each inclusion. Once it had worked through the various #defines, it would stop including itself.
Oddly enough, it was not all that difficult to follow the code but a real bear to debug.
It was fun writing the code, but I never felt any desire to ever do that again.
a = b + c;
< bunch of code that doesn't do anything to update "c" >
a = a - c;
WTF is the purpose of "c"?
That and huge blocks of commented out code. That just drives me nuts. Why even leave it in there if it's no longer functional? If you want to keep older version code for reference isn't it easier to just keep an earlier version in a separate file? It's not like there's ever enough documentation to explain how to go back to the old version just by commenting/uncommenting lines. If the commented lines are left there for debugging purposes they should at least be documented as such. That or clean it up when you're done debugging.
I may write that kind of code, iff I need b+c for many times in the middle, and I have modified b there(This maybe the only reason for you to do so).
a = b + c;
< bunch of code that doesn't do anything to update "c" >
a = a - c;
WTF is the purpose of "c"?
That and huge blocks of commented out code. That just drives me nuts. Why even leave it in there if it's no longer functional? If you want to keep older version code for reference isn't it easier to just keep an earlier version in a separate file? It's not like there's ever enough documentation to explain how to go back to the old version just by commenting/uncommenting lines. If the commented lines are left there for debugging purposes they should at least be documented as such. That or clean it up when you're done debugging.
Premature optimizations are a big no-no, so a lot of code typically looks like that before it's complete.
mouthyb
Deinonychus

Joined: 5 Aug 2013
Age: 47
Gender: Female
Posts: 323
Location: Somewhar dusty and hot.
Good to know it's weird for a lot of other people. I think what I'm being handed is essentially artificially weird to force us to learn to write various things, but I keep running into weird work-arounds or other sorts of things like classes made up of nothing but unimplemented functions and my brain stops and says WTF? WHY?
The reason for the code being the way it is seems fairly important to me (probably since I hang out with a buncha code monkeys IRL who go purple when they run into this sort of thing in other people's code.) When I can't figure out either WTF I'm supposed to do with it, or what the hell is organizing it, I start to get antsy.
_________________
RAADS-R: 181
Eye Expression Test: 19
Alexithymic: Please explain conclusions if asked
The feels are shipped in by train once a week--Friday, I'm in love.
Right now I am being paid to document a company's existing COBOL so I can help explain it to consultants who are converting it to something which will use SQL with some interface. I draw brackets around its innermost IF statements, ELSE, and END-IFs; then do the same for the 2nd most intermost, then 3rd, etc.. It is not uncommon for one COBOL sentence to extend for well over a hundred lines with in-line PERFORMs and END-PERFORMs throughout. They made some effort to properly indent, but some used spaces and some used tabs. When I have to change tabs to spaces so I can search, the result resembles spaghetti.
Similar Topics | |
---|---|
Wishing I was working with people younger than me. |
22 Jun 2025, 9:19 am |
How old do people think I am? |
07 Jul 2025, 1:27 am |
Talking to People |
30 Apr 2025, 6:15 pm |
Do Bad People Have It Coming? |
30 Jun 2025, 5:20 pm |