Method and Subprogram [duplicate]

1

Do they both mean the same thing?

void subrotina(){};
Is not this called method too? People do not say they're going to make a subprogram that does something, people usually say, "I'll do a method that does something."

    
asked by anonymous 01.11.2014 / 02:04

2 answers

1

In object-oriented programming these applets are called methods and may or may not return values. In structured programming these subroutines are called functions when they return something and procedures when they do not return anything, as is the case of this subroutine void

By convention is written the name of the methods with small print and if two words is used the uppercase letter in the first letter of the second word.

Ex: getWidth ()

This writing practice is referred to as lowerCamelCase

    
01.11.2014 / 05:44
0

All the same. From wikipedia :

  In different programming languages the subroutine may be called a procedure, a function, a routine, a method, or a subprogram. The generic term callable unit is sometimes used.

Translating: "In different programming languages a subroutine can be called a procedure, function, routine, method or subprogram.     

01.11.2014 / 02:07