12

Was fixing a bug and suddenly got an error that the lodash library could not be loaded. Funny, didn't even know the project used that lib. Looked for the reference and the previous dev used _.times instead of a for loop. Ha okay, interesting. Wonder where else this library is used.
Searched the whole project for references, dependencies, whatever, any sign of it. Fucking. Nothing.
Rewrote the _.times part as a simple for loop, then removed the library. The rest of the project still worked perfectly. Took me about a minute and a half.
Who the fuck uses an entire damn library to... Not write a for loop I guess?!

Comments
  • 9
    One recommendation here...

    Write in your coding guidelines that a dependency must be justified and needs approval by at least 3 persons.

    Justified with concrete criteria:
    - why is it needed?
    - release cycle?
    - versioning?
    - maintained?
    - number of transitive dependencies?
    - long term plans (e.g. can the usage of the library be increased over time of does it just fix one problem at all)?
    - alternatives - either for the dependency or to adding the dependency to the project (e.g. creating new library with this dependency and thus reducing greatly risks)
    ...

    Then store it.

    Whenever I made this proposal, people declared me politely to be insane. (too much effort etc.)

    But it's the opposite - it's easy to add a dependency, it's insane to do it just you can - cause no dependency comes without a cost.
  • 6
    @IntrusionCM honestly, sounds like a decent idea, even with the organizational overhead. But that's not gonna work for my situation, wasn't an internal software and no one knows how it works except for me ^^ so a 3 person process is... Well. Impossible for a single person ^^
  • 5
    @CodingPeasant :)

    The 3 person rule stems from the general rule that no project should have less than 3 persons.

    It's based upon the basic experience that only a set of 3 different people is enough to form a sound decision - different the keyword here.

    1 person - pretty bananas (sorry, but bus factor, missing review etc is just a no no)

    2 persons - just one dominant person and you only have a single decision maker

    3 persons - when they have different personalities, if they make a decision with 3 voices pro, you can be sure that the decision wasn't just a formal "hush hush. Let's say yes cause it's easy"

    Wonder why? No idea. It might be a psychological thing though - no knowledge here - I call it the middle child situation. Throw 3 persons with different opinions and tell them they need to form a united decision and it will be one hell of a meeting where 2 struggle and bash their heads together and the 3rd tries to balance things out. Not always, but usually like this.
  • 3
    @IntrusionCM no complaints about the 3 people rule, not my call though. And I definitely agree it's pretty bananas doing it alone, but well. Not much of a choice atm ^^
  • 1
    @CodingPeasant I know. I'm doing a lot of stuff alone that would require 6 people ... 🤣
  • 2
    That is the reason you don't let the code monkeys introduce new dependencies. They will happily add another lib just to use one trivial function of it.
  • 1
    @Oktokolo yeah I'm honestly wondering who coded that crap. Maybe an intern
Add Comment