Concatenative language/Simplicity

Good concatenative code is simple. When beginners first start learning a concatenative language, they often get lost in a sea of stack shufflers and overly complex code.

In the Factor community, we encourage beginners to post their code in the pastebin, so that we can review it and suggest idioms, abstractions and library words they can use to make the code simpler, shorter, and more readable (these three often go hand-in-hand: see Concision).

Slava wrote a blog post analyzing prevalence of shuffle words and combinators in the Factor source tree. The more complex shuffles, such as rot and roll, are only used a few dozen times in the entire code base (consisting of tens of thousands of lines), so indeed they are more of a crutch for beginners than a real tool that serious concatenative language programmers advocate using. Good code has simple data flow and does not need stack gymnastics. Factor's optimizing compiler, web framework and UI toolkit do not have any complex shufflers at all, and together they comprise some 30,000 lines of code.

This revision created on Sat, 3 Jan 2009 01:40:02 by slava