The Computational Universe Pseudocode Reference [pdf](cs.princeton.edu)
cs.princeton.edu
The Computational Universe Pseudocode Reference [pdf]
https://www.cs.princeton.edu/courses/archive/spr11/cos116/handouts/Pseudocode_Reference.pdf
6 comments
Using arrows for assignment is annoying on keyboard, should have chosen :=
Haskell uses <- for monadic binding in do blocks.
That's an arrow that's no harder to type than :=
Hmmm... Now you said that, I realize that on my be_BE layout keyboard, ":" and "=" keys are adjacent and don't even need "shift" to be typed where as "<" and "-" are on the extremes of the diagonal of the keyboard (no kidding!) :-)
This is ridiculous.
1. Pseudocode should be typeable in an email.
2. You should be able to write pseudocode on a whiteboard without worrying about syntax.
3. Pseudocode should be loose enough that it suggests a domain-specific language that it might inspire.
4. If your pseudocode requires a mechanism for comments, you’ve lost the plot. In their example, they comment ‘v1’ as ‘variable holding candidate 1’s tally’. Then name it that! ‘tally_can1’ would be much better.
1. Pseudocode should be typeable in an email.
2. You should be able to write pseudocode on a whiteboard without worrying about syntax.
3. Pseudocode should be loose enough that it suggests a domain-specific language that it might inspire.
4. If your pseudocode requires a mechanism for comments, you’ve lost the plot. In their example, they comment ‘v1’ as ‘variable holding candidate 1’s tally’. Then name it that! ‘tally_can1’ would be much better.
Fair, but if you're teaching an entry-level undergraduate CS course, you have to to start somewhere, right? Giving them a set of best practices and a clear syntax does that. And then, as students progress, they can be as creative as you suggest.
No pointers?
How would they write the pseudocode for a linked list?
How would they write the pseudocode for a linked list?