Krista's Coding Corner


What is a program code and how it works? (part 1)

Program codes are just punch of text files. The bigger the program the more and larger text files. Even every prog ramming language has different file type. But you can always open these files as text (or change the file type to text), for example with Notepad.

Many times programs are compared to recipes: you have recipe that tells you step by step what to do and you can also give the recipe (or pro gram) to someone else.

Programs work just like recipes: they are instructions for a computer to do something. A computer will do step by step what the program tells it to do and it doesn’t care one bit what is the meaning of the commands. Computer won’t conclude, evaluate or adapt anything (okay, I’m lying in this one, it does some of these things but don’t even think that it will understand you and correct your mistakes!).

Your recipe aka program has to be accurate and detailed. Just think how confusing it is with some recipes that say ‘fry until nicely brown’. Honestly, “nicely brown”? Is that all the help you can give me? [Example is only for people who are NOT experts in kitchen :P]. Or getting driving instruction over phone: ‘then there is that rock and turn towards the nice house and drive a little while and turn right’. If you have trouble understanding exactly what to do, then there probably is no way a computer can do it.

Computers are stupid but quick, accurate, memorize things well and do exactly what you tell them to do. Even sometimes it feels like they don’t… :)

You know the saying that person should be careful on what they hope / wish because he might actually get it. In Finland, there is an add, where Aladdin-like boy finds magic lamp and asks for the hand of a princess (meaning wanting to marry a princess). He ends up having woman’s right hand with jewelry. (After that the boy says that there is no sense in whole thing and narrator adds that in some telephone connection there is sense…).

Teaching: be aware what you ask and be even more careful what you ask your computer to do. It might just do it ;)

blog comments powered by Disqus