Answer the question
In order to leave comments, you need to log in
Is the concept of "procedure" relevant in modern languages?
I'm sitting writing a program, there was a code like this:
def getInfo(num):
#около 100 строк кода
return result
void smth() {
}
def f(a):
if a == 1:
return 0
elif a == 2:
return True
elif a == 3:
return 'smth'
elif a == 4:
return 20.1
else:
return None
fun
(ction):fun smth() {
}
So the procedure is declared with the word fun. Answer the question
In order to leave comments, you need to log in
And what does dynamic typing have to do with whether a value is returned or not? The main thing is that it returns)
But the concept of "procedure" is already an anachronism. Right now it's more fashionable to divide into "methods" and "functions")))
The legs of the question grow out of Pascal, which had two whole separate keywords - procedure and function . Actually, they are applicable mainly to Pascal, C, C ++ - languages with strong typing.
So the procedure is declared with the word fun.
As a result: is it worth using the word "procedure" at all?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question