logoalt Hacker News

toast0yesterday at 10:15 PM1 replyview on HN

> had deployed Elixir in a way that broke the BEAM (which he viewed as "old and deprecated")

I'd love to hear more about this!

> instead of using private functions as they're intended—created a pattern of SomePublicModule and SomePublicModule.Private, where he placed all the "private" functions in the SomePublicModule.Private module as public functions so that he could "test them."

Yeah, this is weird; you can just put your tests in the PublicModule. Or you can just solve this by not testing your private code ;)


Replies

innocentoldguytoday at 12:31 AM

> I'd love to hear more about this!

He deployed our applications using Kubernetes and refused to implement libcluster. There was something else, too, but I can't recall what it was. It was seven years ago.

> Yeah, this is weird...

I kept telling this developer that you're supposed to test your private functions through your public interfaces, not expose your private functions and hope nobody uses them (which they did), but that fell on deaf ears. He was also a fan of defdeligate and used it EVERYWHERE. Working with that codebase was so annoying.