Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Comprehensive collection of programming styles using a simple computational task, term frequency
Python Java C++ Scala Shell Clojure Other
Branch: master


No longer accepting programs in different programming languages because students!
latest commit aac9f9899c
@crista authored
Failed to load latest commit information.
01-good-old-times Typo (dyslexia)
02-go-forth Typo in comment
03-monolith Update
04-cookbook Minor cleanups
05-pipeline Moved the shell script again to the pipeline style, where it belongs …
06-code-golf A first try at a Ruby golf
07-infinite-mirror Fixed typo with wordfreqs variable
08-kick-forward removed an extraneous whitespace
09-the-one Make the main code more readable
10-things Merge pull request #14 from davidfstr/things-in-java
11-letterbox Renumbered again so that the messaging OO style comes immediately aft…
12-closed-maps Minor
13-abstract-things Update
14-hollywood Update
15-bulletin-board Update
16-introspective Update
17-reflective Update
18-aspects Changed this one too
19-plugins And this one too
20-constructivist Update
21-tantrum Update
22-passive-aggressive Update We can eliminate the extra parameter in the …
23-declared-intentions Update
24-quarantine Made the main block clearer
25-persistent-tables Update
26-spreadsheet Massive renumbering!!!
27-lazy-rivers Update
28-actors Renamed this style to actors, because that's what it is
29-dataspaces Update
30-map-reduce Changed the names of these two styles to what they really are: map re…
31-double-map-reduce Changed the names of these two styles to what they really are: map re…
32-trinity Read stopwords.txt when initialize, to avoid reading it in every update.
33-restful Formatting to fit 2 pages
34-the-c-flow Marking executable
test More test suite tweaks
.gitignore Add .gitignore
LICENSE Initial commit Update
input.txt Added input files
pride-and-prejudice.txt Added input files
stop_words.txt Added input files
test.txt Added input files

Exercises in Programming Style

Comprehensive collection of well-known, and not so well-known, programming styles using a simple computational task, term frequency. All programs run with the following command line:

$ python ../pride-and-prejudice.txt

Explanations and historical context for all these styles can be found in the companion book Exercises in Programming Style.

Additions are welcome!

You can contribute:

  • new exercises related to the existing styles
  • an entirely new programming style
  • new names for the existing styles
  • discussion of names, pros and cons of each style

Because this project and the companion book are used in courses, at the suggestion of several students I am no longer accepting contributions of the existing styles written in different programming languages. That is the first exercise that the students do. Having the solutions easily available here will rob future students of the learning experience!

Please follow the conventions suggested by the existing code base, specifically, if you are contributing a new style, make a new folder called nn-funname and add an example program in that folder called tf-nn.ext. (nn is the next avalaible number in the collection) Additionally, add a file that clearly describes the contraints for writing programs in that style. I will only consider new styles corresponding to constraints that are clearly different from the ones that already exist in the collection. (different programs written in existing styles are exercises for students, and should not be here)

Contributions of new names and discussion should be done under Issues or on the Wiki part of this repo.

To test your work, make sure your script is executable and then run:

./test/ NN

Where NN is the number prefix of the directory you're adding.

Never stop exercising!

Love, Crista

P.S. Inspiration for this collection:

Something went wrong with that request. Please try again.