Ayo, Flocabulary in the building. Yeah, computer programming is a process. You with me? Let's go!
When the alarm starts buzzing and you don't want to move,
So you reach over and hit the snooze.
The snooze is a feature, you may have guessed,
And it was programmed using these five steps.
Step 1 is define a problem, in this case
People want to sleep more without being late
For their first date or lunch with the president.
In this step you have to know every requirement,
Which is what the program must do.
We're still in Step 1, yeah, we're not quite through,
We have to determine the
specifications,
Which is how it will do everything we're sayin'.
For snoozing, a program has to let people sleep
More, but wake them when it's time to get moving.
So it has to silence the first sound,
Then set another for 10 minutes from now.
After 10 minutes, it has to ring again,
You don't want to be late so the dream has to end.
Step 2: design the solution, indeed,
A
design includes all the steps in the order you need.
That's known as a program's
logic, next,
A design can be written with pseudocode, check.
That's a language more precise than English, yet
Less precise than what a computer can get.
The design can also be a
flowchart,
Which represents the steps visually, kind of like art.
Programmers determined how the program would instruct
The snooze feature to work and wake you up.
Computer programming is a process,
Follow these five steps and see progress.
Define the problem, design the solution,
Code, test, document what you're doin'. x2
After the problem and designing the solution
Is Step 3: coding, where it really gets cool.
It means translating the design you created,
Into a programming language.
A language that can give the computer instructions
To do what we want it to do and correctly function.
Like the languages that people speak,
Every programming language is unique,
And has its own rules or syntax.
Any mistakes in the code, better fix that.
A mistake is a bug, so we call it debugging,
When they're all gone you'll probably see the whole team hugging.
So the program's finished? Not yet, there's more,
It needs to be tested, that's step number four.
Just because it runs and seems to be working, see,
Doesn't mean it solves the original problem perfectly.
Tests can reveal new
bugs or a hiccup,
Like the alarm isn't loud enough to wake him up,
Or it doesn't adjust for daylight savings time,
And that could really put you in a bind.
Next up, is document, the last of the 5 steps,
When you describe the programming process.
It can be a summary or comments in the code
To communicate with other
programmers around the globe.
Computer programming is a process,
Follow these five steps and see progress.
Define the problem, design the solution,
Code, test, document what you're doin'. x2