News for hackers. Stuff that matters.
Re:John Carmack on Static Code Analysis by speg on Wednesday September 19, 2012 @10:46AM (#4543770)
Any recommendations for tools in web development? I use JS Lint, but what about server side languages?
Re:John Carmack on Static Code Analysis by Too on Wednesday September 19, 2012 @10:56AM (#4543827)
For PHP: phpLint[1], almost makes php into a type safe language.

For .NET you have Code Contracts[2], this requires you to annotate pre- and postconditions for your functions but after that it's for example impossible to pass a possibly null into a function without compile time error. It can even do range-check of numerics after calculations etc.

[1]http://www.icosaedro.it/phplint/

[2]http://research.microsoft.com/en-us/projects/contracts/

Re:John Carmack on Static Code Analysis by nahname on Wednesday September 19, 2012 @11:19AM (#4543947)
ReSharper is the best lint tool you can get for dotnet development. It literally makes you a better programmer that writes cleaner code. It really sounds like JetBrains needs to make a similar tool for C++
Re:John Carmack on Static Code Analysis by adamzochowski on Wednesday September 19, 2012 @11:43AM (#4544039)
How does it compare to fxCop?
Re:John Carmack on Static Code Analysis by nahname on Wednesday September 19, 2012 @12:18PM (#4544190)
Night and day. FxCop requires days of customization to include something into your build step. Even then, the recommendations are weak at best. Furthermore, think back to Carmack's comment on how static analysis has to at least be in your build step.

ReSharper has much better recommendations that require almost no tweaking (variable names you might disagree with). The best part, it tells you these recommendations at the time of writing. This is one of ReSharpers best features (IMO). Not only do programmers write better code with, they often write code that works the first time and compiling becomes just a technicality. Code improvement is noticeably better. So much so, that when my company is hiring and I am reviewing the candidates submission; I can immediately tell whether or not they were using ReSharper.

Cannot recommend this tool enough. I feel crippled without it in VS.

Re:John Carmack on Static Code Analysis by rbellio on Wednesday September 19, 2012 @01:54PM (#4544648)
Another ReSharper user here that has used FxCop as well. I think both tools are awesome, but ReSharper's ability to do the code analysis on the fly is huge for me.

Just be aware of your default shortcuts if you look into ReSharper. I remember that some of them change on you.

Re:John Carmack on Static Code Analysis by adamzochowski on Wednesday September 19, 2012 @11:48AM (#4544055)
For PHP: Facebook's PHP compiler, HipHop, comes with static code analysis. Rasmus Lerdorf himself recommends it.
Re:John Carmack on Static Code Analysis by sergimansilla on Wednesday September 19, 2012 @11:27AM (#4543980)
Cloud9 IDE has static JavaScript Analysis integrated in the editor. https://c9.io/
Re:John Carmack on Static Code Analysis by Joeri on Wednesday September 19, 2012 @02:18PM (#4544770)
I can strongly recommend phpstorm for javascript and php inspections. Errors are highlighted as you type (including but not limited to what jslint catches) and quite a few can be automatically fixed. They also have a good spellcheck for misspelled variable names. No more poeple arrays in my code :)
Re:John Carmack on Static Code Analysis by viscanti on Wednesday September 19, 2012 @11:57AM (#4544097)
Flake8Lint (available for Vim and Sublime Text 2) works really well for me, and my co-workers. The optional complexity checking is a nice bonus. You also get the PEP 8 linting and some logic checks. It hurts at first, to see all the errors pop up, but once you tweak the settings (maybe you don't care so much about PEP 8 spacing and you'd like your equals signs to all match up, in which case it's simple to ignore those issues), it can help keep code consistent. I think the big win is on large projects with a number of people writing code. Having an enforceable "style" really helps cut down on bugs and makes everything more readable.
Re:John Carmack on Static Code Analysis by OriginalSyn on Wednesday September 19, 2012 @10:51AM (#4543804)
Re:John Carmack on Static Code Analysis by farnulfo on Wednesday September 19, 2012 @01:03PM (#4544390)
Sonar from SonarSource can natively analyzed java code (open source). Additional plugins are available for other languages (http://docs.codehaus.org/display/SONAR/Plugin+Library). You can see a live demo for a lot of open source project at http://nemo.sonarsource.org .
Re:John Carmack on Static Code Analysis by buster on Wednesday September 19, 2012 @11:21AM (#4543954)
Re:John Carmack on Static Code Analysis by jaimefjorge on Wednesday September 19, 2012 @09:05PM (#4546421)
I would love for you to try qamine (www.qamine.com). I'm giving a trial for people to test the tool before I launch it. Feel free to join.
Re:John Carmack on Static Code Analysis by karmi on Wednesday September 19, 2012 @10:51AM (#4543805)
Re:John Carmack on Static Code Analysis by viggity on Wednesday September 19, 2012 @02:36PM (#4544868)
I wrote a static code analysis tool for .net (c#/vb) www.nitriq.com
Re:John Carmack on Static Code Analysis by MBlume on Wednesday September 19, 2012 @10:57AM (#4543829)
Pylint is fantastic

Googling "$LANGUAGE lint" will probably find what you need.

Re:John Carmack on Static Code Analysis by pnathan on Wednesday September 19, 2012 @11:48AM (#4544060)
I've personally found pychecker and pyflakes to be much more useful out of the gate than pylint.