Last night, I was going to go home and write a short script that would combine nmap's output with that of netstat as to give a better understand of what programs had open ports, as to the best of my knowledge, you can't determine this directly from either app. (If there is a way, I'd appriciate it). So I get home, exercise, get dinner going, check email, and the other usual routines, then sit down and flex my fingers, ready to start typing -- and then my mind wandered.

Part of it was that a new episode of Samuri Jack was on :-), but another reason was that while I knew what I wanted, there seems to be a lot of extra steps in between starting with nothing, figuring out the right nmap and netstat calls, parsing them, combining them, and returning the data in some usable format. For some reason, at least for a Monday night, I couldn't see myself sitting through that process to develop it. Mind you, the idea is still there, and I will try to get to it later in the week, but I've found that lately I've been having problems getting started on any of these projects that I've got in my mind due to causal distractions.

I think part of this comes down to the idea of instant gratification, and the more I think about this, I realize that I typically am one of those that looks for this; certainly, this isn't uncommon. I look at how I regard my experiments that I do at work; some I can assertain the results immediately, and I get more excited about those, while others that require a bit more time or work to get meaningful numbers from, I'm a bit hesitent to work on. With regards to programming, instant gratification comes if I can write a quick 10 line perl script to get something done, but if it's going to involve a lot of background research or the like, I must be in the right mindset to get going on it; once the project's at a point that changes or additions have some visible result with running the code, then it's much easier to continue. This is probably more of a problem for programming done on personal time as opposed to work-related programs, since you HAVE to get those done to earn your paycheck.

So, last night instead of programming, I flipped on the DC and played some games (the ultimate form of instant gratification), browsed the web, and otherwise 'wasted' the night.

So I'm wondering if anyone has any advice, both programmatically or environmentally, that would help in avoid the instant gratification syndrome. I can already think of a few ideas. For complex projects, tasks such as unit testing on small segments of code can help , as you can 'contain' each development piece to a short programming challenge with a way to generate results. Setting a goal for a larger project ("I will write this function and this function today") also seems to help; particularly if those goals are met in the time, then moving on to additional goals is usually an easy extention in the same period. I also figure that programming every day on the same project is good, and a hour or two playing games is certainly enough to allow for the need for instant gratification to be served.

It could also just be an issue of willpower; forcing myself to do the programming despite the lack of instant rewards.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important


In reply to Programming and Instant Gratification by Masem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.