I wish more PLs didn’t allow circular refs in pkgs. Go doesn’t & I found it weird at first since all the mainstream PLs I’ve written—Python, Node, Ruby, and Kotlin—do.
Now, lurking in a codebase full of lazy init patterns to work around circular deps. This results in so many weird design patterns!
Now, lurking in a codebase full of lazy init patterns to work around circular deps. This results in so many weird design patterns!
Comments
It would require a full refactoring, and no one wanted to do that. So you write another function, call `import` within it, open a PR, and forget about it.
Still, I’ve kinda learned to appreciate the restriction as it generally leads to a saner relationship among the different components.