|
Also prohibited: == (children learn =), &&, ||, |, ^, %, ++, --, != (children learn ≠), ~, <<, >>. & is maybe allowed. Sixth graders don't know about bitwise operations, but they know & means "and". That's stretching things a bit, though. Is [] allowed for indexing? When I learned about arrays in sixth grade... No, wait, I didn't learn about arrays in sixth grade. For that matter, I didn't learn about functions using (): those are only for grouping expressions. Functions are just like, "sin 90". Also, since I didn't learn about code at sixth grade, I obviously didn't learn about using {} to delimit code blocks; , was only used in prose, not in mathematics. Having said that, it's unclear why programming languages should be limited to operators that we can guarantee "sixth grade" students (whatever that happens to mean in your part of the world) will have heard of. What actual benefit could it bring, other than (maybe) making it easier for somebody who hasn't learned a language to guess the meaning of a piece of code in that language? Is that benefit worth making code twice as long and rendering half the keyboard useless? main() {
printf("hello, world\n");
}
Should, I assume be: the main procedure is:
the message is "hello, world" plus a new line;
display the message;
stop.
Anything else will be too confusing for the many sixth graders currently working professionally as programmers. |
Also, I despise the logic of "because it exists on a keyboard, it should be used". C is a terrible offender in this regard, with * and & used for no good reason.
10-years-old, or 6th grade, or whatever is an arbitrary number, but don't get caught up in the distinction. "90% of high school graduates" would institute a similar threshold, and probably be less controversial.