Coding strategies
In reply to “Write the README first, then the code”, Lindsey Kuper pointed me to these great slides by Simon Peyton-Jones on how to write a research paper (pdf): Write the paper first, then do the research.
One of the hardest and most memorable coding exercises that I’ve done was to spend 30 minutes writing code that I really thought was good, and then delete it.
Another super fun thing is to pair and have one person write the tests and the other person write the code.
Coding strategies: write code for 25 minutes, then git reset --hard no matter what happens
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: write the README first, then the code
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: pretend you have the code already, and write a program using it
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: code without using the internet for an hour
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: talk to someone about your code for 15 minutes
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: explain what you're doing to someone who doesn't know how to program
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: go read someone else's code. think about why you don't like it.
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: blog about your coding problems
— Julia Evans (@b0rk) December 29, 2013
Coding strategies: code for 30 minutes without thinking about whether it's good or not
— Julia Evans (@b0rk) December 29, 2013
Erik also started tweeting coding strategies! He is the best. I especially like “ride a bicycle until you are out-of-breath on the other side of town.”
Coding strategies: try unselfconsciously following your instincts.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: set a goal for yourself (perf, immutability, type safety, terseness, whatever) and try prioritizing it above all else.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: try self-consciously interrogating every decision and design you make.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: watch "the five obstructions" then apply similar challenges to your code.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: port someone else's code to a new language to learn about their code and/or the other language.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: ride a bicycle until you are out-of-breath on the other side of town.
— Eiríkr Åsheim (@d6) December 29, 2013
Coding strategies: try using property-based testing and test coverage to determine every possible way your code can fail.
— Eiríkr Åsheim (@d6) December 29, 2013
To sum up my coding strategies: avoid dogma, question conventional wisdom, try new things, be idealistic, improve, and have fun.
— Eiríkr Åsheim (@d6) December 29, 2013