Email us for help
Loading...
Premium support
Log Out
Our Terms of Use and Privacy Policy have changed. We think you'll like them better this way.
Online Google answer to search of - “What is the difference between an algorithm and source code (program)?”
An algorithm[1] describes the general steps to solve a problem. To be valid, the algorithm must be correct in the results it provides and it must also terminate. Meaning that an analyst has to prove these two characteristics to establish the validity of the algorithm. To be valid, a program simply has to compile (or be interpreted) and herein lies the key difference. A program is a sequence of steps written to run on a machine. This highlights two things. First of all the criteria for something to be a program is met by it's simple quality of being runnable on a machine. It does not have to solve an interesting problem[3], although it's hard to imagine why someone would write a program of this type. Secondly, it does not, in principle, have to terminate. This is important because there are entire classes of programs written in this way, a command shell for example or an operating system which is meant to run forever unless external stimulus stop it.
*****Programming is implementing the already solved problem (algorithm) in a specific computer language where syntax and other relevant parameters are different, based on different programming languages.
[1] Algorithms are “value neutral” (in the world).
[3] Programs are even more value neutral that “Algorithms”