4
Lensflare
32d

Have you ever seen a constructor/initializer with 70 lines of parameters?

I have.

Now excuse me, I need to drink some methanol.

Comments
  • 3
    Wow. Must be a beast.
  • 4
    I haven't, but I'd be curious about what it does if it needs that much stuff.
  • 3
    @kamen it does practically nothing. It‘s just an insane amount of dependencies injected in the most inconvenient way possible.

    We are supposed to follow a specific pattern to make UseCase objects which practically just have a single method that does a single thing.
    There are dozens of those use cases and each of them has a Repository dependeny which needs to be created on the call side, which in turn has an API connection dependency which needs to be created on the call side. And that goes on with more stuff per level and like 4 to 5 levels deep. All that crap needs to be created, initialized and passed to the constructor, on every place where that constructor is called.
    That takes up to 70 loc.
  • 2
    The developers don't want to optimize or upgrade the existing code. They want to use the code as it is.

    lead to

    Code turns into a mountain of shit
  • 2
    You should wrap them into a "Context" object. :D
  • 2
    Yeah, I have... in legacy codebases written by stubborn people.
  • 2
    I've worked on a 1300 lines query full of if statements.
  • 2
    @whimsical if you allow, that’s something else.
  • 1
    Methanol? Taking the easy way out!
    Ethanol in large quantities to get through the day and then do the same following days is the way is the way heroes are defined... right?
  • 1
    well mine technically werent in multiple lines... so technically i didnt write one with more lines of params...
  • 0
    @Lensflare umm u do get that retoor doesnt understand that what they just said is NOT a near valid flex... riiight?
Add Comment