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

I agree. If you know you're writing something that is un-idiomatic or you think its intended purpose will be a surprise to most readers, put a comment in explaining why.

    // we need a heap object so we can synchronize on it later
    Boolean b = new Boolean(true);


This points to a deeper problem of static analysis, though - any analysis package without the ability to annotate code is _doomed_. The false positives will be so annoying that people will give up on it.

And for the people who work on SA systems - please give me a way to annotate that is not exclusively via comments. Especially once people use multiple SA packages, that is rather annoying :)


I'd also make the name a bit more descriptive.




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

Search: