9 Replies - 1667 Views - Last Post: 03 April 2012 - 11:30 AM

#1 searcher920  Icon User is offline

  • New D.I.C Head

Reputation: 15
  • View blog
  • Posts: 44
  • Joined: 30-December 11

Do you ever feel confused?

Posted 29 March 2012 - 05:00 PM

I think that even relatively simple programs can be confusing sometimes. Is this normal? Sometimes I get into a confused state, but if I stay calm I get it figured out pretty soon. I feel like this is part of the rhythm of programming -- you're going along and getting things done, and then suddenly fall into confusion. There is a lot to keep track of and most of it has to be kept in your mind.

There are things that help of course, and one of them is having lots of tests that cover everything you have written so far. Then if you go down the wrong path and find yourself lost of the forest, the tests are always there to guide you back. Also, of course, making sure your code is well organized to begin with.

But no matter what, I still get confused sometimes. It can feel like there will never be a way out of the maze, but of course you always find it.

Sometimes I wonder if this confusion just means I'm a lousy programmer, and maybe good programmers don't experience it.

So that's why I'm asking this -- do you ever get confused while coding or does it always go smoothly and come easily?

This post has been edited by searcher920: 29 March 2012 - 05:02 PM


Is This A Good Question/Topic? 1
  • +

Replies To: Do you ever feel confused?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5432
  • View blog
  • Posts: 11,645
  • Joined: 02-June 10

Re: Do you ever feel confused?

Posted 29 March 2012 - 05:11 PM

The more you plan in advance BEFORE banging on the keyboard the less this will happen to you.

Read this article to get started on the right foot:
This is the 'Help me with my homework' article you wanted.
Was This Post Helpful? 1
  • +
  • -

#3 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Do you ever feel confused?

Posted 29 March 2012 - 05:13 PM

Sometimes for me it's just a line of code that I've overlooked, or a bit of logic that I've stuffed up. I end up trying everything until I find the solution - of course, if its something I don't know I would either post here or look it up on Google or MSDN.
Was This Post Helpful? 0
  • +
  • -

#4 BBuschRN  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 83
  • Joined: 28-February 12

Re: Do you ever feel confused?

Posted 29 March 2012 - 05:22 PM

View PosttlhIn`toq, on 29 March 2012 - 04:11 PM, said:

The more you plan in advance BEFORE banging on the keyboard the less this will happen to you.

Read this article to get started on the right foot:
This is the 'Help me with my homework' article you wanted.


Thanks for the article (blog). The debugging videos are just what I need.
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,681
  • Joined: 19-March 11

Re: Do you ever feel confused?

Posted 30 March 2012 - 08:24 AM

Confusion usually means you don't understand your program well enough. This is fixed at the whiteboard, not at the keyboard. Better yet, use the rubber-duck approach: find someone who's willing to listen and explain your program to them until the problem pops out. They don't have to fix the problem for you, or even listen - they might as well be a rubber duck (thus the name). The point is that you have to verbalize the details - then you see the thing you were missing.
Was This Post Helpful? 3
  • +
  • -

#6 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5770
  • View blog
  • Posts: 12,582
  • Joined: 16-October 07

Re: Do you ever feel confused?

Posted 30 March 2012 - 08:59 AM

When you write a program, you start with a plan. The plan could be a vague idea or something completely fleshed out. However, as you work you WILL find issues that your plan didn't allow for. You adjust and move forward.

As you learn more, you may come to realized that the original plan isn't going to work. You must adjust again. You may have to scrap the original plan entirely and start fresh. However, you're starting with the experiences of what didn't work and why. This is can be much more useful than the hypothetical you started working with.

Experienced programmers learn more from scrapped plans than successful ones. Experience teaches that sometimes it's time to bite the bullet and try another plan. More experience will help avoid such dead ends. It's simply part of the learning process.
Was This Post Helpful? 4
  • +
  • -

#7 searcher920  Icon User is offline

  • New D.I.C Head

Reputation: 15
  • View blog
  • Posts: 44
  • Joined: 30-December 11

Re: Do you ever feel confused?

Posted 30 March 2012 - 02:37 PM

View Postjon.kiparsky, on 30 March 2012 - 08:24 AM, said:

Confusion usually means you don't understand your program well enough. This is fixed at the whiteboard, not at the keyboard. Better yet, use the rubber-duck approach: find someone who's willing to listen and explain your program to them until the problem pops out. They don't have to fix the problem for you, or even listen - they might as well be a rubber duck (thus the name). The point is that you have to verbalize the details - then you see the thing you were missing.


What I usually do, really, is dream about the program, and the next day I have the answer. If I think about the program while falling asleep, I will probably dream about it the entire night.

And in my opinion, if you never get confused while programming, then something is wrong. Programming is problem-solving, not just typing. Problems are confusing, or else they are not problems.

It doesn't matter how great the plan is that you started with. Plans are all based on past experience, and each program you start is somehow new and different. Or you would just be using one that already exists.
Was This Post Helpful? 0
  • +
  • -

#8 Creecher  Icon User is offline

  • I don't care
  • member icon

Reputation: 561
  • View blog
  • Posts: 2,049
  • Joined: 06-March 10

Re: Do you ever feel confused?

Posted 03 April 2012 - 06:56 AM

Every damn day. But I take that as a sign that I'm still learning.
Was This Post Helpful? 0
  • +
  • -

#9 BenignDesign  Icon User is offline

  • holy shitin shishkebobs
  • member icon




Reputation: 5915
  • View blog
  • Posts: 10,332
  • Joined: 28-September 07

Re: Do you ever feel confused?

Posted 03 April 2012 - 10:55 AM

I get confused quite regularly, but it's not my code's fault. Oftentimes, I'll be working along, doing my thing, and my mind will wander off into the abyss that is life... the kids' schedules, family obligations, reports I need to finish, meetings I have to attend, appointments I need to make, groceries I have to buy, that vacation I'd like to go on, who I need to call soon, other projects on my to-do list... and I get sidetracked. When I let my mind wander, I make mistakes. Sometimes I'll be typing out one section of code, but my mind is already writing the next three steps... and in my code, I'll skip the second step and move on to the third so that later, the whole thing fails to function properly. I find this to be at its absolute worst when I'm staring at printed code, trying to find a problem - there are so many other things living in my head, I find it extremely difficult to concentrate on the printed page for very long. Maybe it's old age. Maybe it's adult-onset ADHD. Maybe it's a lack of sleep. Regardless, I find myself in a semi-permanent state of confusion.

This post has been edited by BenignDesign: 03 April 2012 - 11:45 AM

Was This Post Helpful? 0
  • +
  • -

#10 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,681
  • Joined: 19-March 11

Re: Do you ever feel confused?

Posted 03 April 2012 - 11:30 AM

View Postsearcher920, on 30 March 2012 - 04:37 PM, said:

What I usually do, really, is dream about the program, and the next day I have the answer. If I think about the program while falling asleep, I will probably dream about it the entire night.


Getting away from the problem by some means or other is a tried and true approach. "Sleep on it" is good advice - if you've spent enough time understanding the problem that your unconscious has something to work on. I often see novice coders just flailing at a problem, trying to throw code at it until it solves itself, and they'll never get any benefit from sleeping on it, because they haven't understood the problem.

Quote

And in my opinion, if you never get confused while programming, then something is wrong. Programming is problem-solving, not just typing. Problems are confusing, or else they are not problems.

It doesn't matter how great the plan is that you started with. Plans are all based on past experience, and each program you start is somehow new and different. Or you would just be using one that already exists.


Frankly, I think this is why you get confused. Planning ahead limits your confusion by tying a new problem back to problems you've already solved. There are no completely new problems - everything you've done is mostly a variant on something you've done before. Yes, there are new things to learn - if you've never written a rogue-like dungeon crawler, you're going to have to either use some sort of existing curses interface or implement that functionality. That'll be new.
But the problems of representation are the same ones you've wrestled with as a programmer from day one. How do you represent

   ------------------        ----------------------
   |                |        |                    |
   |                |        |                    |
   |                +########+                    |
   |                |        |                    +
   ---------+--------        -----------------+----
            ######
      -----------+--------                            -----------------------
      |                  +########    ----+---------##+                     |
      |                  |       #    |............|# |    ?                |
      |                  |       #    |............|# |                     |
      |        %         |       #    |.........B..|# -+---------------------
      |                  |       #####+...........@+#  #
      -------+------------            ------------+-   ###############
             #######                              #                  #
          ---------+----                          #   ---------------+------
          |            |                 #############+                    |
          |            |     ------------+-------- #  |                    |
          |            |     |                   +##  |                    |
          --------------     |                   |    ----------------------
                             ---------------------

Level: 1  Gold: 25     Hp: 12(12)   Str: 16(16) Arm: 4  Exp: 1/9



(EDIT: sorry about the window damage - pop out to see it in its full glory)

in memory? Well, there aren't that many ways to do it, honestly, and you've probably done all of them.
So there should be nothing confusing about this problem. Difficult, possibly. There will certainly be things that take a lot of mental effort to implement correctly. There will be design decisions where it's really not clear whether it should work like this or like that - that can be confusing, but nothing about writing the code is confusing there. It's the people that will use it who are confusing.

There are a lot of sources of confusion out there. As B9 points out, life is distracting and code is complex. Lose track of your attention, and you're screwed. There are a lot of poorly-made tools out there which do not respond in reasonable ways. (Microsoft products, for example, typically fall into this category, due to poor design and poor documentation) There are bad programmers that you might be working with who present you with obfuscated code, and there are third-party vendors who give you pretty-much-what-you-asked-for-but-not-quite, and give it to you too close to your deadline to do anything about it.

There's lots of ways to get confused, but you can approach your part of it in a way that ensures that you will not be adding to your own confusion.

This post has been edited by jon.kiparsky: 03 April 2012 - 11:31 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1