Skip to main content
improved comments based on feedback.
Source Link

I'm having flashbacks to my early days as a C programmer in the 80's.

Some thoughts in addition to all of the excellent advice already given ...

  • Depending on how much data your application uses, you may want to read / write data to an SD card (or other external storage). While there is a certain amount of overhead for the libraries, the payoff is you then have virtually unlimited storage. This is the equivalent of how we used to store data on 5 1/4" diskettes back in the old days.

  • You should use dynamic memory as much asAvoid static variables whenever possible.

  • Keep the scope of a variable as small as possible.

  • Re-use variables if you don't need them at the same time (this also makes for hard to read code, so use a lot of comments)

  • As a philosophy you should consider unsigned char to be your default data type and only 'upgrade' to a bigger footprint when your code requires.

I'm having flashbacks to my early days as a C programmer in the 80's.

Some thoughts in addition to all of the excellent advice already given ...

  • Depending on how much data your application uses, you may want to read / write data to an SD card (or other external storage). While there is a certain amount of overhead for the libraries, the payoff is you then have virtually unlimited storage. This is the equivalent of how we used to store data on 5 1/4" diskettes back in the old days.

  • You should use dynamic memory as much as possible.

  • Keep the scope of a variable as small as possible.

  • Re-use variables if you don't need them at the same time (this also makes for hard to read code, so use a lot of comments)

  • As a philosophy you should consider unsigned char to be your default data type and only 'upgrade' to a bigger footprint when your code requires.

I'm having flashbacks to my early days as a C programmer in the 80's.

Some thoughts in addition to all of the excellent advice already given ...

  • Depending on how much data your application uses, you may want to read / write data to an SD card (or other external storage). While there is a certain amount of overhead for the libraries, the payoff is you then have virtually unlimited storage. This is the equivalent of how we used to store data on 5 1/4" diskettes back in the old days.

  • Avoid static variables whenever possible.

  • Keep the scope of a variable as small as possible.

  • As a philosophy you should consider unsigned char to be your default data type and only 'upgrade' to a bigger footprint when your code requires.

Source Link

I'm having flashbacks to my early days as a C programmer in the 80's.

Some thoughts in addition to all of the excellent advice already given ...

  • Depending on how much data your application uses, you may want to read / write data to an SD card (or other external storage). While there is a certain amount of overhead for the libraries, the payoff is you then have virtually unlimited storage. This is the equivalent of how we used to store data on 5 1/4" diskettes back in the old days.

  • You should use dynamic memory as much as possible.

  • Keep the scope of a variable as small as possible.

  • Re-use variables if you don't need them at the same time (this also makes for hard to read code, so use a lot of comments)

  • As a philosophy you should consider unsigned char to be your default data type and only 'upgrade' to a bigger footprint when your code requires.