Hacker News new | ask | show | jobs
by Cshelton 3280 days ago
So basically you're saying to use pure functions. Something that you see in a functional language, where given the same input, you can expect the same output every time.

I like that idea, don't get me wrong. I think you are just using a bad example. If a package name is "config", I'd expect things in that package to be a reference point for developers if needed. But most of the time, "config" is just a place variable for something that will change when the config is set, not something the developer needs to add cognitive load for.

Now if it was something else and I wanted to make sure that the output of the function changes someday unexpectedly because something used inside the function has changed even when my inputs are the same, yes. That is now ideal in any language.