News for hackers. Stuff that matters.
Re:White House Source Code Policy a Big Win for Open Government by V-2 on Sunday April 17, 2016 @05:48AM (#11514004)
Coding convention for WhiteHouse Android app is abysmal ;)

https://github.com/WhiteHouse/wh-app-android/blob/master/app...

    public
    boolean checkNetworkElseFail()
    {

    public
    Tracker getTracker()
    {
etc. Who does that?? And that's despite the fact that

"Contributers [sic] are expected to adhere to the official Android Code Style Guidelines." ;)

Re:White House Source Code Policy a Big Win for Open Government by tyingq on Sunday April 17, 2016 @08:34AM (#11514313)
>>Who does that?

You mean the indentation style? The K&R vs ANSI/Allman thing?

That argument started well before java, and continues. I would guess you're seeing it there because whoever wrote it had previously been a C++ developer. Inertia. GNU's classpath, for example, is indented this way...same thing, inertia. Easy enough to batch reformat though.

Re:White House Source Code Policy a Big Win for Open Government by V-2 on Sunday April 17, 2016 @03:15PM (#11515820)
I was referring to putting visibility modifier in its own line.
Re:White House Source Code Policy a Big Win for Open Government by arfar on Sunday April 17, 2016 @05:41PM (#11516452)
It's handy if you're looking for the methods definition using a regex. Instead of doing something like (in pseudo-regex):

    $[public|private|whatever-else-can-behere](FUNCTION_YOURE_LOOKING_FOR)
you can do a slightly simpler

    $(FUNCTION_YOURE_LOOKING_FOR)
Obviously your code editor/IDE should handle that, but maybe if you wanted to whip up a quick script to something a little odd, it'd be quite handy to have the function name on a separate line.
Re:White House Source Code Policy a Big Win for Open Government by V-2 on Sunday April 17, 2016 @06:00PM (#11516529)
Well, that's the first time I see such convention. And your argument doesn't quite hold water to me. They put the visibility modifier in its own line, not the function name. It's still next to the return type (or void). So it would still beat your regex. Plus, I'm not exactly sure if any Android devs snap out little regex-based scripts for refactoring or whatnot :) I'm sure it's far from unusual in dynamic languages, but looks like a great YAGNI in this case. I'm not hating it, all I'm saying is it's odd :)
Re:White House Source Code Policy a Big Win for Open Government by arfar on Sunday April 17, 2016 @06:09PM (#11516570)
You're completely right, it's odd. Also I didn't realise that the return type was also on the same line as the function name, in which case, even more odd.

I think the idea dates back to early C. I've definitely seen C code with the return type on a separate line.