Averaging Numbers in Prolog: A Recursive Circus

2025-05-07

This article humorously illustrates calculating an average in Prolog, progressing from a simple mathematical definition to an excessively verbose recursive implementation. The author critiques the pedagogical constraint of prohibiting standard Prolog library functions, resulting in redundant and less readable code. The article contrasts a concise mathematical approach with a cumbersome recursive solution, arguing for prioritizing code readability and maintainability over mere recursive exercise in teaching.

Development