views:

93

answers:

3

If you were told to write a routine, would you take that as to write a function or pseudo code or what?

A: 

In programming, "routine" and "function" are generally synonymous. As Ben notes, in some languages there is a difference in syntax between a routine which returns a value and one which doesn't. But in concept they are basically the same thing.

jeremcc
+3  A: 

Not to nitpick, but sometimes there is a semantic difference between "function" and "routine". For example, in VB functions return values and (sub)routines do not.

In the context of the question, the term "routine" seems to mean nothing more than a block of code (in any form, including pseudocode).

Ben Hoffstein
It's true that in VB there is a different syntax for subs and functions, but in my opinion they are really just two variations of the same thing.
jeremcc
Well in Pascal you're talking procedures, not routines. That's entirely different. ;-)
jeremcc
In Pascal and Delphi, "routine" is very convenient when you want to talk about procedures, functions, and methods. "Thing that has code in it" is crude and too vague.
Rob Kennedy
+1  A: 

It sounds like the problem you're having isn't necessarily "what is the definition of a routine/function". Maybe I'm misinterpreting things, but the true problem seems to be that you can't tell from the context of a conversation whether you were asked to write working code (i.e. "function") or some algorithmic mock-up (i.e. "pseudocode"). If that's the case, your best course of action is probably to ask for more clarity about what is being asked of you.

gnovice