Rob Walling boils it down to four key personality traits that, in his view, are shared by top developers:
1. Pessimistic
The best developers anticipate headaches that other developers never think of, and do everything within their power to avoid them.
On the flip side, great developers are optimistic, even downright confident, about their overall success. They know that by being a pessimist in the short-term, their long-term success is ensured.
2. Angered by sloppy code
Someone who fixes a problem but doesn't take the time to find out what caused it is doomed to never become an expert in their field. Experience is not years on the job, it's learning to recognize a problem before it occurs, which can only be done by knowing what causes it in the first place.
3. Long term life planners
People who think many years down the road in their personal life have the gift to think down the road during development. Being able to see the impacts of present-day decisions is paramount to building great software.
4. Attention to detail
I've known smart developers who don't pay attention to detail. The result is misspelled database columns, uncommented code, projects that aren't checked into source control, software that's not unit tested, unimplemented features, and so on. All of these can be easily dealt with if you're building a Google mash-up or a five page website. But in corporate development each of these screw-ups is a death knell.
He concludes:
We know from Facts and Fallacies of Software Engineering that the best programmers are up to 28 times better than the worst programmers, making them the best bargains in software. Take these four traits and go find a bargain (or better yet, make yourself into one).
These seem like good indicators to me, but I'm not a software developer. An opposing argument comes from Sam Griffith, blogging at O'Reilly OnJava:
While I think all those traits mention are good and do tend to yield developers who have attention to detail, control their distractions, etc., it is my opinion they do not necessarily equal the “best” developers! They are however some of the kind you want, but not necessarily the only kind of developer you need!
I have worked with many developers over the years who’ve come up with and coded great solutions to very complex problems, but they were not all detail oriented people. They did have bugs, their code sometimes needed re-factoring, etc. but quite often their ideas and solutions tended to be better than others; more out of the box. That made them “great”. We had plenty of other developers; we’ll call them “BTA - better than average”; all exhibiting the traits you say are “best” but they did not and probably would not have come up with solutions like the “great” developers. For example, the “great” developers tended to be more widely read in software engineering than any other team member, thus contributing a pointer to a solution or algorithm that no one else knew about. The “great” developers contributed things that the traits you mention don’t and can’t account for!
He cites, by way of example, "Great People with Issues" including Einstein, Van Gogh, and Thomas Edison.
As a practical matter, it strikes me that whatever the merits of the "great" developer, someone exhibiting the traits of the "BTA" developer is more likely to get hired. And the reality is that organizations need both: the out-of-the-box thinkers who can truly innovate, and the meticulous architects, designers and develoeprs who can transform those innovations into an end-result that is viable and maintainable over the long term.