News for hackers. Stuff that matters.
Re:Elixir v1.4.0 released by preordained on Thursday January 05, 2017 @12:21AM (#13324967)
There are plenty of times. Take a data structure like a hashmap. You know there are plenty of internal functions to manage the map (rehash, handle collisions...) that there is no reason for a hashmap end user to see or even be tempted to muck with. Now, you can could make a new class as an interface to this hashmap with only the appropriate exposed methods...but that seems like an excessive sort of pattern.

In a statically typed language like Java, etc., it also gives you the benefit that when you are auto-completing or discovering methods, you see only the exposed methods you are meant to call as an API user instead of poring over every two-line helper method in the class.

Re:Elixir v1.4.0 released by true_religion on Thursday January 05, 2017 @02:08AM (#13325332)
When I subclass hashmap, I may desperately want to reimplement collision handling without also having to rewrite the every other private function it calls. Private functions close the library off to custom extension.
Re:Elixir v1.4.0 released by mkarklins on Thursday January 05, 2017 @04:35AM (#13325910)
... and keeps the library's updates smoother, since there can't be any tinkering with library's implementation.
Re:Elixir v1.4.0 released by true_religion on Friday January 06, 2017 @12:32PM (#13338225)
You don't have to support users who use your library internals. Django for instance didn't support everyone who relied on undocumented internals in its orm. The standardization for the latest release made those internals clean and documented, but unapologetically broke other people's code including mine.