• 0 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle









  • Well over a decade ago I remember a coworker would just go through the codebase and add his own coding style.

    Instead of if (predicate) {

    He would do if ( predicate )

    I would always ask why he did it and he said, “well we don’t have any coding standards so I’m going to do it” … I replied, “there’s things like unwritten rules and sticking to whatever’s in the codebase makes it easy”. I told the seniors and they chose not to do anything (everyone just merged into trunk) and they just left him for a while.

    Then he turned rewrote built-in logical functions in code like this: if (predicate || predicate) {

    Into code like this: if ( or( predicate, predicate ) ) {

    This was C# and there was no Prettier back then.

    Also, he would private every constructor and then create a static factory method.

    Eventually the seniors told him to knock it off. All I said was that I initially tried telling them weeks ahead of time and now we got a mess on our hands.




  • I remember doing that as a junior because everyone in our codebase did it!

    My new team lead came in and asked me why. I said it’s to reformat it due to the layer it was in. He said “…and what did you really accomplish with that?” All we did was bury our real error really well. It made me think about these things and to question convention more


  • Oh that was like years ago! Probably SVN, we on-boarded Git a little while after.

    No pull requests, you just manually merged back then. It’s definitely a workflow improvement we adopted later and we as a company and as an industry have gotten better.

    lol, the thing was just that my manager asked me what I did and I told him. Him getting another dev to “fact-check” me after is what bothered me a bit. I am usually the type of look into issues rather than brush them off and I am the first to confess to a screw up. Which is why I was irked.



  • lobut@lemmy.catoProgrammer Humor@lemmy.mlThe eye-opener commit
    link
    fedilink
    arrow-up
    144
    arrow-down
    1
    ·
    1 year ago

    I remember when I was working with .NET and I saw some web service code and I saw there was no try catches. They didn’t have a global catch in the asax either or anything. I just wrapped each call into a try catch and log.

    I got the same treatment where my manager wanted to know what happened with the increase in errors. I told him what I did. My manager got another developer to go through my commits regardless. I was a bit upset at the lack of trust.


  • lobut@lemmy.catoProgrammer Humor@lemmy.mlWhoops
    link
    fedilink
    arrow-up
    26
    ·
    1 year ago

    Just a funny story. All of our devs and even BAs used to have prod access. We all knew this was a bad idea and put in a process of hiring a DBA.

    I think in the first two weeks the DBA screwed up prod twice. I can’t remember the first mess up but the second he had a lock on the database and then went to lunch.

    We eventually hired two awesome DBAs to replace that one but oh boy.



  • lobut@lemmy.catoProgrammer Humor@lemmy.mlVoice comments
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    I have literally given up friendships from people that wouldn’t stop sending me voice messages.

    I accept it from family, kids, the elderly and such. I just can’t believe people want me to turn off my music and slowly listen to your shitty voice when I can easily multitask.


  • I like TDD in theory and I spent so many years trying to get it perfect. I remember going to a conference where someone was teaching TDD while writing tic tac toe. Unsurprisingly, he didn’t finish in time.

    The thing that I hate is people conflating TDD with testing or unit testing. They’re vastly different things. Also, I hate mocks. I spent so long learning all the test doubles to pass interviews: what’s the difference between a spy, fake, stub, mock, etc. Also doing it with dependency injection and all that. I much prefer having an in-memory database than mock what a database does. Last company I worked at, I saw people write tests for what would happen if the API returned a 404 and they wrote code that would handle it and all that. In practice, our HTTP library would throw an exception not return with a statusCode of 404. Kinda funny.

    You obviously can’t always get replacements for things and you’ll need to mock and I get that. I just prefer to not use them if I can.

    Also, TDD advocates love saying, you’re just not doing it well or you just don’t know enough.

    I get it, you love TDD and it works for you and more power to you.

    I definitely believe in testing and having resilient tests that will minimize changes upon refactoring, but TDD doesn’t work for me for most of the work I do. It works for some and I love it when it does, but yeah … sorry random long ramble.