I’m wondering if someone has any insight on why, when Arduino is a C+ library (is it a library?), Processing a Java library, and p5 a JavaScript library, the three are so similar in terms of syntax? It strikes me that when you know one it’s pretty straight forward to pick up the other two. How is this possible if they belong to three languages that I’ve heard people describe as being extremely different from each other?
Thanks for the backstory. I didn’t know it was possible to make the syntax of the library of one language resemble the syntax of a completely different one!
Often the similarity isn’t the syntax, except to the extent that the languages are already related (eg in the C family of languages) – instead the similarity is the keywords-function/method names, and their arguments: the API.
So, for example
void draw() {
background(0);
}
def draw():
background(0)
These don’t have the same syntax – : { ; whitespace, keywords are all different, and only the use of () is the same – but they do have the same API (“draw” and “background”)