Helping Netbeans/PhpStorm with Autocomplete/Code-hinting

Where Netbeans can’t guess the type/existence of a local variable, you can tell it in a multiline comment:

/* @var $varName TypeName */

After this comment (and as long as TypeName is defined in your project/project’s include path), when you start to type $varName, Netbeans will offer to autocomplete it, and will offer TypeName method/property suggestions. If you rename the variable with Ctrl+r (rename refactoring), Netbeans will change the comment, too.

I usually forget this syntax because type comes first in @param declarations.

Update: PhpStorm supports a similar syntax, but reversing the type and variable name:

/* @var TypeName $varName */

A Case Against Google+

Google+ will fit some people really well, and is certainly bringing some fresh ideas to the table to keep Facebook on its toes. That said, here’s why I kinda hope it doesn’t take off, and why I’m seriously considering leaving the party early.

  1. There were compelling reasons to abandon Friendster and MySpace at their peaks; frustrating performance, bugs, spam, bad UIs, visual nonsense, etc. Facebook seems to be scaling quite gracefully and they seem to constantly improve rather than frustrate.
  2. My main issue with Facebook would be privacy, but I find it highly unlikely that, in the long run,  Google+ or any other ad-supported social network will be a better steward of our personal information. That train goes in one direction.
  3. Establishing yet another silo of social network identities will cost us a huge amount of collective time.
  4. Since Google+ “circles” nearly remove all social cost from forming weak relationships (“just dump them in acquaintances”) we could be talking about a lot more time spent managing relationships. Circles may be the killer feature that we later really regret embracing.
  5. Prominent Google+ notifications appear at the top of all Google tools, and I couldn’t find a way to hide them without, say, keeping a separate account. With social networks being brilliant delivery mechanisms for dopamine; offering that hit while in Gmail, Docs, Calendar, and Search is going to be a disaster for a lot of people’s productivity.