Preamble

Package wyz.code.offensiveProgramming aims to provide a strict type checking enforcement in R.

The R language is a weakly typed script language. As such, it simplifies greatly program writing and allows for great flexibility. That’s fine, and conceptually, there is no issue about that.

Indeed, this leads more than desired to defensive programming practice. The absolute need to verify provided arguments, all along the function call chain, is very strong if you want to provide reliable and robust implementation.

Consider following table about benefits of type control and type inference in lazy and strict type checking approaches.

Goal Lazy type control
standard R
Strict type checking
R offensive programming
type control Weak type control implies coding of many contextual type controls Strong type checking brings some rigidity
type inference requires knowledge and navigation from code to doc forth and back is required semantic naming allows more intuitive type inference

Won’t it be nice to get the benefits of defensive programming and offensive programming, where ever and when ever needed?

The main objective of package wyz.code.offensiveProgramming is to allow strict type checking in R to be as easy to use and to run as standard R.