Recently, I have been reading a little bit of Code Complete each night, hoping that a little progress every night ends up to be a good bit of progress over the long haul. Like Jerry Seinfeld’s “Don’t Break the Chain” idea.
Anyways, one particular section in Code Complete regarding routines caught my attention: the difference between a routine and a procedure.
A function is a routine that returns a value; a procedure is a routine that doesn’t return a value.
I was pretty surprised that this straightforward differentiation was foreign to me until a few nights ago. Never was this distinction made in a CS course I took. Never was this terminology used by other programmers when talking about routines, methods, functions, procedures or whatever. Not even in the metric tons of blog articles I’ve read.
There isn’t any huge takeaway from functions vs. procedures, I am simply quite surprised that I dodged this concept until now.