For beginners, searching on "Arduino" returns far more useful results than C or C++.
My perspective is that it's essential to provide a gentle learning curve for beginners ... The language reference currently does a great job
The novice will quickly reach the point where they need more from the Arduino programming language, ...In the other thread where we discussed this, we had someone who had been using Arduino for 4 years and just happened to learn by chance that they could use templates in the Arduino programming language. I don't think that's an acceptable situation.
This discussion isn't about beginners. This is about the more advanced users. They matter too.
The file is named Arduino.h.
Is there a standard mechanism for setting up a .h file so that C++ gets to use constexpr, and plain C gets the closest equivalent that is still plain C? Significant parts of Arduino SW are still written in C...
4 years and they never realized this was C++. That's sad but they were at fault.
Documenting constexpr and templates in the Arduino reference is a terrible idea. The Arduino reference is already too large for beginners. Discussing these in the Arduino forums will never do them justice. They are C++ features that are regularly discussed in the C++ forums and often very in great detail. If you truly want to extend your C++ knowledge, you will learn much more there.
Discussing the basics here is fine but people need to learn there are additional resources that can be far more useful.
it becomes difficult to find important information that is unique to Arduino for those features.
You won't find any further documentation of the Arduino programming language anywhere else.
Looking for something else? See the libraries page for interfacing with particular types of hardware. Try the list of community-contributed code. The Arduino language is based on C/C++. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.
Anything on the Forum is extremely difficult to find because the Forum is a huge disorganized mess.
As far as I can tell, everything is compiled using C++. Is there a situation where constexpr is getting an error in the plain C code?
/Applications/Arduino-1.8.7.app/Contents/Java/portable/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-gcc -c -g -Os -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/variants/standard /Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_pulse.c -o /tmp/ArduBuild/core/wiring_pulse.c.oIn file included from /Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_private.h:31:0, from /Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring.c:23:/Applications/Arduino-1.8.7.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:41:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' constexpr int HIGH = 0x1;
Actually, it's at the bottom of the first page.
I personally like stack overflow because users rate the value of answers, supports tags, allows user changes and comments. Maybe you can talking them into moving to a better forum.
Please post a link to where you found that. I can't find it anywhere. I know the old version of the Arduino Language Reference did have some additional text like that, and there is an old version of that which is still online only by accident:
STRUCTUREThe elements of Arduino (C++) code.
Apparently the online reference has been reorganized but the information is still there.
While this is not the best way to document this
I will investigate why we have this "The elements of Arduino (C++) code." sentence that is not how it should be.
they are certainly trying by reorganizing the reference.
There's a link on the page for recommending documentation changes. Maybe that would be a good location to make recommendations.
I would suggest you limit the suggestions to focus on beginners to make this acceptable.
you could argue the C is not a language, but a simplification of assembly.
you can still use assembly in C
the reference of C doesn't contain reference of assembly
You could argue that, but everyone would laugh at you because it's clearly wrong.I really don't consider inline assembly in C to be a valid analogy for the situation with Arduino programming language and C++. C and C++ is much closer. You can consider C to be a subset of C++, just as you can consider C++ to be a subset of Arduino programming language.It will contain documentation of asm(). But as I said already, I reject that analogy. Lets move on to your better analogy of C++ and C, which you conveniently didn't mention in this statement. Any good C++ reference will document the parts of C++ that are shared with C.