68
you are viewing a single comment's thread
view the rest of the comments
[-] fruitycoder@sh.itjust.works 4 points 3 days ago

The rule I see is functions should be fairly atomic and almost obvious what they do in context of the code.

At least for my small brain that's how I like it. I can understand some complex abstractions but rembering that actually this function behaves in three different ways depending on what flag is set is awful. It means you could look at one example and be totally wrong in another. Ideally you could guess the functions purpose even in a black box setting based on inputs outputs and the name should then make it obvious.

[-] buffing_lecturer@leminal.space 3 points 2 days ago

The example that the other commenter gave did not require the user to input the flags. As far as I understand, they mean there would be a number of secondary functions that will call the other with the correct parameter.

[-] fruitycoder@sh.itjust.works 3 points 2 days ago

Fair point. My point still stands on it breaking the black box test. Where the input can wildly effect the logic that creates the output.

this post was submitted on 10 Oct 2025
68 points (97.2% liked)

Programming

23074 readers
263 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS