

Ask HN: How do I become more careful? - thewarrior

I finding myself making a lot of careless coding errors and also failing to consider all the repercussions my changes.<p>For instance I recently lost a lot of work because of a careless version control screw up.<p>I try to focus better but there seems to be a limit beyond which I just cant avoid slipping up more often than normal people.<p>What are the techniques that you use to achieve greater rigour and perfection in your work ?
======
nmc
Two pieces of advice:

Read "horror stories", like a crazy bug introduced by an innocent commit, or
how forgetting a single line of code can lead to a massive security breach.
This will give you some "subconscious awareness" about the power of the tools
you are using.

Pre-emptively prevent yourself from making mistakes. If you know you often
misuse some command, just make it ask you for confirmation:

    
    
      function confirm() {
        echo -n "Continue? (Y/N) "
        read YN
        return $([ "$YN" = "Y" ])
      }
      alias rm="confirm&&rm"
    

You could even consider more elaborate checks, like GMail's "Mail Goggles"
[1].

[1] [http://gmailblog.blogspot.nl/2008/10/new-in-labs-stop-
sendin...](http://gmailblog.blogspot.nl/2008/10/new-in-labs-stop-sending-mail-
you-later.html)

------
runjake
\- Get enough sleep.

\- Exercise (even walking) to keep the blood flowing well.

\- Eat right & drink water throughout your work day.

\- Eliminate distractions (HN) and arrange regular periods of silence each
day(eg. no radio or podcasts on my commutes).

\- Maintain GTD-esque dump buckets for stuff that shouldn't be stored in your
head. Get those things out of your head and into your system so that your
brain can more easily focus on what needs to be done.

------
chany2
Depending on what you are building, I think its natural to make mistakes. If
you are building your own product, your mind is probably spinning between
technical, design, and marketing. Within each buckets, you are also trying to
think more innovative-ly. With inclusion of you doing research, and constantly
thinking outside-of-the-box, its human to forget a previous step or two.

The other option is using stuff like Koality, which allow you to test your
code in development with a production environment.

------
professorTuring
If you want to become more careful then you have to:

1\. Age: the older you get, the more errors you have made in the past, the
more careful you are.

2\. Meanwhile... make yourself a procedure with bullets (or a decision tree)
for critical things and _stick to it_ . Sticking to it is fundamental.
Something like "1\. Make a backup of the original work. 2. Check the origin of
the problem. 2. Check the solution done. 3..."

------
lostInTheWoods3
\- Make small changes, frequent commits

\- Make testing habitual

\- Keep a record of everything you do

\- Have a backup. Be ready and able to revert.

\- Automate what you can

\- Create procedures (checklists) for common tasks

\- Slow down. Never rush to commit code.

If your problem is focus, identify what the distraction is and deal with it.

------
caw
I use post-it notes on my monitor to remind me of things, until I don't need
the note anymore.

When I first started managing NFS storage, I had "Never use recursive" taped
to my monitor so I would never do something horribly recursive across the NFS
space.

------
beobab
Get lots of sleep.

------
Mankhool
Think before you act.

