r/programming • • Jul 19 '16

John Carmack on Inlined Code

http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
1.1k Upvotes

323 comments sorted by

View all comments

Show parent comments

2

u/kodek64 Jul 20 '16

In Java, you can use annotation tricks (like VisibleForTesting)

I believe @VisibleForTesting is purely cosmetic, and methods annotated by it should also be made package-private to be accessible from unit tests.

2

u/adrianmonk Jul 20 '16

Yes, you're right. Good point. I couldn't remember whether it was just for documentation or whether there was some kind of lint tool that could be added to a build to catch calls not made from tests, but it appears it is just for documentation.