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

Any recommendations for tools in web development? I use JS Lint, but what about server side languages?


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/


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++


How does it compare to fxCop?


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.


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.


For PHP: Facebook's PHP compiler, HipHop, comes with static code analysis. Rasmus Lerdorf himself recommends it.


Cloud9 IDE has static JavaScript Analysis integrated in the editor. https://c9.io/


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 :)


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.



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 .



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.



I wrote a static code analysis tool for .net (c#/vb) www.nitriq.com


Pylint is fantastic

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


I've personally found pychecker and pyflakes to be much more useful out of the gate than pylint.




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

Search: