Need guidance on programming technique

Often new students know what they want to do, but don't know where to start...the old How Do You Eat An Elephant problem. I find it useful to think in terms of 5 program steps:

  1. Initialization -- what has to be done before the user (system) sees anything. e.g., read configuration data from
    EEPROM,open DB connections, initialize ports, etc. (setup())
  2. Data input -- do whatever needs to be done to get and verify the data
  3. Process -- almost all programs take data in one form and change it to some other form
  4. Output -- could be a display, but may be writing data to an SD card, altering a heater, etc.
  5. Termination -- clean up after yourself, often undoing what was done in Step 1. Not always needed in
    system programming.
    Once that's done, I do a sideways refinement, which is a lot like what was mentioned in terms of pseudo code. If you do this first, the program almost writes itself. It is possible to get too carried away and fall into the old BDUF (Big Design Up Front) issues where you spend six month writing a design which lives for about 2 days, hence Agile technologies. Still, a little forethought goes a long way towards writing better code, faster.