News for hackers. Stuff that matters.

Ask HN: How do I become more careful?

I finding myself making a lot of careless coding errors and also failing to consider all the repercussions my changes.

For instance I recently lost a lot of work because of a careless version control screw up.

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.

What are the techniques that you use to achieve greater rigour and perfection in your work ?

( 8 comments | 3 points | on HN )
Re:Ask HN: How do I become more careful? by nmc on Wednesday January 08, 2014 @10:12AM (#7023923)
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...

Re:Ask HN: How do I become more careful? by runjake on Wednesday January 08, 2014 @11:32AM (#7024512)
- 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.

Re:Ask HN: How do I become more careful? by chany2 on Wednesday January 08, 2014 @10:11AM (#7023914)
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.

Re:Ask HN: How do I become more careful? by professorTuring on Wednesday January 08, 2014 @10:22AM (#7023983)
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..."

Re:Ask HN: How do I become more careful? by lostInTheWoods3 on Wednesday January 08, 2014 @11:48AM (#7024610)
- 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.

Re:Ask HN: How do I become more careful? by caw on Wednesday January 08, 2014 @11:20AM (#7024424)
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.

Re:Ask HN: How do I become more careful? by beobab on Wednesday January 08, 2014 @10:09AM (#7023894)
Get lots of sleep.
Re:Ask HN: How do I become more careful? by Mankhool on Wednesday January 08, 2014 @12:24PM (#7024874)
Think before you act.