Improve readability of various functions #67

merged 2 commits into from Mar 17, 2012


None yet

2 participants

KushalP commented Mar 17, 2012

These are various improvements to bits of code which could improve readability.

After speaking to @otfrom I've gone through and benchmarked these various changes with criterium.

All of the changes have no discernable difference, apart from changing (+ x 1) to (inc x), which causes a 0.205708 microsecond increase in execution time (mean).

KushalP added some commits Mar 17, 2012
@KushalP KushalP Improve readability using simpler functions (addition, subtraction)
Instead of doing addition and subtraction as (+ x 1) and (- x 1),
respectively. Use the provided functions within Clojure to improve
readibility for users reading through incanter.
@KushalP KushalP Simplify use of when and equality checks
Currently, there are a number of cases that use (when ...) but then use
nil as the truth statement. Instead, these can be considerably
simplified by using (when-not ...) for the singular case.

This also includes readability changes to use (inc ...) and (zero? ...).
@alexott alexott merged commit e75b293 into incanter:master Mar 17, 2012
alexott commented Mar 17, 2012

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment