1081
you are viewing a single comment's thread
view the rest of the comments
[-] magic_lobster_party@kbin.social 40 points 1 year ago

Not necessarily a bad practice if the singleton is immutable, and it’s provided via dependency injection for example.

[-] wreckedcarzz@lemmy.world 38 points 1 year ago

As a hobby coder: "mmmhm, mmmm, mmhm... I know some of these words!"

[-] SkyNTP@lemmy.ml 37 points 1 year ago* (last edited 1 year ago)

Software dev is full of obscure keywords that describe otherwise pretty simple or basic concepts you stumble upon in practice naturally and that you probably already understand.

  • singleton: a class/object that is designed to be single use, i.e. only ever instantiated with a single instance. Typically used when you use class/objects more for flow control or to represent the state of the program itself, rather than using it to represent data
  • immutable: read-only, i.e. unchangeable
  • dependency injection: basically when you pass a function or object into another function object, thereby extending their effective functionality, typically for modular code and to separate concerns.

Here's one more of my favourite examples of such a keyword: memoization

[-] Solemarc@lemmy.world 7 points 1 year ago

Ahh yes memoization, the complicated way to say "remember this, I might need it again"

this post was submitted on 08 Oct 2023
1081 points (96.6% liked)

Programmer Humor

19821 readers
535 users here now

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

founded 2 years ago
MODERATORS