Proper comments describe why... For example say you are using an api which requires guids and your application doesn't care are collisions as much so just use int id's.
You could add in a comment like
// creating a guid to interface with special api.
But just saying
// generate guid
Means nothing, your method should be generate_guid() or GenerateGuid(). Your comment is repeating.
Or this is probably going to hit my last company at some point, there was a system to read a serial number. They also wanted a "status" on the screen to verify the system was connected and running properly but both these values came over same signal wire. Depending on your exact ms timing sometimes you would read the status as the serial number. Another programmer wrote a check to verify the serial number did not start with OK. The comment added was
// add on 11/15/23 by Initials
With no other details. The serial numbers were 8 numeric digits. Someone won't know the history and delete this seemingly useless check and cause a 10s of 1000s of dollars in loss
Honestly I feel like he was kinda right, they took $1600 from him, held it for a week, by following their directions and basically told him to get over it.
I will say he was perfectly nice to the agent, no cursing or raising a voice, just "no I won't hang up till you resolve this." "sir there is nothing I can do" "I won't hang up till you resolve this" in a single monotone voice for 11.5 hours... That agent probably needs therapy.
Supposedly they weren't able to terminate the call for any rrsson(at the time, almost a decade ago). I will agree it should of been escalated much faster though.
I had an old roommate do this. He purchased plane tickets from American Airlines and they had the option to pay through PayPal. He choose that option. Money went through, and tickets were immediately canceled by A A. He called them and they said "that's a bug that happens sometimes. The tickets will be refunded in 5-7 business days, just place the order again and it should work."
It didn't work.
He called them again at 805 the next morning. He got told the same line. He refused to hang up until it was made right. He was on the phone with that poor agent for 11. 5 hours. Eventually she just said" look sir, you were my first call of the day and I'm now on overtime, I'm transferring you to my manager".
Manager did make it right, he got free tickets(about $800 dollars), an additional $1600 on future flight vouchers, and about a week later the transactions were reversed. He came out of it with 2400 in profit. That said 11.5 hours on the phone making small talk with customer serviceand refusing to hang up might just push me over the edge.
You laugh, at my last job for certain stuff I had to program in windows 10 and word.
They didn't have source control so they did manual code reviews using the "track changes" feature in word.
The code reviews were pointless though as I was the only one who knew the language it was written in (g-code with proprietary additions by the system vendor)
Last year during the Christmas shutdown at work I actually made a crud application to track naughty vs nice children for santa, yes it was sql based(entity framework) with >90%test coverage (tests based off a in memory database) and with a winforms ui(what I had to use at work).
I might revisit and refactor it this year come to think of it.
I worked in a heavily regulated industry. Everything required a manual test. Let's say you have an employee ID that is 10 digits long which they use to log in. You had to have some else (couldn't be the developer) to write a series of tests, get those tests approved by 5 people(with specific titles) then a third person to execute the test, then the second person had to write a report saying it all passed, then that report had to be approved by the same 5 people.
That typically wasn't the delay. The delay was to execute the tests we needed to stop production. That typically was a 6 week wait(unless urgent for "reasons") and changes like "I will drop scrap by 83%" was typically told wait till July 4th or Christmas breaks. Why? Because production would be down for 3-4 days typically. Someone had to start the system, ok no entry produces error, executor and developer have to sign a physical paper, restart the whole system, now an entry of 1 digit produces an error, sign the form, repeat for all digit quantities up to 9, repeat for all digit quantities up to the choosen value(based on severity if an issue occurred), 2 people sign for each one, system restarted between each. If you had say an enter button and a cancel button each had to be checked for each quantities of digits. Oh but wait what if someone just types there name... Now repeat everything for alphabet values... What if someone does combination, more tests, more restarts, more signing.
Reports easily surpassed 1000 pages, no one really had time to check all that so I saw so many missed signatures and missed tests. I asked the "senior validation expert" can I just automate a lot of these tests using unit tests and attach a computer generated report of all tests passing and the source code of the tests? " the response I got was" what's a unit test? "they still don't use any of them to my knowledge.
Proper comments describe why... For example say you are using an api which requires guids and your application doesn't care are collisions as much so just use int id's.
You could add in a comment like
// creating a guid to interface with special api.
But just saying
// generate guid
Means nothing, your method should be generate_guid() or GenerateGuid(). Your comment is repeating.
Or this is probably going to hit my last company at some point, there was a system to read a serial number. They also wanted a "status" on the screen to verify the system was connected and running properly but both these values came over same signal wire. Depending on your exact ms timing sometimes you would read the status as the serial number. Another programmer wrote a check to verify the serial number did not start with OK. The comment added was
// add on 11/15/23 by Initials
With no other details. The serial numbers were 8 numeric digits. Someone won't know the history and delete this seemingly useless check and cause a 10s of 1000s of dollars in loss