Introduction to Software Development
GWU Computer Science
We take many computational tasks for granted. For example, all of us have probably sorted a set of items on a computer before; perhaps you sorted your AirBnB results by price, perhaps you sorted a list of restaurants on Yelp by proximity to your current location, or Amazon sorted your search results for a book by how close the title was to your query. Somewhere, someone has written code that translates the human problem of "I wanted to sort this unsorted list."
As humans, we often abstract away the low-level details that we don't need to solve or understand the problem. For example, we can all probably agree that we conceptually know what it means to sort a list of names alphabetically. But, could you explain how to do that to, let's say, an alien, who's not familiar with the concept of sorting and a sorted list?
In this class, we will use abstraction to analyze a problem and design a solution for it.
Analysis: We will break the problem into parts and identify the high-level steps to follow in order to complete each task. After we understand the problem, we must design a solution.
Design: We will follow a careful approach to solving problems:
Steps 1-3 we call "Planning".
Steps 4-7 we call the ECT process (Edit, Compile, Test):
Algorithm: The High-Level steps to solve a problem. This corresponds to the Planning part above.
Program: The algorithm implemented as a set of steps written with correct syntax, and using a set of existing programming features. This corresponds to the ECT part above.
We will look into this next class. Just so you have these terms in mind for next class:
Syntax: The set of rules that define well formed sentences in a given language.
In other words: Is the spelling correct, given the language (Java)?
Example: the sentence "He!lp the d,og ate the pizza" has incorrect syntax (even if, as a human,
you might be able to pick up on the meaning.
Semantics: This looks at the meaning of the sentences rather than at how
they are written. In other words, Does the code actually do what we want it to do?.
Example: the sentence "Help, the pizza ate the dog!" has correct syntax but it does not reflect
what the person attempted to say:
How does a computer execute code? What are the main components of a computer? Let's discuss!
A Low-Level language is composed of the set of instructions that can be directly executed by the computer's central processing unit (CPU). It is "machine-speak" and it is very distant from English. To the human, it looks like 0s and 1s. This is because on a computer, 0s and 1s can be represented through electrical currents (either on or off), and gates can be used to control how the current flows. No human wants to write in this language.
Solution: represent this low-level language in something easier for humans to deal with. Why? Because someone needs to eventually be able to easily understand the code to debug it. Then, have software translate the human-readable language into a low-level language that the machine can process.
These programming languages that are closer to English and that allow you to use abstract terms and instructions are called High-Level Languages. Some of these are (C, C++, Java, Python, etc).
The conversion of a program (written in a High-Level language) into an executable (written in machine code) is called Compilation. Note: we'll assume this model for this course, but there are actually some details we're leaving out right now for the sake of clarity for those of us new to programming.