5 ms·
Code is a planning language, so rather than boxes and noodles or pseudocode, I tend to sketch out my plans in code itself. In SICP this is called "design by wis
by bitwize 14y ago
Code is a planning language, so rather than boxes and noodles or pseudocode, I tend to sketch out my plans in code itself. In SICP this is called "design by wishful thinking": you pretend that you already have a library of primitives that do the nitty-gritty work and write the high-level bits of your program using those primitives. Then, you go back and implement the primitives.
It's surprisingly effective.
- vog 14y agoIndeed, the "design by wishful thinking" was a real eye opener for me. It is one of my favourite parts of SICP. It can also be explained as way to postpone decisions you can't clearly make right now. First, you pretend to have made the decision, and later on you implement the decision "you wish you had made".
- tomsthumb 14y ago> "design by wishful thinking" aka coding by intention
- sbilstein 14y agoDefinitely an effective technique. Personally I like doing this on a whiteboard so I don't get distracted by errors or Compiler/IDE notifications and can just sketch mostly in realistic looking code. For smaller segments though, I'll just write out function signatures, an then go back and fill em out or restructure them.
- facorreia 14y agoThis is also known as top-down design.