Post

Good one! I worked with Pascal, a very well-designed language. Pascal subroutines are defined with the `procedure` or `function` keywords. Both take typed parameters. Procedures cannot return a result, and functions must declare a return type and return a result. That distinction is very useful.

I remember working with Pascal a little bit — at a basic level, for a class I had. I found the distinction between procedures and functions quite curious!

0 reposts3 likes

It is a useful distinction. You are encouraged to use procedures for the side-effects, since they don't return values. Functions may also have side-effects, but the distinction also encourages the design pure functions, leaving the side-effects for procedures.