4

Working with new guy who is "senior" is such a pain. We had a factory file that is used to populate tables in endpoint tests. The new guy decided to add a static util method called createTestRecord() to a query builder model. Fucking query builder calls in a static method in a query builder class. I send him messages expressing concerns regarding his approach but never got anything back. The guy just ignored me and asked me to review his pr.

I am leaving in 4 months. Release me from my misery. Fuck my life

Comments
  • 1
    Don't know what a factory file is but sounds like a test fixture. Generally like that approach unless the data set needs to be enormous.
  • 2
    @hjk101 the problem isn't the factory file, the problem is the shenanigans of a static method in a class (supposedly) using an instance of the same class to do what it does, or someshit like that.
    static->dynamic->static looptyloops become very confusing very fast.
  • 0
  • 1
    @Midnight-shcode ow yes I fully understand. But as a senior you should go for the least complex solution. This is something you already have... Usually a query builder is something that is production code I already take great offence in adding a method for testing. Especially if it is made static as an excuse: look it's self contained who cares we add crap here.
  • 1
    The general misunderstanding of how static methods and properties work is a plague upon our industry. I can’t tell you how many times I’ve been called in to help a team with random prod issues only to find everything is defined as static or being used as Singletons (for transactional data). Yes, fuck my my life too.
Add Comment