"Specifically, the term command is used in imperative computer languages. These languages are called this, because statements in these languages are usually written in a manner similar to the imperative mood used in many natural languages. If one views a statement in an imperative language as being like a sentence in a natural language, then a command is generally like a verb in such a language."
Re:Computer Science Circles
by dragonwriter on Thursday December 03, 2015 @11:26AM
(#10670459)
> I really dislike the idea that programming languages have "commands"
I can see a perspective in which it makes sense to call imperative subroutines (in Python terms, functions that have side effects and follow the Python idiom for principally-effectful functions of returning None regardless of their inputs) "commands". But I probably wouldn't do it in a Python-focussed tutorial intended for new programmers, because it conflicts with what the language itself calls them and creates unnecessary friction.
Re:Computer Science Circles
by nickysielicki on Thursday December 03, 2015 @05:22PM
(#10673161)
I think it's fair to say you're commanding the interpreter to run some function. Particularly when it comes to builtins.
print is the name of a Python command, which sends messages to output. The parentheses () after the print command are used to contain what you want to print.
I really dislike the idea that programming languages have "commands", so I would have called it a function since that's the actual term used. And that of course would lead to explaining the parentheses as part of calling a function, by enclosing the parameters.
I admit I didn't read far in this tutorial, so perhaps more correct/typical terminology is introduced later.