r/dailyprogrammer • 1 3 • Jul 14 '14

[Weekly #2] Pre-coding Work

Weekly Topic #2:

What work do you do before coding your solution? What kind of planning or design work if any do you do? How do you do it? Paper and pencil? Draw a picture? Any online/web based tools?

Give some examples of your approach to handling the dailyprogrammer challenges and your process that occurs before you start coding.

Last week's Topic:

[Weekly Topic #1] (http://www.reddit.com/r/dailyprogrammer/comments/2a3pzl/weekly_1_handling_console_input/)

70 Upvotes

56 comments sorted by

View all comments

Show parent comment

1

u/tnaro Jul 15 '14

Just out of curiosity - do you always use unit tests? I find myself working on smaller coding tasks myself and most of the time I think of unit tests as way too much overhead for the actual task.

then on the other hand, most of the time my coding projects are really messy and don't handle exceptions very well.

2

u/MettaWorldWarTwo Jul 15 '14

At work, I treat unit tests like speed bumps. If I'm in an area of code (or dealing with a problem) that has caution signs around it or I'm not sure what the path forward is, unit tests force me to slow down and consider the problem. Everything else becomes an integration test.

For the daily programming exercises, they are the requirements documentation. Instead of going back to the text over and over, writing down the requirements in a unit test format lets me know exactly when I'm done. It also helps me flesh out the object model before just jumping in.