I guess it's time to share

tochinet
Just to make my point about moving data to program space I took all the Serial.print(ln) from the utility001.ino from the zip file from the first post and put them in the loop() of a sketch.
Which gives met this code (with the F)

void setup() {
}


void loop() {
  // put your main code here, to run repeatedly:
  Serial.print(F("# Initializing SD card..."));
    Serial.println(F("Card failed, or not present"));
  Serial.println(F("card initialized."));
    Serial.println(F("# Toggle Relay 1 - VENT"));
    Serial.println(F("# Toggle Relay 2 - LIGHT"));
    Serial.println(F("# Toggle Relay 3 - PUMP"));
    Serial.println(F("# Toggle Relay 4 - AERATE"));
    Serial.println(F("# Delete Data File"));
    Serial.println(F("# Dump Data File"));
    Serial.println(F("# error opening file"));
    Serial.println(F("# probably doesn't exist"));
Serial.println(F("# Removing your file..."));
}

compiling in GCC without F gives me

Program:    4814 bytes (14.7% Full)
(.text + .data + .bootloader)

Data:        433 bytes (16.9% Full)
(.data + .bss + .noinit)

Compiling with F gives me

Program:    4838 bytes (14.8% Full)
(.text + .data + .bootloader)

Data:        155 bytes (6.1% Full)
(.data + .bss + .noinit)

So using F in this small program saves roughly 10% of data space. You will have to do some really bad programming in OO before you will waist the same amount of Data space. That is and was my point.

Udo Klein
I think we are on the same page. As to the String class. I try to avoid it. It is really unwise to use it for 1 single line of code. But; when I'm building a string intensive application (for instance a web server) I prefer using the string class to writing lots of char array functions. I'm even convinced that "in real life" using the String class in such case may result in less data space usage. This because there will be less code when using the String class and as such less opportunities to waste Data space.

Jimmy60

Jimmy60:
I did find while playing around that having stuff in a library or in the main sketch had no effect on program space as long as the code was the same.

This is a 100% correct observation. From a compile perspective the Arduino IDE does not make a distinction between the code and a library. The only difference is that the code is compiled before the library to increase the chance of finding compilation errors soon.

Best regards
Jantje