Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: How do I go from procedural to object oriented programming?by salva (Canon) |
on Apr 21, 2015 at 07:49 UTC ( [id://1124111]=note: print w/replies, xml ) | Need Help?? |
You can keep calling your subroutines functions even if they are procedures. Everybody calls them functions inside the context of imperative programming.
Functional programming was a obscure thing until a few* years ago. If I recall correctly, the popular meaning for functional programming back them was "programming using functions as first class objects". For instance, Lisp was considered a functional programming language because it was able to build, pass and call functions and closures at runtime, in opposition to other lower level languages as C which didn't support closures and couldn't build functions dynamically. Then, the *real* functional programming wave toke over, there was an explosion of new functional languages and functional programming became synonymous to using functions without side effects as in the mathematical sense. Nowadays, the name "function" is still used to designate procedures. Any programmer using an imperative language as C/C++, Python, Perl or even old-school functional languages as Lisp will use the term "function" to designate both functions and procedures. Very few would take the time to consider the difference and state it explicitly. AFAIK, the only imperative language making a difference between functions and procedures is Eiffel and then it uses a completely different nomenclature. In summary, you can call your subs functions even if you don't do functional programming. And say that you do procedural programming, or more commonly, imperative programming (that subsumes both the procedural and object oriented paradigms). *) I would say until around the turn of the millennium... but it is quite subjective.
In Section
Seekers of Perl Wisdom
|
|