21

!rant

Trying not to suck at code.

A good coder seems to be some one who does mistakes quickly and has strategies on how to resolve them even quicker.

The speed at which you create/resolve your problem is the experience curve at which you are learning.

How do you deal with headaches and frustration when spending hours on the same issue?

What are common efficient strat for debugging?

I know this sounds very generalised but i feel like it takes me days to do small things and need to take breaks all the time to relieve the pressure.

Any advice for a rookie?

Comments
  • 11
    1. A fresh set of eyes is always welcome when debugging.

    2. Take breaks. Bug solutions can also appear in dreams.
  • 3
    Walks just enjoying the scenery can be amazing cause your minds working on the problem in the background anyway and you get a break...sometimes answers just come to you without much effort this way...same as sleeping on it.
  • 1
    Use your colleague and explain your problem with the rubber-duck style.
    You might miss something obvious which will be caught by your peer.
  • 2
    Caffeine. Lots of it.
  • 3
    * Don't sweat it too hard.
    If you're stuck or forming a overly complex solution, it's probably time for a walk, get some refreshments etc.
    - and most importantly, don't continue grinding it in your mind while off it.

    * Practice regular breaks.

    * Stay hydrated & healthy.
    - mind & body (gut in particular) is more connected, than what meets the eye at first. (sympathetic nervous system)

    * Don't hold yourself back and loosen up every now and then.
    - if you let yourself grow dry roots (ie. By never being out & socializing),
    You'll eventually feel depression creeping in.
    While depressed state can be great for coding, it more often than not devalues your presence and the work you do.
    - essentially becoming a "millennial work horse" (work harder, get paid less.)
    src: https://forbes.com/sites/...
  • 2
    I can confirm @bjorngi s statement.
    Solved a very nasty Memory leak yesterday night while my supervisor (Dev for about 30 years) couldn't catch it in days :D
  • 1
    In case you don't already: use a good debugger. It sure beats putting print statements everywhere and it amazes me how many people don't use debuggers. Most of the time I can pinpoint the culprit within a few minutes using a debugger.

    Also use unit tests during development. Might be TDD or not, just create a single or a few tests for the functionality you're currently working on and keep running it.
  • 1
    I have the same doubt ..I feel like i am pretty slow in learning things by reading . But often i get stuck with things and i dont know how to search for a solution and more often than not, i get frustated and i can feel that my mind is not working in the same efficiency. How to relax when stuck with a problem ? and is it okay to regularly take time to chat with a friend in the same company in the middle of my work ?

    P.S. I dont drink coffee/tea .
  • 0
    @TheShell what kind of debugger do you havr in mind as an example? Ive learnt to br quite effectivr at breaking or logging my code so that i can pinpoint my mistake.

    And yeah tdd`s do help but because of lack of experience if i do yhe tdd ill most likely have to change it as i improve the code so I'd ownt be written until im finished implementing -_-
  • 0
    Anywya thanks for advice will keep to it.
  • 1
    @Santaclauze I use the IntelliJ internal debugger. Just breaking and stepping through your code gives incredible insight.
    I also have that problem with real TDD, but I tend to make small unit tests for the particular functionality I'm working on just to isolate running and debugging my code to the part I'm working on. Afterwards it doesn't matter whether you keep the test, alter it or remove it completely. It's just faster than running and debugging your entire application.
Add Comment