Back Python Chrestomathics Ahead |
Part 1 — Learning the lexicon
Mary Poppins says — Start at the beginning — So that’s what we’ll do so
The entire page — Has words of enlightenment — Please read carefully
I say love is love — For we’re all God’s children — Living as we are made
Section 1.1: Words to bind us
- To talk about programming, we need a common vocabulary. I suspect you already know some of these words, but you will need to know all of them.
- To make sure programming instructions are effective, there can be no ambiguity in what they are supposed to do. To eliminate ambiguity, all programming instructions have structure. The form the structure takes, varies by programming language.
- A program is an algorithm written in a programming language. So, what is an algorithm? An algorithm is a recipe — a list of instructions. Each instruction is unambiguous and doable. The instructions are also deterministic, which means whenever given the same inputs, the instruction produces the same results.
- While Kate Lebo was talking about cooking, her comment on recipes, I think is right on about programs.
Recipes are rituals that promise transformation.
- The words program and application are synonyms.
- The instructions in programming languages are called statements. When a statement is performed, we call it executing or running.
- Programming languages have syntax rules for specifying what is legal code. For a program to complete its task, its code must be syntactically correct.
- Besides syntax rules, a programming language also specifies semantics — the actions taken when the program elements execute.
- Just because a program is syntactically correct, it may not be the right instructions for your problem. There is a frustrating maxim that all programmers must come to accept.
Your code does what it is told to do, which can be different from what you want it to do.
- Coding communities have come up with style guides. The recommendations are optional, but experts agree their use supports program readability. Two popular Python style manuals are ones by Python.org and Google.
- Because programs are written in normal text, it takes applications to translate them and have their code executed.
- A compiler is an application that translates the code written in one language into another language. The target language is frequently the native machine language of the intended digital device.
- An interpreter is a translator that executes code as it is compiled. The Python translation application is an interpreter. Being interpretive helps make Python suitable for web applications and be browser friendly.
- To make developing code easier, applications exist to support program development. These applications are called IDEs (Interactive Development Environments). An IDE is like a word processing system for developing programs. It will have a built-in editor for writing code that highlights programming elements and will support program testing.
- The previous section gave links to popular Python IDEs.
Section 1.2: What’s next
- With a common vocabulary, we are ready to start digital problem solving — Chrestomathics here we come.
Why so hard to see — We all deserve happiness — It’s a human right
Back Ahead |