News for hackers. Stuff that matters.
Re:Tim Bray doesn't know operator precedence rules by kaffeinecoma on Wednesday June 30, 2010 @05:47AM (#1474335)
"I have never bothered to learn, nor will I, what the default modifiers for Java’s variables and methods are"

That means that he doesn't understand "package" level access. There is no "package" keyword (well, there is, but it means something else). To get package-private access you have to leave it unspecified, so that means he can't use this feature. Or grok it when he comes across it.

The lack of a keyword for this is a shortcoming in Java, IMHO. But even if you don't use it often, you should have an inkling of how it works.

http://stackoverflow.com/questions/403583/what-is-the-use-of...

Re:Tim Bray doesn't know operator precedence rules by jsvaughan on Wednesday June 30, 2010 @06:49AM (#1474432)
yeah i thought that was surprising. operator precedence is one thing, but not knowing about default modifier, not so good.
Re:Tim Bray doesn't know operator precedence rules by Tichy on Wednesday June 30, 2010 @06:46AM (#1474427)
It rarely ever seems to be useful, though?
Re:Tim Bray doesn't know operator precedence rules by chopin on Wednesday June 30, 2010 @08:24AM (#1474603)
Most of my classes are package private. It is just a matter of information hiding. Especially when using factory patterns I hand out only public interfaces whereas the implementations are kept package private.
Re:Tim Bray doesn't know operator precedence rules by loumf on Wednesday June 30, 2010 @07:19AM (#1474479)
I've used it for unit-testing -- gives the test class a little more access.
Re:Tim Bray doesn't know operator precedence rules by thomas11 on Wednesday June 30, 2010 @07:54AM (#1474543)
Exactly. To elaborate a bit for those who never used it in that way: you want to separate your unit tests from your app code. But you still want to give your tests access to non-public methods in order to test them independently. The solution is to put app code and tests in different folders, but in the same packages, and make everything you want to test package-scoped.
Re:Tim Bray doesn't know operator precedence rules by kaffeinecoma on Wednesday June 30, 2010 @04:09PM (#1476031)
Ironically, it's quite commonly in use in Google's code base. GWT in particular.
Re:Tim Bray doesn't know operator precedence rules by tripa on Wednesday June 30, 2010 @07:22AM (#1474483)
Might be a vicious circle: no one knows about it -> no cool uses of it are found -> no one uses it -> loop.