Comprehensive collection of programming styles using a simple computational task, term frequency
Switch branches/tags
Nothing to show
Clone or download
crista Merge pull request #29 from bmistree/master
Add a single-line code golf example
Latest commit d521abd May 21, 2016
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 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 Jan 7, 2014
14-hollywood Update Jan 7, 2014
15-bulletin-board Update Jan 7, 2014
16-introspective Update Jan 7, 2014
17-reflective Update Jan 7, 2014
18-aspects Changed this one too Mar 14, 2014
19-plugins And this one too Mar 14, 2014
20-constructivist Update Jan 7, 2014
21-tantrum Update Jan 7, 2014
22-passive-aggressive Update We can eliminate the extra parameter in the … Feb 12, 2014
23-declared-intentions Update Jan 7, 2014
24-quarantine Made the main block clearer Mar 20, 2014
25-persistent-tables Update Jan 7, 2014
26-spreadsheet Massive renumbering!!! Jan 2, 2014
27-lazy-rivers Update Jan 7, 2014
28-actors Renamed this style to actors, because that's what it is Mar 14, 2014
29-dataspaces Update 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 Update 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

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: