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 love programming and I can't imagine living without it. The problem is when I am developing my own unique algorithms I find it difficult to properly co-ordinate my thinking and I spend more than the reasonable time trying to visualize the solution, although I usually find the solution. I think spending that much time on sometimes "not that hard" algorithm show's that my thinking strategy might be wrong.

Have you experienced similar issues? How do you solve it? Or am I wrong? Please advise me.

share|improve this question

migrated from stackoverflow.com May 2 '11 at 11:57

This question came from our site for professional and enthusiast programmers.

    
Did your parents force you into programming? –  Job May 2 '11 at 21:30
    
@williams - If you register your Stack Overflow and Programmers accounts with the same OpenID your accounts will be associated and you'll regain ownership of the question. –  ChrisF May 4 '11 at 9:20
    
Thank you everyone, I'm beginning to see a clearer picture now, especially with point's made by @IAbstract and @Codism –  user24521 May 4 '11 at 9:21
add comment

5 Answers

With the same talent for getting dug in too deep, I had to look at how I was thinking about design, architecture, algorithms, and all that goodness. Getting bogged down in so much information makes it difficult to regain your vision - "what was it I was looking for?

So, I have taken 2 steps to improve my development efficiency and keep from getting information overload:

  • Start writing notes as if you were talking to someone else about the design issues, etc. You will find that when you get buried under tons of information, this document can help you get back on track - or find flaws in your logic.
  • Draw pictures, Paint is awesome. As you gain a clear vision of how objects relate to each other, your diagram will take shape.
share|improve this answer
    
(+1) These days many programers don't know about making flowcharts (activity diagrams for you, UML guys) for some code. –  umlcat May 2 '11 at 21:38
    
To the "draw pictures" comment, sometimes when I'm really blocked I find mind-mapping programs useful. There is a good list of them here en.wikipedia.org/wiki/… –  Bill May 3 '11 at 23:27
    
+1 I bought a whiteboard because I find a pen easier than a mouse. I highly recommend the "draw stuff" approach. –  Chris Browne Oct 6 '11 at 14:04
add comment

In my experience, the more you program the better you get at mentally picturing an algorithm and converting it into code. You'll find that common patterns keep on emerging.

Often if you are spending a long time programming simple, well known algorithms, you are better off using implementations that already exist. Most well-known languages have extensive support for many useful data structures and algorithms that can save you a lot of time.

Other than that, i'd say that spending a bit of extra time planning a solution saves you debugging work in the long run, so it's not all bad!

share|improve this answer
add comment

At the beginning, I was forced to create flow charts before I could write the code. I also had to create printer spacing charts for each report.

Occasionally I will create a small flow chart when I need to test out some logic or when I need to figure out a piece of code written by someone else.

Here are three simple questions you can use...

  1. What is the input? (this can be data, business rules, formulas, etc.)
  2. What is the output? (this can be reports, screen output, database tables)
  3. Do I have enough input to create the output?
share|improve this answer
add comment

The solution is to not feel obligated to be smart. Just enjoy the process of discovering the solution. Your thinking skill will be improved over the time but don't feel bad if there is a limit as every one has its limit. Forget about the desire to be smarter than average people and focus on what you are doing, you will have better chance to reach or even push your limit.

share|improve this answer
add comment

I tried diving straight into C++ and tried to take on some immense tutorials when I started to program. After learning nothing (but making some groovy apps thanks to copy paste), I picked up a book on BASIC, and among the first things it told me was how to plan programmes and data flow using pseudo-code and flow-charts/diagrams. I think that if you have something like that sat on a notepad, or as a jpg you can quickly refer to will help immensely in letting you visualize your algorithms., and help you see solutions where juggling everything inside your head has failed.

share|improve this answer
add comment

Your Answer

 
discard

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