• 0 Posts
  • 37 Comments
Joined 1 year ago
cake
Cake day: July 3rd, 2023

help-circle









  • jjjalljs@ttrpg.networktoProgrammer Humor@programming.devNew language
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    6 months ago

    The python code we inherited had some performance issues. One of the guys was like “we should rewrite this in Java”.

    Luckily the boss was not an insane person and shut that down. The issue was an entirely stupid “…and then we do one query per project” behavior that worked fine when the company was small but unsurprisingly started to suck as users created more projects.

    Instead of a months long complete rewrite, we had a two hour “let’s add profiling… Oh wow that’s a lot of queries” session.



  • There’s two options in the green button on a pr. One is squash and merge, the other is squash and rebase.

    Squashing makes one commit out of many. You should IMO always do this when putting your work on a shared branch

    Rebase takes your commit(s) and sticks them on the end.

    Merge does something else I don’t understand as well, and makes a merge commit.

    Also there was an earthquake in NYC when I was writing this. We may have angered the gods.


  • …and? You squash so all your gross “isort” “forgot to commit this file” “WIP but I’m getting lunch” commits can be cleaned up into a single “Add endpoint to allow users to set their blah blah” comment with a nice extended description.

    You then rebase so you have a nice linear history with no weird merge commits hanging around.





  • I think it’s definitely a thing most people grow out of when they gain experience.

    My boss told me about how when he was new he rewrote a whole chunk of the front end. His boss gave him a talking to about how you can’t just go and do that when you’re working with a team.

    At an old job I just opened a PR to apply a code formatter to an internal project I wasn’t even a routine contributor to. PR was rejected and I learned a valuable lesson about talking and getting buy-in before making sweeping changes.




  • Did I already post in here about how he wrote a custom DSL instead of using the standard widely used ORM we use everywhere? Maintainability nightmare.

    He doesn’t work here anymore and now I have to either figure it out or rip it out. So far it looks like “rip it out” because it took less than an hour to swap in the orm, and now there’s just a lot less code needed.