Hacker News new | ask | show | jobs
by daxfohl 869 days ago
I've always felt like instead of public, private, protected, there should be something like security groups and acls on classes and functions. That way it's very explicit when you are newly coupling things, and brings tighter scrutiny to those changes.

Edit: oh, looking at the docs, apparently that's exactly what this tool does. Though it would be nice to have function level granularity. Maybe by annotating the code itself.

1 comments

Build systems like Bazel provide mechanisms for controlling access at the module-level. If you're disciplined about not just making everything "public" it can be really powerful. Bazel is a very big hammer though and might be overkill for your projects.
Oh, interesting! We already use bazel at work but it was all set up before anybody on the current team got here and the only process we have is "fight it until it works", which fortunately doesn't come up too often. Or maybe _unfortunately_, as then there's not enough incentive to figure it out. Now you gave me inspiration to dig in and understand how it should really be used.