Functions - different meanings in different languages?

359 Views Asked by At

I am a very novice programmer, taking a course on the fundamentals of Java. In Alice 3, a function is defined as: A Function computes and answers a question about an object, such as, “What is its width or height?" I have used Blockly before and in Blockly, a function appears to be something else - more like a procedure. Can anyone help please?

1

There are 1 best solutions below

0
spencer7593 On

Each programming language has it's own vocabulary. Your general definition of "function" is adequate, though a function doesn't necessarily need to return anything meaningful; sometimes, we're more interested in the side effects of a function (for example, we're more concerned with what printf does than what it returns.)

Java uses the term "method" as the name for what some other programming languages call a function, or subroutine, or procedure. And there are a great many other differences than that. If all programming languages were the same, we'd have just one programming language.