NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

How does a program become a program? And what does a computer actually do when it "runs" a program? Let's take a peek under the hood and examine the process of how an idea gets turned into a dynamic, interactive program running on your computer.

The Idea

It all starts with an idea. Well, actually, it starts with a problem that necessitates a solution that then gives rise to the idea for how to solve the problem.

Smart problem solvers begin the process of turning an idea into something real by first analyzing the problem at hand. They ask questions, collect information, gather data, look at existing solutions, and think through the situation as thoroughly as they can before diving into a solution.

It might seem difficult to restrain yourself when you are struck with a brilliant idea. But the best ideas are almost never the first ones that come up. Remember the sorting algorithm exercise. Most students could intuitively come up with the concept of Bubble Sort all on their own, but that proved to be one of the least efficient solutions to that problem.

In practice, the first idea to come to mind is almost always an inferior solution. But with careful thought, consideration, and analysis of the idea's strengths and weaknesses, a good designer will always come up with something better than their first instinct. So, avoid those kneejerk reactions to initial ideas and look for the better idea. It's out there. You just need to make the effort to seek it out.

Construct an Algorithm

Once a developer has identified a solution that is worth pursuing, the next step is to begin turning it into a well-specified plan of action.

As we've seen earlier in this unit, computer scientists — whether they are programmers writing code or designers developing algorithms — apply their computational thinking skills to the process of mapping out a logical sequence of instructions that will solve the problem. They recognize and use the sequencing, selection, and iteration patterns we've looked at in the past. They anticipate and identify all of the unseen and unexpected complications that their solution will need to encounter. And they clearly define the requirements, expectations, and specifications for how the resulting program should perform.

Write the Code

Once the program specifications have been clearly defined and all algorithms have been constructed, a programmer then implements the algorithm in a formal programming language (i.e., writes the code an an appropriate high-level or low-level programming language).

These days, most software is developed in a high-level language that takes advantage of the benefits of abstraction in making the final code simpler and more straightforward for humans to understand, while still remaining formal and strict enough for a machine to read and parse. A wealth of development tools are available to help programmers more easily manage large programs that combine large numbers of smaller algorithms and operations. Both Scratch and Processing, which you will work with in the next few units, provide an easy-to-use, graphical interface with which to develop, test, and run your programs.

Smart programmers also design thorough test cases to verify that all aspects of their program perform as intended. Sometimes the design of the algorithm is flawed, leading to a program that misperforms. Other times, the algorithm is sound, but the program fails to accurately implement it in the chosen programming language. Either way, it is important that these bugs (i.e., errors) in the program are identified and corrected before the software is distributed to end-users.

Compile the Code

The programs that programmers write in high-level languages are known as source code. Technically, these source code files are not really programs, per se. They are the abstract, high-level instructions that define what the program is and how it will function. The actual program — that is, the file containing the machine-level instructions the computer actually runs — is written in special binary (1s and 0s) patterns that relate directly to the way the computer's processor has been designed and wired. This binary, machine code is a direct, low-level translation from the high-level source code.

Fortunately, the programmer does not have to personally perform this tedious translation. Instead, it can be automated in a process called compilation. This basically means that your program can be translated by another program! During the compilation process, another program, called the compiler, translates each of your high-level, human-readable instructions into a corresponding string of 1s and 0s that make sense to the computer's processor. The resulting string of binary information constitutes an executable program.

Execute the Compiled Code

When a user wants to run, or execute, a program, all of the instructions and raw data that make up that program are loaded into memory (i.e., RAM). That is, the binary, machine-code is copied from wherever it is stored in secondary storage (e.g., hard drive, USB drive, etc.) into primary storage (e.g., RAM).

RAM is essentially just a really big, organized collection of tiny electrical ciruits for storing information. Each of those circuits can be individually turned on or off, which corresponds to the binary states of 1 and 0, respectively. Each circuit in RAM is, thus, capable of storing 1 bit (from the abbreviation of "BInary digIT") of information. For perspective, 1 gigabyte (1 GB) of RAM consists of more than 8.5 trillion bits.

Once a program's binary contents have been copied into RAM, the computer's central processing unit (CPU) begins reading each of the binary instructions bit-by-bit, byte-by-byte, word-by-word as it executes each instruction in the sequence that the code/algorithm specifies.

As it does so, each instruction or operation causes various electronic components to be activated throughout the computer. Some of these operations change the values stored in RAM. Others read and calculate new values based on information stored in RAM. Still others draw images, symbols, or text onto the screen; capture user input from a mouse, keyboard, or touchscreen; send data to a printer; play music and sound effects; or any number of other types of basic computational functionality.

The sum total of all of these discrete operations is what the end user recognizes as a properly functioning program, whether it is a web browser, a word processor, a game, a streaming media player, or whatever else it was that the original idea that started this process was intended to do.

Interactive Activity

Complete this fun interactive activity below to garner a better understanding of the concepts of this lesson.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.