Documentation Serial.println()

The limitations of string handling in C++ (compared to other languages) have been widely discussed.

I would recommend to add the following hint in the documentation of Serial.print() to make things easier for beginners:

Serial.println((String)"The value is "+3.7+"V");

The little cast will make the things much easier...

Without the cast that could be done with two print and one println statement and it would lead to smaller more efficient code. Why would we want to encourage code bloat for newbies?

That's not to mention the fact that using + with String will make Swiss cheese out of your RAM since an Arduino has no garbage collection to clean it up. On systems with such small RAM to begin with that can turn into a serious problem.

We tend to shy away from the String class in the micro controller world.

Using "String" adds about 500 bytes of code:

#define STRING 0
void loop() {
#if STRING
 Serial.println((String)"The value is "+3.7+"V");
#else
 Serial.print("The value is ");
 Serial.print(3.7);
 Serial.println("V");
#endif
}

Let's face it: future is ARM. There such limitations don't exist

Delta_G:
That's not to mention the fact that using + with String will make Swiss cheese out of your RAM since an Arduino has no garbage collection to clean it up.

The heap will return to the state it was in before the call was made. A short lived fragment is not really an issue.

pYro_65:
The heap will return to the state it was in before the call was made. A short lived fragment is not really an issue.

If and only if the String was local to the function AND no other things were put on the heap in the mean time.

Delta_G:
If and only if the String was local to the function AND no other things were put on the heap in the mean time.

...Which is exactly what that example does!

(if you want to start using Strings and dynamic allocation even in ISRs, you have a whole new level of pain to deal with!)

Anyone with good old C background would appreciate sprintf. But if you grew up with java, you will not appreciate string formatting much. "Just use +"