Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I noticed that every developer implements a somewhat different flowchart for solving programming problems.

By flowchart I mean a defined system of techniques that the developer goes through in a certain sequence, trying to solve the problem at hand.

Some examples for techniques:

  • Google "how to..." or "... tutorial".
  • Search the java/msdn/apple/etc API doc for the specific class or method.
  • Search in stack overflow the exact problem with some tags like [iphone]/[java] etc.
  • Take a nap and let the subconscious work.
  • Debug.
  • Draw the algorithm or system.
  • Google the logged error message.
  • Ask a colleague or manager.
  • Ask a new question in stack overflow.

From your experience, what is the best flowchart for solving a programming problem?

share|improve this question
1  
You left out "thinking." Using the ol' noggin' and analyzing the problem works most of the time. –  Bernard Mar 18 '12 at 18:49
add comment

2 Answers

  • Think: consider issues that might come up, what resources you need, etc.

  • Design: create the technical plans that will be implemented as the product. UML is an excellent lingua franca of software engineering.

  • Test: create tests that will pass when the product is complete; this let's you know when you can stop programming. When the tests pass, you're done.

  • Create: implement the design and run the tests. Any extra problems encountered require refactoring the design and tests.

This process minimizes bugs and typing time (typing is the least insightful part of software engineering).

share|improve this answer
    
I guess I didn't answer your question exactly, but my experience says that most programming problems are a result of poor design and lack of forethought, so this process is the ounce of prevention that will improve your life and win you friends. Probably. –  JoshRagem Mar 18 '12 at 20:09
    
If you wanted the Asker to receive your comment, you have to post the comment on the question. –  Dynamic Mar 18 '12 at 20:30
    
Thanks for the tip –  JoshRagem Mar 18 '12 at 23:07
add comment

Here is what I'd do (assuming that the task at hand is a one-man task and should be completed in short period of 1-4 days or so.)

Put a work plan to include the following:

  1. Understand the problem carefully

  2. Identify solution elements (math background, new tool, etc.)

  3. Assess your current abilities vs. what seams to be required

  4. Decide to solve the problem or not based on the above step.

  5. If you decided that you can solve the problem given your skill set and time required, put an action plan to solve the problem, that would include:

A. Complete deficiency in background (Tutorials, books, etc.) - This may include going to a course, acquire books, download software, etc. The exact answer depends on the problem at hand. For example, there is no value in trying to learn HTML in a day to solve a design problem but you can search the net for how to convert a string date to a julian date using the internet.

B. Think about the solution given the current situation parameters now that you know the technology and produce a design with success scenarios and constraints (time, size, etc.). If you got stuck on a detail (e.g. how to write Regex to parse ISBN number, ask colleges if they are cooperative or go ask the net or look it up in a book).

C. Assess your solution and see if it is the best (Search, discuss, etc.)

D. Prototype

E. Build a working version and debug until it works as designed

If when run as designed you don't get what you want (as in B), Go TO B again Else Buy everyone lunch and call it a day :).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.