Comprehensive collection of programming styles using a simple computational task, term frequency
Python Java C++ Scala Shell Clojure Other
Latest commit d521abd May 21, 2016 @crista Merge pull request #29 from bmistree/master
Add a single-line code golf example
Permalink
Failed to load latest commit information.
01-good-old-times Typo (dyslexia) Mar 18, 2014
02-go-forth Typo in comment Mar 8, 2014
03-monolith Update README.md Sep 30, 2013
04-cookbook Minor cleanups Jan 15, 2014
05-pipeline Moved the shell script again to the pipeline style, where it belongs … Mar 18, 2014
06-code-golf Take filename argument from program arguments May 21, 2016
07-infinite-mirror Fixed typo with wordfreqs variable Jan 31, 2015
08-kick-forward removed an extraneous whitespace Nov 8, 2014
09-the-one Make the main code more readable Mar 19, 2014
10-things Merge pull request #14 from davidfstr/things-in-java Jan 7, 2014
11-letterbox Renumbered again so that the messaging OO style comes immediately aft… Dec 26, 2013
12-closed-maps Minor Jan 3, 2014
13-abstract-things Update README.md Jan 7, 2014
14-hollywood Update README.md Jan 7, 2014
15-bulletin-board Update README.md Jan 7, 2014
16-introspective Update README.md Jan 7, 2014
17-reflective Update README.md Jan 7, 2014
18-aspects Changed this one too Mar 14, 2014
19-plugins And this one too Mar 14, 2014
20-constructivist Update README.md Jan 7, 2014
21-tantrum Update README.md Jan 7, 2014
22-passive-aggressive Update tf-23-monadic.py. We can eliminate the extra parameter in the … Feb 12, 2014
23-declared-intentions Update README.md Jan 7, 2014
24-quarantine Made the main block clearer Mar 20, 2014
25-persistent-tables Update README.md Jan 7, 2014
26-spreadsheet Massive renumbering!!! Jan 2, 2014
27-lazy-rivers Update README.md Jan 7, 2014
28-actors Renamed this style to actors, because that's what it is Mar 14, 2014
29-dataspaces Update README.md Jan 7, 2014
30-map-reduce Changed the names of these two styles to what they really are: map re… Mar 11, 2014
31-double-map-reduce Changed the names of these two styles to what they really are: map re… Mar 11, 2014
32-trinity Read stopwords.txt when initialize, to avoid reading it in every update. Mar 1, 2014
33-restful Formatting to fit 2 pages Jan 3, 2014
34-the-c-flow Marking executable Sep 28, 2013
test More test suite tweaks Sep 28, 2013
.gitignore Add .gitignore Jan 6, 2014
LICENSE Initial commit Sep 22, 2013
README.md Update README.md Feb 1, 2015
input.txt Added input files Sep 22, 2013
pride-and-prejudice.txt Added input files Sep 22, 2013
stop_words.txt Added input files Sep 22, 2013
test.txt Added input files Sep 22, 2013

README.md

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 tf-NN.py ../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 README.md 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/test.sh NN

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

Never stop exercising!

Love, Crista

P.S. Inspiration for this collection: http://en.wikipedia.org/wiki/Exercises_in_Style