Why is imperative mood important for docstrings?

From the docstring of check_imperative_mood itself: “””D401: First line should be in imperative mood: ‘Do’, not ‘Does’. [Docstring] prescribes the function or method’s effect as a command: (“Do this”, “Return that”), not as a description; e.g. don’t write “Returns the pathname …”. (We’ll ignore the irony that this docstring itself would fail the test.)

Measuring the complexity of SQL statements

Common measures of software complexity include Cyclomatic Complexity (a measure of how complicated the control flow is) and Halstead complexity (a measure of complex the arithmetic is). The “control flow” in a SQL query is best related to “and” and “or” operators in query. The “computational complexity” is best related to operators such as SUM … Read more

Tools for generating Haskell function dependency (control flow) graph?

Yes, there certainly are. If you look in the Development category on Hackage, you’ll find tools for: graphing package dependencies — n.b requres older cabal graphing module dependencies graphing function calls graphing running data structures In particular, SourceGraph contains many analysis passes, including: visualizing function calls computing cyclomatic complexity visualizing module imports Other tools that … Read more

Is there a need for a “use strict” Python compiler?

Well, I’m not much of a python programmer, but I’d say that the answer is ‘YES’. Any dynamic language that lets you create a variable with any name at any time, could use a ‘strict’ pragma. Strict vars (one of the options for strict in Perl, ‘use strict’ turns them all on at once) in … Read more

Arrays should not be statically initialized by an array initializer. Why?

It’s an interesting question, and this decision is groundless IMHO. (I hope somebody else will answer this thread if there is a legit reason behind this design decision). Moreover, Google shows how to format those static initializers in their good practice formatting guide https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.8.3.1-array-initializers without saying anything about how bad it is to use those … Read more

How do commercial Java static analysis tools compare with the free ones? [closed]

We use a suite of open source and commercial static analysis tools. The different tools find different kinds of bugs and some are tuned for lower false positive rates, at the expense of possibly missing some real problems. In my experience, Findbugs does a good job of finding real problems, especially if you focus on … Read more

tech