Skip to content

The Arduino programming language is not fully documented #623

Open
@per1234

Description

@per1234

The Arduino Language Reference is the only official documentation of the Arduino programming language, but it is far from complete.

Some examples of important things that are not mentioned in the the Arduino Language Reference:

  • C string functions
  • Default arguments
  • Overloaded functions
  • enum
  • Templates
  • Classes

How can users be expected to learn these parts of the Arduino programming language from the current documentation?

In my own learning journey with Arduino I started writing sketches using the Arduino Language Reference as a guide and quickly reached a point where I said to myself "Is that all there is to the Arduino programming language? I need more." I was about to give up on Arduino and move on to a more capable microcontroller platform when I stumbled across a post on the Arduino Forum that made me realize that there was so much more to the Arduino programming language, but I would need to use a C++ programming reference to discover it.

Once I realized this, I knew Arduino was the right choice. So it worked out OK for me, but this is far from an ideal learning path. How many other users in my situation would never chance upon that forum post? I know I'm not the only one who has had this sort of experience because it comes up regularly on the forum.


I can see two possible solutions:

Document the differences between the Arduino programming language and C++

Create a new page on arduino.cc that explains what the Arduino programming language is:

  • A brief history (Processing, Wiring).
  • A description of the sketch preprocessing processes that make the Arduino programming language different from C++:
    • Concatenate .ino files, starting with the file that matches the folder, followed by the rest in alphabetical order. Save the resulting file with a .cpp file extension.
    • Add #include <Arduino.h> if not already present.
    • Add function prototypes for any functions that don't already have one.
  • A link to an external C++ language reference (e.g., http://www.cplusplus.com, https://en.cppreference.com)
  • Add a link to the new page from the description at the top of the Arduino Language Reference home page.

This means the Arduino Language Reference only needs to document the Arduino core API and some basics to get beginners started, which it already does a good job of.

Advantages:

  • Easy to implement and maintain. Others are responsible for the huge task of completely documenting the language.
  • Makes it easy for the user to understand how to apply their Arduino programming language knowledge to writing C++ as well (e.g., writing Arduino libraries).

Disadvantages:

  • The external C++ reference will contain information that is not applicable to Arduino. The reader will need to have some intuitive filter for which parts of that documentation are useful and which can be ignored.

Fully document the Arduino programming Language in the Arduino Language Reference

Advantages:

  • We can custom tailor the documentation for Arduino.
  • We may be able to write the documentation so that it is easier to understand for the target audience than the external C++ documentation.

Disadvantages:

  • A huge amount of work to implement and maintain.
  • Has the potential to make the Arduino Language Reference less friendly to beginners. I think we would need to have some way of separating the advanced topics that beginners should not be immediately exposed to from the rest.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions