News for hackers. Stuff that matters.
Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @11:42AM (#4848611)
This is quite a shock. I worked at Coverity about 7 years ago, but I didn't have much faith in static analysis (now I'm at Microsoft, ironic).
Re:Eric Lippert is leaving Microsoft by wsc981 on Thursday November 29, 2012 @12:09PM (#4848774)
I wonder why you lost or never had any faith in static analysis. On Apple's platforms it's becoming a really big "thing". Also John Carmack talked about the benefits of static code analysis at QuakeCon 2012.

Also a good read: http://www.altdevblogaday.com/2011/12/24/static-code-analysi...

Re:Eric Lippert is leaving Microsoft by tptacek on Thursday November 29, 2012 @12:54PM (#4849118)
It's a huge big deal in enterprise software security; lots of Fortune 500 firms deploy it (most of them use Fortify, not Coverity).

I'm not a fan either.

Re:Eric Lippert is leaving Microsoft by MattRogish on Thursday November 29, 2012 @01:01PM (#4849176)
I'm a big +1 for static code analysis as a "silent observer" of code practices. We have various static checks run on each build and if a certain threshold is crossed, the build will kick out an error (we've decided not to have it fail entirely, although some could argue that's a reasonable thing to do).

Although we're a Ruby and JS shop, we take advantage of different services and libraries that perform different checks. In dynamic-language land it's a lot harder to do some of the things that static complication provides, but it's a heck of a lot better than nothing!

Re:Eric Lippert is leaving Microsoft by loumf on Thursday November 29, 2012 @02:37PM (#4849800)
I hated every attempt at static analysis until I started programming with Xcode. In my usage, Build and Analyze is always right -- that's the difference. Other tools (lint, FXCop) are too noisy. Even warnings in some compilers are an annoyance that you have to code around to eliminate.
Re:Eric Lippert is leaving Microsoft by InclinedPlane on Friday November 30, 2012 @02:59AM (#4852337)
Fxcop is massively overused. The rules are designed for teams who are building libraries and frameworks (thus the name, Fx is short for framework). For ordinary app development many of the rules are inappropriate, which can lead to an impedance mismatch and frustration.
Re:Eric Lippert is leaving Microsoft by eblade on Friday November 30, 2012 @04:01AM (#4852478)
Yeah, I read that Objective-C got it's ARC feature after static analyzer was integrated to Xcode. No more manual reference counting is definitely a plus.
Re:Eric Lippert is leaving Microsoft by jacquesm on Thursday November 29, 2012 @01:11PM (#4849267)
Why would you not have much faith in static analysis? Have you changed your mind on this?
Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @01:22PM (#4849358)
I am a firm believer that the best way to fix programming is through better programming languages, which I learned about myself while working at Coverity. Otherwise I think it was a great place to work: lots of very smart people, a very good business plan, great startup stock (back then), but I'm too idealistic!

Static analysis tools are very pragmatic in a world where better languages aren't adopted very often.

Re:Eric Lippert is leaving Microsoft by Someone on Thursday November 29, 2012 @01:59PM (#4849597)
Do you think better languages will make static analysis useless? I would think the combination to be better than better languages alone. Or are you arguing that static analysis by compilers should be improved (1) so far that separate tools for static analysis aren't useful anymore?

(1) almost all compiled language systems do _some_ static analysis. For example, many compilers and linkers do dead code elimination, and Java and C# must, by spec, do static analyisis to prove that variables won't be used before set.

Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @09:37PM (#4851556)
Static analysis is about performing heuristical non-local analysis on a code base to find bugs. We aren't talking about modular type checking that is performed by the compiler and explicitly enabled by the programming language design.

If you eliminate potential bugs to be found, static analysis is devalued significantly. So while static analysis may seem necessary for C++ code (very buggy, not much safety), it has less value for Java or C# code, where the easy-to-detect bugs and the remaining bugs are much more difficult to find.

Re:Eric Lippert is leaving Microsoft by jeremiep on Thursday November 29, 2012 @05:48PM (#4850755)
Really depends on the type of code you are writing. If you're writing a Mars Rover, you're probably not using a single dynamic feature and static analysis works quite well in this case. So long as you're writing 'dead' software, you're better off with static analysis.

As soon as you try to write living software, that is, software able to evolve over time without restarting, static analysis goes out the window. Design by contract and test suites are your friends in this case.

Re:Eric Lippert is leaving Microsoft by jacquesm on Thursday November 29, 2012 @01:39PM (#4849483)
Ok, that explains your position in a way that makes good sense to me. I agree that better programming languages would be good (and in fact, we do have them) but I'm a pretty pragmatic person and any tool that helps me to do the job that I need to do better is welcome.

Until better languages are much more common static analysis can save you a lot of time tracking down obscure issues and for that alone it gets my vote. I'll be more than happy to ditch all that for a better way to develop software (not necessarily just better languages) it feels as if we're doing something terribly wrong but I can't quite put my finger on what it is.

It feels as if we're building fragility right into the process from the ground up when in fact we should be doing the opposite.

Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @01:52PM (#4849555)
Right. I should have replaced "faith" with "excitement."

If you program in C++, you need static analysis. I'm not so sold on it for Java or C#, their is a lot less low hanging fruit in a moderately modern statically typed language.

Re:Eric Lippert is leaving Microsoft by munin on Thursday November 29, 2012 @10:32PM (#4851688)
java and C# still allow casting, so I think there you will still want static analysis outside of existing language features.
Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Friday November 30, 2012 @01:17AM (#4852107)
Yes, and they have null pointers also, but such bugs aren't as horrible as they are in c++, they show up more quickly during tests and are easier to debug.

C++ remains the market maker for the static analysis industry.

Re:Eric Lippert is leaving Microsoft by pnathan on Thursday November 29, 2012 @03:57PM (#4850223)
I've been 'around' static analysis a decent amount in the past 10 months or so, and my conclusion is that the deep solution is ML/Haskell/etc, not static analysis.

Writing in C/C++ is like asking to be shot in your foot. So you get static analysis, which gives you a modicum of help.

Re:Eric Lippert is leaving Microsoft by wololo on Thursday November 29, 2012 @03:43PM (#4850146)
static analysis is always going to result in a deluge of false positives

i think the future is symbolic execution, which due to a lot of factors is becoming practical

Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @09:33PM (#4851545)
symbolic execution is very similar to static analysis in purpose, if not name (closer to verification). You are right about the false positive rate, but I don't see why you think its becoming more practical?
Re:Eric Lippert is leaving Microsoft by wololo on Saturday December 01, 2012 @08:33PM (#4859721)
what do you think about klee.llvm.org?
Re:Eric Lippert is leaving Microsoft by PedroBatista on Thursday November 29, 2012 @11:53AM (#4848676)
Looks like your career is a string of bad bets..

(joking)

Re:Eric Lippert is leaving Microsoft by seanmcdirmid on Thursday November 29, 2012 @01:53PM (#4849567)
Quite true. I'm sure it would have worked out well financially if I hanged around in San Francisco (probably working for Coverity) rather than go to Lausanne to do a postdoc.
Re:Eric Lippert is leaving Microsoft by mdonohue on Friday November 30, 2012 @02:39AM (#4852287)
But then I wouldn't have had a job. :) Good to see your name again Sean.