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

Everyone should have a tool-building factory factory factory

i.ibb.co

message-square
52
link
fedilink
576

Everyone should have a tool-building factory factory factory

i.ibb.co

fuck_u_spez@lemmy.fmhy.ml to Programmer Humor · 2 years ago
message-square
52
link
fedilink
  • tatterdemalion
    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
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Yea that works too.

    • Ethan
      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

programmer_humor

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: [email protected]

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.

  • 1.74K users / day
  • 4.59K users / week
  • 8.17K users / month
  • 17.9K users / 6 months
  • 2.4K local subscribers
  • 23.4K subscribers
  • 1.4K Posts
  • 52.8K Comments
  • Modlog
  • mods:
  • adr1an
  • Feyter
  • BurningTurtle
  • Pierre-Yves Lapersonne
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org