0

Is it wrong to add space between a function and a parentheses?

Today I programmed a code in a Arduino Simulator named “Tinkercad” during class. The language is based of 'C' (or C++ maybe) and the teacher not approved my code (I can resend it again without that spaces) because I put space between functions and parentheses, arguing that the language C don't know how to interpreter those spaces and maybe could have a strange behavior (his source was the book “The C Programming Language” written by Brian Kernighan and Dennis Ritchier [creator of C]) but by the way, all the code run perfectly and nothing gone bad. I only want to know, It's really necessary? He have good reasons to make me to not put a space every time I do that? (Common used in languages and mathematicals operations for read the code better and make it less compressed, serves well for me in large code). I checked what happens in a real case (without simulators if that was the doubt) using the text function with space and... Works fine. Teacher: printf("Goodbye World"); Me: printf ("Goodbye World");

13th Nov 2021, 1:00 AM
RayanZZ
RayanZZ - avatar
2 Respuestas
+ 2
the brain used to a certain style of writing a code, reads such a code faster I prefer print( "Goodbye");
13th Nov 2021, 1:28 AM
zemiak
+ 1
Some code editors even does that when instructed to tidy up a messy code.
13th Nov 2021, 3:42 AM
Ipang