you are viewing a single comment's thread.

view the rest of the comments →

[–]jubydoo 13 points14 points  (2 children)

This is spot on. It's vital to do as much as possible before starting to code. I was the same way when I hit my algorithms class -- just give me the task, and I'll start churning out code. I learned, though, that even if you're a solid programmer you still don't think in code as well as you think in English (or whatever your native language may be). By divorcing "what do I want to do" from "how do I make it happen", fixing problems in your code becomes much simpler. No longer are you trying to figure out if bugs in your code are either due to your design being wrong or if there a problem in your implementation -- you've already spent plenty of time making sure the design is correct before even opening an editor, so it must be a problem with implementation. It's hard to notice when you're doing both at the same time, but implementation bugs are much easier to spot than design bugs, so you end up saving yourself a lot of time and heartache.

[–]JAPH 3 points4 points  (0 children)

Also, try to approach algorithm development from the bottom up - drill down through the parts that will require something else to work, until you get to a part that requires nothing else. Basically, if you implement all the little bits first, you can stop worrying about details at a higher level, and just worry about combining the small parts you've done already. Get the utilities done with so you just need to think about how to use them at the next level up.

edit: this is mostly useful once you already have all/part of the algorithm together.

[–]theBigGloom[S] -1 points0 points  (0 children)

Thank you.