Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: 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 reply to Re^3: How do I go from procedural to object oriented programming? by salva
in thread How do I go from procedural to object oriented programming? by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-04-18 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found