[Tutor] question about subroutine

ThreeBlindQuarks threesomequarks at proton.me
Sat Sep 30 22:36:18 EDT 2023


Yes, Leam, PERL is quite an old language I used in the late 80's and beyond.

But the SUB commandments is pretty much how a programmer creates functions to add to the built in functions. There are subtleties but I accept the name subroutine is used by many.

I see it as a hybrid in a way. It lets you store commands somewhere else then pass control to there and return back with no value. In a sense it is a bit like what Pascal called a procedure but not really. Many other languages allow any function to return one or more kinds of things including nothing.

In a sense, I find a primitive quality to the PERL add-on as the subroutine uses special notation to access arguments but sometimes allow you to change them.

My comment in a forum about Python was that the usual terminology for functions might include the name method but I had not seen subroutine.

Sent from Proton Mail mobile

-------- Original Message --------
On Sep 30, 2023, 9:58 PM, Leam Hall wrote:

> "sub" is the Perl equivalent of "def". On 9/30/23 13:46, ThreeBlindQuarks via Tutor wrote: > Without being able to see the code described, all I can share is my reaction to the phrase "subroutine". > Or do people now routinely still use phrases like subroutine? -- Software Engineer (reuel.net/resume) Scribe: The Domici War (domiciwar.net) General Ne'er-do-well (github.com/LeamHall) _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list