3 ms·
Mostly really good, but I have a problem with this one: > 67. Think of all the psychic energy expended in seeking a fundamental distinction between “algorithm”
by klik99 3y ago
Mostly really good, but I have a problem with this one:
> 67. Think of all the psychic energy expended in seeking a fundamental distinction between “algorithm” and “program”.
I mean... it's semantics but I feel like taking the bait here. I have a weird concept of fun.
I've always understood it as a program takes external input and/or gives external output (like keyboard presses, display to screen, write to disk, etc) whereas an algorithm is self contained and can run on any turing machine regardless of capabilities.
Basically "Side Effects", but I avoided using that phrase because input isn't clearly a side effect, but if your semantics don't require no side effects for an algorithm, then yeah a program is functionally equivalent to an algorithm.
Mostly semantics don't capital-M Matter, but can be important to clarify meanings. Depending on what project/team I'm working on I can have completely incompatible definitions of the same word in the same day.
- 082349872349872 3y agoInstead of attempting to offer a distinction between algorithm and program, how about the following relations? spec -< algorithm -< program -< executable where each (a -< b) says both that b implements a and that there are almost always multiple valid potential bs for any given a.
- Izkata 3y agoI always thought it was obvious: a program is/contains a concrete implementation of an algorithm. A recipe book contains an algorithm for baking cookies, but how you do it vs how someone else does it is going to have slight differences (accuracy of measurements, size of cookie, etc).