Skip to content
This repository
Browse code

more exercises

  • Loading branch information...
commit 895c33730734429e7e2b2394b2d36ef5f4be079e 1 parent 609b8c6
Paul Pagel authored

Showing 3 changed files with 60 additions and 0 deletions. Show diff stats Hide diff stats

  1. +29 0 Readme.txt
  2. +4 0 hoist.txt
  3. +27 0 loops.txt
29 Readme.txt
... ... @@ -1 +1,30 @@
1 1 This project is designed to provide a place for exercises which craftsman can solve to sharpen their skills.
  2 +
  3 +
  4 +
  5 +Types of exercises
  6 +- design style: like the bowling game
  7 +- maths
  8 +- algorithms
  9 +- data structures
  10 +- emergent/evolutionary design
  11 +- repair
  12 +- clean code
  13 +- refactoring
  14 +- porting
  15 +- crossing paradigms
  16 +- concurrency
  17 +- parsing
  18 +- little languages
  19 +- loops
  20 +- caching
  21 +- optimisation
  22 +-- reduce memory footprint
  23 +-- reduce cpu usage
  24 +-- trading space versus memory and vice versa
  25 +- switching data structures
  26 +- kinds of duplication
  27 +- removing patterns
  28 +- off by one errors
  29 +- ranges
  30 +- bugs
4 hoist.txt
... ... @@ -0,0 +1,4 @@
  1 +Learning how to hoist variables out of for-loops
  2 +- identify invariant expressions in loops
  3 +- extract a variable that doesn't have side-effects
  4 +- extract variables with no-side effects versus those that have only 1 side-effect
27 loops.txt
... ... @@ -0,0 +1,27 @@
  1 +I think that people
  2 +would be surprised by the amount of depth that there can be in
  3 +something as superficially simple as a for-loop. For instance:
  4 +- simple incrementing for-loops such as counting from 1 to 10 printing the index.
  5 +- simple decrementing for-loops such as counting from 10 to 1 printing the index.
  6 +- using for-loops to replace recursion for instance traversing a tree and printing out the nodes
  7 +- learning to reason about nested for-loops
  8 +- looking at the ways in which different languages implement them and
  9 +getting a sense for the ways in which they are more or less equivalent
  10 +but some languages have more powerful constructs than others
  11 +- the evolution of modern varieties of for-loops
  12 +- for-else loops for instance in Python
  13 +- the interaction between for-loops and co-routines:
  14 +http://en.wikipedia.org/wiki/Coroutine and McIlroy's original paper
  15 +http://www.iq0.com/notes/coroutine.html
  16 +- the relationship between for-loops and other kinds of loops e.g.
  17 +while-loops, do-while loops and Knuth's loop and a half construct:
  18 +http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf
  19 +
  20 +
  21 +Implement each of these in one or more languages
  22 +
  23 +
  24 +
  25 +
  26 +Hoisting:
  27 +- learning how to hoist variables out of for-loops

0 comments on commit 895c337

Please sign in to comment.
Something went wrong with that request. Please try again.