Skip to content

Commit 915e66f

Browse files
committed
Add part on algorithms
1 parent 369d0d9 commit 915e66f

29 files changed

+76
-26
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@
44
"MD026": {
55
"punctuation": ".,;:。,;:"
66
}
7+
},
8+
"editor.wordWrap": "bounded",
9+
"editor.wordWrapColumn": 132,
10+
"[markdown]": {
11+
"editor.wordWrapColumn": 132,
12+
"editor.wordWrap": "bounded",
13+
"editor.quickSuggestions": false
714
}
815
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# What is an algorithm?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Computer thinking using top-down approach
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Kitchen and Dining Room
2+
3+
Imagine you run a classical restaurant. Regardless of the type of food you are serving (whether it is classical Polish *schabowy* or Italian pasta), it should consist of at least two rooms: a dining room, where your customers place orders and later eat your delicious dish. Another room is the kitchen, where the cooks run here and there preparing these meals. Unless your restaurant is a modern hipster place, where the food is prepared in front of the customers (it is not, as you cannot afford for elegant dress for your cooks), the *kitchen* should be separated from the *dining room*! This way, your customers can enjoy their meals without constant noise of buzzing pots.
4+
5+
What is not less important, such separation allows to use the same kitchen to prepare take-away meals.
6+
7+
**The same should be the case with your future programs!**
8+
9+
In the previous section, you have learned about algorithms that have some *input* (your customers' order) nad some *output* (the dish you serve once prepared). Parts of your (or any) program that are responsible for getting this input and providing the output are called **user interface** of a **front-end**. This is the dining room.
10+
11+
On the other hand, the parts of the program that process provided data internally and create the result to be served by the front-end as an output are called **back-end** or **logic**. This is what you find in a kitchen.
12+
13+
Depending on the type of the program, the front-end or back-end part may be dominant. For data analysis and numerical simulation code, you should probably focus more on the back-end. On the other hand, when writing a computer game, the front-end may be more important and more sophisticated.
14+
15+
Very often you will start writing your program with very simple text-based user interface and later, after you make sure the logic part works well, you create some graphical interface that will be easier to use for the end user. In such case, it is crucial that you separate front-end from the back-end from the very beginning.
16+
17+
| Dining room | Kitchen |
18+
| -------------------------------------------------------------- | ----------------------- |
19+
| ![Dining room](dining-room.jpg) | ![Kitchen](kitchen.jpg) |
20+
| image source: [U.S. National Archives](https://nara.getarchive.net/) |
21+
22+
23+
<hr/>
24+
25+
Published under [Creative Commons Attribution-NonCommercial-ShareAlike](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.

00 Algorithms/dining-room.jpg

176 KB
Loading

00 Algorithms/kitchen.jpg

180 KB
Loading
File renamed without changes.
File renamed without changes.

01 Introduction and Installation/3 Programming Environment.md renamed to 01 Python Environment/3 Programming Environment.md

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)