Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hjk10157313yDon'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.
-
@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. -
hjk10157313y@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.
-
TheEnd7043yThe 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.
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
rant