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

1

u/poltergeistt Jul 14 '14

If the problem appears too complex for an "I'll-cross-that-bridge-when-I-get-there" approach, I usually grab a pencil and a piece of paper.

Instead of drawing diagrams or writing pseudo-code, I break my problem down into bullet points and make a little list of milestones. I try to make it so that each milestone solution can be represented by its own function. I find it easier to implement features and bug fixes that way. No need to go through lines and lines of code, just toy around with a function definition.

Also, sometimes when the problem can be represented graphically (like the convex polygon area one), I visualize my solution on paper in order to fully understand what I need to do.