-1

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?

  • java method is similar to a function. Don't really understand your question. – Jakkra May 01 '14 at 20:16
  • Basically, yes. Languages tend to have (usually small) differences in what they consider a function. – yshavit May 01 '14 at 20:18
  • 2
    The terms "function", "procedure" or "method" are sometimes used interchangably, **BUT** strictly speaking, they have particular meanings (which may, to some extent, differ between programming languages). Maybe also have a look at http://stackoverflow.com/questions/155609/what-is-the-difference-between-a-method-and-a-function?rq=1 – Marco13 May 01 '14 at 20:18

1 Answers1

1

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.

spencer7593
  • 106,611
  • 15
  • 112
  • 140