Feddit.dk
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
fuck_u_spez@lemmy.fmhy.ml to Programmer Humor@programming.dev · 2 years ago

Everyone should have a tool-building factory factory factory

i.ibb.co

message-square
59
link
fedilink
561

Everyone should have a tool-building factory factory factory

i.ibb.co

fuck_u_spez@lemmy.fmhy.ml to Programmer Humor@programming.dev · 2 years ago
message-square
59
link
fedilink
  • tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    Do you write unit tests with objects mocked via interfaces? Or polymorphism via interfaces? Those are the main reasons to use DI.

    • fuck_u_spez@lemmy.fmhy.mlOP
      link
      fedilink
      arrow-up
      4
      arrow-down
      3
      ·
      2 years ago

      I guess I have to start calling function invocation with generic parameters, fancy names (like “dependency injection” ^^)

      • qwioeue@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Relevant:

        I also prefer the simpler explanation.

        https://www.jamesshore.com/v2/blog/2006/dependency-injection-demystified

      • matto@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        2 years ago

        As I read somewhere:

        Dependency Injection is a 25-dollar term for a 5-cent concept.

      • tatterdemalion@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Yea that works too.

    • Ethan@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      I use various strategies depending on what seems appropriate, including the two you mention. I’ve never felt the lack of DI.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 731 users / day
  • 4.6K users / week
  • 9.15K users / month
  • 17.6K users / 6 months
  • 46 local subscribers
  • 23.1K subscribers
  • 1.39K Posts
  • 50.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org