Areas for discussion.

Serial.print("x ");

Serial.print(x);
Serial.print(" y ");
Serial.print(y);
Serial.print(" z ");
Serial.println(z);



I think beginners find that ungainly.

I can agree, but they seem to figure out that cut & paste is helpful, and they have few preconceptions about how hard it should be.

[edit]IMHO, it is us, the folks with experience of several alternatives who have the most problems with it because we have the baggage that "it can be so much neater". My experience of folks new to this stuff is, "well, it makes sense, it's a bit of typing, I'll just do it".

I'm not saying we should accept an ungainly approach simply because beginners know no better. I'm just saying it doesn't seem to be as annoying as, for example, watching the screen scroll past like crazy when all you are looking for is two numbers changing.[/edit]

If this were a whole new language, then I can imagine that it could be neater. I just feel overloading "<<" brings more pain that relief.

Warning: Dreamy rant alert
I prefer to live within the constraints of a popular existing language (C++), which is a pretty good fit for what we use it for, and which has relevance in industrial contexts, and is not a toy language.

I like that the Arduino team has the taste and talent to make the barrier to entry so low that children, who have never programmed in their lives before, can get to grips with it in less than ten minutes.

I like that folks don't need to learn about C++ 'class' and can still produce wonderful, amazing things.

I like that the full power of C++ is snuggled their under the covers, so that if I really need to use it, I can.

Arduino really is a work of genius. I look at the 'competition', who have this example of genius in front of them, and who could "stand on the shoulders of giants". I see that Arduino is still amazingly good. IMHO the "Arduino Language" is better than any other examples I've seen. It is the things that are used with delicacy and taste that I admire most. Others can't resist using extra features, and seem to end up requiring quite a lot of sophistication to understand what is happening. Less is more :slight_smile:

End: of Dreamy rant

I am not saying the Arduino Language is perfect, just better than the other examples I've seen, especially for beginners to embedded programming.

Do you not like my suggestion of something like

Serial.o("x ").o(x).o(" y ").o(y).o(" z ").o(z).endln();

I admit, I don't like it much, but it is less to type :wink:

I think it is only slightly better than "<<" for print, from the perspective of the concepts you'd need to do it yourself.

But much better than "<<" overloading print from a beginners perspective, especially if you also want to use bit manipulation with left-shift.

IMHO, it is also better to avoid operator overloading for the sake of a Java or C programmer, and Java is one of the most poplar professional programming languages in the world, and C, reputedly, the most popular embedded programming language (tussling with assembler?). I think they would get that Serial.o().o().o() approach.

HTH
GB-)