Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Feeling unmotivated, any advice?

  1. Oct 25, 2012 #1
    I am a jr cs student. I just transferred to a university from a community college and I feel a HUGE different in terms of difficulty. I have been working on 1 assignment day and night and I can't seem to get it done. The assignment is much larger than I am used to and I am getting bugs from every little code I write.

    I am starting to feel unmotivated and about to give up. Do you guys have any tips or advice for tackling these big projects? What should I do to reduce the amount of bugs I get?
  2. jcsd
  3. Oct 25, 2012 #2
    That's a tough one.

    You could try applying the Unix philosophy of writing small functions that do one thing but do it well...functions that do not do much more than one thing at a time without confusing the matter by trying to kill two or more birds with one stone and trying to do different things within the same loop, finding yourself including 'if' statement, etc. and keeping track of several tasks all in your head at the same time.

    Some of the code may be the same, but who cares...maybe at the end, with better vision, you can join things together if performance is really an objective...to start, though, clarity, debugging ease and extensibility are best.

    Also, "prototype and re-write" is not that bad....don't continue a bad path, just because you started that way...some times writing something for the first gives you a better taste for it and you can come back a second time and be surprised how much better and simpler you can write it.

    Good luck
  4. Oct 26, 2012 #3


    User Avatar
    Science Advisor

    Hey Instinctlol.

    My advice for reducing bugs is to keep the state-space in your head for the variables and if you can't do that right now in your education, then get out a piece of paper and do it that way.

    The paper should contain all the variables, it's values that exist and what they should be in order to not get a crash or non-valid behaviour.

    Then look at your code and see if re-inforces what you have on paper and if you get a mis-match then that will give you a hint of where to look for errors and what to change.

    Then look at where the data-flows: does it get passed to other functions? Do other functions access it? How does all this affect what you expected it to do and your paper model?
  5. Oct 26, 2012 #4
    Thank these are great tips, I will consider them.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook