Jump to content

User:Timhowardriley: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
What is a computer program?: An instance of one kind of program
Line 80: Line 80:
: end
: end


If you have an '''algorithm''' in a [[Syntax of programming languages|syntax]] that can be [[parsing|parsed]] by a [[compiler]], [[Interpreter (computing)|interpreter]], [[virtual machine]], or [[cpu]], then you have a '''computer program'''. Therefore, a '''[[computer program]]''' is '''[[algorithm#Formalization of algorithms|essentially an algorithm]]'''.
If you have an '''algorithm''' in a [[Syntax of programming languages|syntax]] that can be [[parsing|parsed]] by a [[compiler]], [[Interpreter (computing)|interpreter]], [[virtual machine]], or [[cpu]], then you have a '''computer program'''. Therefore, one kind of '''[[computer program]]''' is '''[[algorithm#Formalization of algorithms|essentially an algorithm]]'''.

Revision as of 01:01, 23 September 2007

This user maintains a strict policy advising against all personal attacks.
BScThis user has a Bachelor of Science degree in Computer Science.
This user is a software engineer.
C-4This user is an expert C programmer.
This user has been programming for the Everglades National Park since 1998.
This user used to commute daily to here.
This user is writing a book.
This user has a website, which can be found here.
mysqlThis user writes programs that access MySQL.
This user contributes using Linux.
This user contributes using Vim.
This user misses his 1966 Ford Mustang Convertible.
This user plays the trombone.
This user served in the Army Band at Fort Benning.
This user just LOVES to cycle here.
This user can bench press 4 tons in 7 sets.
This user used to use a rotary dial phone.
This user used to use a manual typewriter.
File:Trs80 2.jpgThis user's first computer was a TRS-80 Model I.
This user believes Be Afraid is an unfortunate reality. "You should also learn that Wikipedia users often display ownership of articles they've edited, and jealously guard the fiefdoms and cliques they've developed..."



What is a computer program?

How does a Mathematician move a pot on a stove?

Given a stove with the top-right burner warming, how does a Mathematician move a pot from the top-left burner to the top-right burner?

1) Lift the pot 3 inches.
2) Move the pot 18 inches to the right.
3) Lower the pot 3 inches.
4) Call these steps algorithm number 1.

Now, how does a Mathematician move a pot from the bottom-left burner to the top-right burner?

1) Lift the pot 3 inches.
2) Move the pot 12 inches forward.
3) Lower the pot 3 inches.
4) Execute algorithm number 1.

As you can see, an algorithm is a sequence of instructions.

How does a Computer Scientist move a pot on a stove?

How does a Computer Scientist move a pot from the bottom-left burner to the top-right burner?

procedure move_right( pot )
begin
pot.lift( 3, inches )
pot.move( right, 18, inches )
pot.lower( 3, inches )
end
main()
begin
stove.burner_heat( top_right, warm )
pot = stove.create_pot( bottom_left )
pot.lift( 3, inches )
pot.move( forward, 12, inches )
pot.lower( 3, inches )
execute move_right( pot )
end

If you have an algorithm in a syntax that can be parsed by a compiler, interpreter, virtual machine, or cpu, then you have a computer program. Therefore, one kind of computer program is essentially an algorithm.