• 2 Posts
  • 26 Comments
Joined 3 years ago
cake
Cake day: June 20th, 2023

help-circle
  • 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.


  • It would be horrible in real life but I thought a funny intro to a post apocalyptic movie would be a person giving a tour of a bio lab to college interns and…

    “through our studies we have learned to increase the transmission rate and the death rate of the small pox virus. The downside is we had to mix it with rabies so the infected tend to get aggressive and lose there ability to rationalize their thoughts. Don’t worry though, there is only this one vial of it in the entire world… these gloves are quite slippery… Oops”



  • Years ago, almost two decades, I setup a Screensaver which basically took any image passed over the network and made a collage. Almost everything was like website banners and such.

    One day I was in the server room doing something un-related and in the corner of my eye I saw some horrible images on the other screen. I immediately went to the cto who called the police.

    Long story short he was immediately fired(and taken into custody) after being found in the bathroom… The images were kids between 3-7…

    Before people ask, we could find out which access point he was using to determine approximate area. A quick walk around showed it wasn’t someone at there desk. Obviously they wouldn’t be in a meeting and there was only 1 set of bathrooms in that area. Female officer went into women’s room and reported it empty. Male officer went into men’s room and found 1 person, court case revealed history on his phone and yeah… Hopefully he’s still rotting in jail.





  • I saw a talk recently, I can find the video if you like but pretty sure it was the most recent ND conference, where they made the point that a lot of lack of efficiency in modern code is because of large companies. Basically in alot of cases it’s more important to get a product out ASAP then to care if it was well done. Ok, a poorly written program may cost an extra $10,000 a month to run but if it earns them a million a month and saves 6 months of development time it pays for itself and they can eat the cost.

    This seems like the case with renting vdis instead of fixing the program.










  • All the other tips are great. I would also recommend checking out a switch statement, for example https://www.geeksforgeeks.org/c/c-switch-statement/

    This will clean up alot of the else if statements. Also I would work on code to organization. For example you test if the choice is greater than or equal to 6 or less than 1, then if it is equal to 5 then check again if it’s less than 5 and greater than 0. You already did that third check.

    If you want to go slightly more advanced I would put the steps to ask for and save the input numbers into a function then just call that function on each of the following choices. Would add a functional call but would remove another if statement. If you name it well it would also help on code readability.

    Also if you want to take this farther like taking more than 2 numbers or more than 1 operation (for example 2 + 3 * 4) look into reverse polish notation. Basically it’s how to store the equation to make executing them correctly easier. That might be a little advanced for you at this stage though.