Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a typical example of a solution to an artificial, self-imposed problem created by C++'s assumptions.

As a programmer, I would feel frustrated to have to figure this out instead of spending time on something a user would actually care about.



Which popular programming languages provide proper ACLs (or equivalent functionality) for class members?


I'm aware of C++ and Xojo for sure.


Is it possible to have a proper compile time ACL for C++?

Arguably the Badge pattern as presented in the article is just an honor system that provides zero security, since it's trivial to forge a fake Badge: https://repl.it/repls/BountifulQuerulousCron


It's less trivial if you make the copy/move constructors private.

https://repl.it/repls/HatefulMadeupMicrostation

Of course, type systems are orthogonal to any real security, at least in most languages, and certainly all languages with no-holds-barred interface to machine code.


I’m sure you’re very familiar with the patterns used in the codebase(s) you spend your time in.

In this case, once you know what a Badge<T> is, it’s obvious what it communicates about a function that takes one.


Considering the whole problem could easily be solved with a comment: // should only be called by Device




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: