Chapterبەش 1 · Lectureوانە 1.1
What Is Programming?بەرنامەسازی چییە؟
A program is a list of exact instructions for a computer, and programming is the work of planning, writing and testing them. Input, processing and output; why people write source code while the CPU runs machine code; and a short history from Ada Lovelace to the first compilers and the first “bug”.
لیستێکە لە ورد بۆ و کاری پلاندانان، نووسین و تاقیکردنەوەیانە. ، و ؛ بۆچی مرۆڤ دەنووسێت کەچی جێبەجێ دەکات؛ هەروەها مێژوویەکی کورت لە Ada Lovelaceـەوە تا یەکەمین و یەکەم «».
What you will learnچی فێر دەبیت
- Explain what a program, programming and a programmer are.
- Describe any program by its input, processing and output.
- Tell source code from machine code, and say why a translator is needed.
- List the steps of a programmer's work and explain bug and debugging.
- Name the first milestones of programming, from 1843 to the first compilers.
- ڕوونی بکەیتەوە ، و چین.
- هەر بە ، و وەسف بکەیت.
- جیاوازیی و بزانیت و بڵێیت بۆچی وەرگێڕێک پێویستە.
- هەنگاوەکانی کاری بژمێریت و و ڕوون بکەیتەوە.
- یەکەم وێستگەکانی بناسیت، لە 1843ـەوە تا یەکەمین .
Computers follow programsکۆمپیوتەر شوێن بەرنامە دەکەوێت
A computer is very fast, but on its own it does nothing. Everything it does — showing a photo, adding up a bill, playing a song — it does because a program tells it how. A program is a list of exact instructions that the computer carries out one after another.
زۆر خێرایە، بەڵام بە تەنها هیچ ناکات. هەر کارێک دەیکات (پیشاندانی وێنەیەک، کۆکردنەوەی پسوولەیەک، لێدانی گۆرانییەک) لەبەر ئەوەیە کە پێی دەڵێت چۆن بیکات. لیستێکە لە ورد کە یەک لە دوای یەک جێبەجێیان دەکات.
A set of instructions that a computer follows to do a job. A program can be one small or many files working together.
کۆمەڵێک ڕێنماییە کە کۆمپیوتەر پەیڕەویان دەکات بۆ ئەنجامدانی کارێک. بەرنامە دەکرێت تەنها بێت، یان چەندین فایل بێت کە پێکەوە کار دەکەن.
Programming is the work of planning, writing and testing programs. A person who does this work is a programmer, also called a software developer. Programmers write their instructions in a programming language: a language with strict rules that both people and computers can work with.
کاری پلاندانان، نووسین و تاقیکردنەوەی . ئەو کەسەی ئەم کارە دەکات . خۆیان بە دەنووسن: زمانێک کە یاسای توندی هەیە و هەم مرۆڤ و هەم دەتوانن کاری پێ بکەن.
Imagine a new helper at a bakery who has never baked before and does exactly what the note on the wall says, nothing more. If the note says “put the dough in the oven” but never says “take the bread out”, the bread burns. A computer is that helper: it never guesses what you meant.
وێنا بکە یارمەتیدەرێکی نوێ لە نانەواخانەیەک کە هەرگیز نانی نەکردووە و ڕێک ئەوە دەکات کە لە پەڕەی سەر دیوارەکە نووسراوە، نە زیاتر. ئەگەر پەڕەکە بڵێت «هەویرەکە بخە ناو تەنوورەکەوە» بەڵام هەرگیز نەڵێت «نانەکە دەربهێنە»، نانەکە دەسووتێت. ئەو یارمەتیدەرەیە: هەرگیز مەزەندە ناکات مەبەستت چی بووە.
Where the analogy stops workingسنووری ئەم نموونەیە
A human helper soon learns to think for himself. A computer only follows programs, but it does billions of steps a second and never gets tired. Even a “smart” app follows a program that people wrote.
یارمەتیدەری مرۆڤ زوو فێر دەبێت خۆی بیر بکاتەوە. تەنها جێبەجێ دەکات، بەڵام لە چرکەیەکدا ملیاران هەنگاو دەنێت و هەرگیز ماندوو نابێت. تەنانەت «زیرەک»یش جێبەجێ دەکات کە خەڵک نووسیویانە.
A Kurdish (Sorani) explanation of what programming is and what programmers do, from the start of a Java course.
بە کوردی، لە یەکەم وانەکانی کۆرسێکی Java، ڕوونی دەکاتەوە چییە و چی دەکەن.
Kurdish video, 0:00-5:40: what programming is; it stops before the part about Java.
ڤیدیۆیەکی کوردی، لە 0:00 تا 5:40: چییە؛ پێش بەشی ڕادەوەستێت.
Computers follow programsکۆمپیوتەر شوێن بەرنامە دەکەوێت
Instructions must be exactڕێکارنامەکان دەبێت ورد بن
People fill gaps without noticing. Ask a friend to “work out the taxi fare” and they know what to do. A computer needs every detail written down, in the right order, with nothing unclear. Here is the same job as exact instructions for a taxi app that charges 500 dinars per kilometre plus a starting fee of 2000 dinars:
مرۆڤ بەبێ ئەوەی هەست بکات کەلێنەکان پڕ دەکاتەوە. ئەگەر بە هاوڕێیەکت بڵێیت «کرێی تەکسییەکە حیساب بکە»، دەزانێت چی بکات. پێویستی بەوەیە هەموو وردەکارییەک بنووسرێت، بە ڕیزبەندیی دروست و بێ هیچ شتێکی ناڕوون. ئەمە هەمان کارە وەک ورد بۆ تەکسی کە بۆ هەر کیلۆمەترێک 500 دینار و 2000 دینار کرێی دەستپێک وەردەگرێت:
Read the distance of the trip in kilometres.
دووریی گەشتەکە بە کیلۆمەتر وەربگرە.
Multiply the distance by 500.
دوورییەکە لێکبدە لە 500.
Add 2000 to the result.
2000 بخەرە سەر ئەنجامەکە.
Show the final number as the fare.
ژمارەی کۆتایی وەک کرێ پیشان بدە.
For a 6 km trip the computer works out , then , and shows 5000 dinars. A list of exact steps like this, which always ends with an answer, is called an algorithm. You will learn to plan algorithms in Algorithms, pseudocode and flowcharts.
بۆ گەشتێکی 6 کیلۆمەتری، سەرەتا دەکات، پاشان و 5000 دینار پیشان دەدات. لیستێکی وەها لە هەنگاوی ورد کە هەمیشە بە وەڵامێک کۆتایی دێت پێی دەوترێت . لە وانەی ئەلگۆریزمەکان، نیمچەکۆد و هێڵکارییەکانی ڕەوت فێری پلاندانانی دەبیت.
Programs are everywhereبەرنامەکان لە هەموو شوێنێکن
You use many programs every day, often without seeing a computer: the apps on your phone, the ATM that gives you cash, the traffic lights at a crossroads, the settings of a washing machine, the engine control of a car, a football video game and this website. Each one is a program, or many programs working together, that people planned, wrote and tested.
هەموو ڕۆژێک چەندین بەکار دەهێنیت، زۆرجار بێ ئەوەی ببینیت: ناو مۆبایلەکەت، ئامێری ATM کە پارەت دەداتێ، گڵۆپەکانی هاتوچۆ لە چوارڕیانێکدا، ڕێکخستنەکانی جلشۆرێک، کۆنترۆڵی بزوێنەری ئۆتۆمبێل، تۆپی پێ و ئەم . هەر یەکێکیان (یان چەند کە پێکەوە کار دەکەن) کە خەڵک پلانیان بۆ داناوە، نووسیویانە و تاقییان کردۆتەوە.
Programs and the data they work with are together called software. The physical machine — the chips, the screen, the buttons and the cables — is the hardware. Hardware without software is like a car without a driver: everything is there, but nothing happens.
و ئەو کاری لەسەر دەکەن پێکەوە پێیان دەوترێت . ئامێرە فیزیکییەکە خۆی (، شاشە، دوگمەکان و وایەرەکان) . بەبێ وەک ئۆتۆمبێلێکە بێ شۆفێر: هەموو شتێک لە جێی خۆیەتی، بەڵام هیچ ڕوو نادات.
Input, processing and outputنێوخستە، چارەسەرکردن و دەرخستە
Almost every program does the same three things. It takes input: data that comes in, for example from a keyboard, a touch screen or a sensor. It does processing: it works on that data by following its instructions. It gives output: the result that goes out, for example on a screen, through a speaker or on paper. The IT course looks at the same cycle for a whole computer, with storage added: the information processing cycle.
نزیکەی هەموو هەمان سێ کار دەکات. وەردەگرێت: کە دێتە ژوورەوە، بۆ نموونە لە ، یان . دەکات: بە جێبەجێکردنی خۆی کار لەسەر ئەو دەکات. دەدات: ئەنجامەکە کە دەچێتە دەرەوە، بۆ نموونە لەسەر شاشە، لە ڕێگەی یان لەسەر کاغەز. کۆرسی هەمان بیرۆکە بۆ هەموو و بە زیادکردنی هەڵگرتن باس دەکات: سووڕی چارەسەرکردنی زانیاری.
| Program | Input | Processing | Output |
|---|---|---|---|
| Calculator app | 2 + 3 | adds the two numbersدوو ژمارەکە کۆ دەکاتەوە | 5 |
| ATMئامێری ATM | card, PIN and amountکارت، PIN و بڕی پارە | checks the PIN and the balancePIN و باڵانسەکە دەپشکنێت | cash and a receiptپارە و پسوولە |
| Map app ڕێنیشاندەر | the place you want to goئەو شوێنەی دەتەوێت بچیتێ | searches for a short routeبەدوای ڕێگایەکی کورتدا دەگەڕێت | directions on the screenڕێنمایی لەسەر شاشە |
| Marks program نمرە | a student's five marksپێنج نمرەی خوێندکارێک | adds them and divides by 5کۆیان دەکاتەوە و دابەشیان دەکات بەسەر 5دا | the average and “Pass” or “Fail”تێکڕاکە و «دەرچوو» یان «کەوتوو» |
Source code and machine codeکۆدی سەرچاوە و کۆدی ئامێر
Programmers usually write in a high-level language such as Python, Java or C#. Its words and symbols are close to English and to maths, so people can read and write it. The text that a programmer writes is called source code.
زۆرجار بە دەنووسن، وەک Python، Java یان C#. وشە و هێماکانی نزیکن لە ئینگلیزی و بیرکاری، بۆیە مرۆڤ دەتوانێت بیخوێنێتەوە و بینووسێت. ئەو دەقەی دەینووسێت پێی دەوترێت .
But the part of the computer that carries out instructions — the CPU — does not understand a high-level language. It understands only machine code: instructions written in binary, as patterns of 0s and 1s. Each instruction does one tiny job, such as copying a number, adding two numbers or jumping to another instruction, and each kind of CPU has its own set of instructions, its instruction set.
بەڵام ئەو بەشەی کە جێبەجێ دەکات، واتە ، لە تێناگات. تەنها لە تێدەگات: بە نووسراو، وەک نەخشێک لە 0 و 1. هەر کارێکی زۆر بچووک دەکات، وەک کۆپیکردنی ژمارەیەک، کۆکردنەوەی دوو ژمارە یان بازدان بۆ تر. هەر جۆرێکی کۆمەڵە ڕێکارنامەی تایبەت بە خۆی هەیە.
So between the two there must be a translator: a program that turns source code into machine code. The two classic kinds, the compiler and the interpreter, are explained in How code becomes a running program.
کەواتە لە نێوانیاندا دەبێت وەرگێڕێک هەبێت: کە دەکات بە . دوو جۆرە کلاسیکییەکەی، و ، لە وانەی چۆن کۆد دەبێت بە بەرنامەیەک کە کار دەکات ڕوون کراونەتەوە.
See the difference between source code and machine code, and how a compiler turns what people write into what the CPU runs.
جیاوازیی نێوان و دەبینیت و چۆن ئەوەی مرۆڤ دەینووسێت دەکاتە شتێک کە جێبەجێی دەکات.
Watch 1:25-3:38: source code vs machine code.
لە 1:25 تا 3:38 سەیر بکە: بەرامبەر .
Source code and machine codeکۆدی سەرچاوە و کۆدی ئامێر
From an idea to machine codeلە بیرۆکەوە بۆ کۆدی ئامێر
Follow one small job on its way to the CPU: “find the average of three marks”. A person first writes the idea as exact steps, then as source code. A translator turns the source code into machine code, and the CPU runs those tiny instructions one after another until the answer appears.
بەدوای کارێکی بچووکدا بڕۆ لە ڕێگەی بۆ : «تێکڕای سێ نمرە بدۆزەرەوە». مرۆڤ سەرەتا بیرۆکەکە وەک هەنگاوی ورد دەنووسێت، پاشان وەک . وەرگێڕێک دەکات بە و ئەو بچووکانە یەک لە دوای یەک جێبەجێ دەکات تا وەڵامەکە دەردەکەوێت.


What programmers really doبەرنامەسازەکان بەڕاستی چی دەکەن؟
Typing code is only one part of programming. Most of the work is thinking, planning and checking. A typical cycle looks like this:
نووسینی کۆد تەنها بەشێکە لە . زۆربەی کارەکە بیرکردنەوە، پلاندانان و پشکنینە. خولێکی ئاسایی کار بەم شێوەیەیە:
- Understand the problemلە کێشەکە تێبگە
What comes in, and what must come out? Ask questions until the task is clear.
چی دێتە ژوورەوە و چی دەبێت بچێتە دەرەوە؟ پرسیار بکە تا کارەکە ڕوون دەبێتەوە.
- Plan a solutionپلانی چارەسەرێک دابنێ
Write the steps as an algorithm, in pseudocode or as a flowchart, before any code.
پێش هەر کۆدێک، هەنگاوەکان وەک ، بە یان وەک بنووسە.
- Write the codeکۆدەکە بنووسە
Turn the plan into source code in a programming language.
پلانەکە بکە بە بە .
- Testتاقی بکەرەوە
Run the program with many inputs, including unusual ones, and compare its output with the right answers.
بە چەندین جێبەجێ بکە، تەنانەت نائاسایی و لەگەڵ وەڵامە دروستەکان بەراورد بکە.
- Debugکرمەکوژی بکە
When something is wrong, find the mistake (the bug), fix it and test again.
کاتێک شتێک هەڵەیە، هەڵەکە () بدۆزەرەوە، چاکی بکە و دووبارە تاقی بکەرەوە.
- Improve and maintainباشتری بکە و چاککاریی بکە
Make the program clearer or faster, and update it when people need something new.
ڕوونتر یان خێراتر بکە و کاتێک خەڵک شتێکی نوێیان پێویست بوو نوێی بکەرەوە.
These steps repeat: a failed test often sends you back to the plan. Programmers also spend a lot of time reading code — their own and other people's — so clear, simple code matters as much as working code.
ئەم هەنگاوانە دووبارە دەبنەوە: تاقیکردنەوەیەکی سەرنەکەوتوو زۆرجار دەتگەڕێنێتەوە بۆ پلانەکە. هەروەها کاتێکی زۆر بە خوێندنەوەی کۆد بەسەر دەبەن (کۆدی خۆیان و کۆدی خەڵکی تر)، بۆیە کۆدی ڕوون و سادە هێندەی کۆدی کارا گرنگە.
What programmers really doبەرنامەسازەکان بەڕاستی چی دەکەن؟
Testing in four levelsتاقیکردنەوە لە چوار ئاستدا
In a big project, the Test step above is not one job but four levels, from the smallest part up to the whole program. A car factory works the same way:
لە پڕۆژەیەکی گەورەدا، هەنگاوی تاقی بکەرەوەی سەرەوە یەک کار نییە، بەڵکو چوار ئاستە: لە بچووکترین بەشەوە تا هەموو . کارگەیەکی ئۆتۆمبێل هەمان شێوە کار دەکات:
| Levelئاست | What is testedچی تاقی دەکرێتەوە | In a car factoryلە کارگەی ئۆتۆمبێلدا |
|---|---|---|
| 1. یەکەم: | each small part on its own, for example one functionهەر بەشێکی بچووک بە تەنها، بۆ نموونە یەک | the brakes aloneتەنها بریکەکان |
| 2. دووەم: | parts joined together: does one part pass the right data to the next?بەشەکان پێکەوە: ئایا بەشێک دروست دەداتە بەشی دواتر؟ | brakes and pedal togetherبریکەکان و پەدالی بریک پێکەوە |
| 3. سێیەم: | the whole program as one system: right answers, speed, unusual inputهەموو وەک یەک سیستەم: وەڵامی دروست، خێرایی، نائاسایی | the whole car on a test trackهەموو ئۆتۆمبێلەکە لە گۆڕەپانی تاقیکردنەوەدا |
| 4. چوارەم: | the users or the customer try it and decide whether it does what they need یان کڕیار تاقیی دەکەنەوە و بڕیار دەدەن ئایا ئەوەی پێویستیانە دەیکات | the buyer’s test driveکڕیارەکە پێش کڕین ئۆتۆمبێلەکە لێدەخوڕێت |
At every level, a mistake that is found is fixed and the tests are run again, because one fix can break something that worked before.
لە هەموو ئاستێکدا، هەر هەڵەیەک بدۆزرێتەوە چاک دەکرێت و تاقیکردنەوەکان دووبارە دەکرێنەوە، چونکە چاککردنێک دەکرێت شتێک تێک بدات کە پێشتر کاری دەکرد.
A short history of programmingمێژوویەکی کورتی بەرنامەسازی
Programming is older than the electronic computer. Two early milestones show how it began: a method written for a machine that was never built, and a computer programmed with cables and switches.
لە ئەلیکترۆنی کۆنترە. دوو وێستگەی سەرەتایی پیشان دەدەن چۆن دەستی پێ کرد: ڕێگایەک کە بۆ ئامێرێک نووسرا کە هەرگیز دروست نەکرا و کە بە کێبڵ و بۆ دادەنرا.
| Yearساڵ | What happenedچی ڕوویدا |
|---|---|
| 1843 | Ada Lovelace publishes long notes on Charles Babbage's planned Analytical Engine. Her Note G gives a step-by-step method for the machine to calculate a series called the Bernoulli numbers. It is often called the first published computer program, although the machine was never built and historians still discuss how much of the work was Babbage's.Ada Lovelace تێبینیی درێژ لەسەر ئامێری شیکاریی Charles Babbage بڵاو دەکاتەوە کە تەنها پلانی بۆ دانرابوو. لە تێبینیی Gـدا ڕێگایەکی هەنگاو بە هەنگاو دەخاتە ڕوو بۆ ئەوەی ئامێرەکە زنجیرەیەک ژمارە بە ناوی ژمارەکانی Bernoulli حیساب بکات. زۆرجار بە یەکەم بڵاوکراوەی ناو دەبرێت، هەرچەندە ئامێرەکە هەرگیز دروست نەکرا و مێژوونووسان هێشتا باس لەوە دەکەن چەند بەشی کارەکە هی Babbage بووە. |
| 1945–1946 | ENIAC, one of the first electronic computers, is programmed by six women: Kay McNulty, Betty Jean Jennings, Betty Snyder, Marlyn Wescoff, Fran Bilas and Ruth Lichterman. There is no programming language yet: they plug in cables and set switches by hand, and setting up a new program can take days.ENIAC، یەکێک لە یەکەمین ئەلیکترۆنییەکان، لەلایەن شەش ئافرەتەوە بۆ دەنووسرێت: Kay McNulty، Betty Jean Jennings، Betty Snyder، Marlyn Wescoff، Fran Bilas و Ruth Lichterman. هێشتا هیچ نییە: بە دەست کێبڵ دەبەستن و ڕێک دەخەن و ئامادەکردنی نوێ چەند ڕۆژێکی دەوێت. |
A short history of programmingمێژوویەکی کورتی بەرنامەسازی
Why mistakes are called bugsبۆچی هەڵەکان پێیان دەوترێت باگ؟
A mistake in a program is called a bug, and finding and fixing bugs is debugging. A famous story goes with the name. On 9 September 1947 the team running the Harvard Mark II computer traced a fault to a real moth caught in one of the machine's relays (small electric switches). They taped the moth into the log book and wrote: “First actual case of bug being found.”
هەڵەیەک لە پێی دەوترێت و دۆزینەوە و چاککردنی پێی دەوترێت . چیرۆکێکی بەناوبانگ لەگەڵ ئەم ناوەدایە. لە 9ی سێپتەمبەری 1947دا تیمی Harvard Mark II هۆی تێکچوونێکیان دۆزییەوە: مێرووێکی ڕاستەقینە لە یەکێک لە ڕیلەکانی ئامێرەکەدا ( کارەبایی بچووک) گیری خواردبوو. مێرووەکەیان بە دەفتەری تۆمارەکەوە لکاند و نووسیان: «یەکەم جاری ڕاستەقینەی دۆزینەوەی ».
The note is a joke, because engineers already used “bug” for small faults in machines long before 1947 — Thomas Edison wrote about “bugs” in 1878. Grace Hopper liked to tell the story and helped make “debugging” a common word in computing.
تێبینییەکە گاڵتەیەکە، چونکە ئەندازیاران زۆر پێش 1947 وشەی «bug»ـیان بۆ کەموکوڕیی بچووکی ئامێرەکان بەکار دەهێنا: Thomas Edison لە 1878 دەربارەی «bug» نووسیبووی. Grace Hopper حەزی دەکرد ئەم چیرۆکە بگێڕێتەوە و یارمەتی دا وشەی «debugging» لە بواری بڵاو ببێتەوە.
Today almost every bug is a mistake in the instructions themselves: a wrong step, a missing step or steps in the wrong order. Every programmer writes bugs. Good programmers test carefully so they find them early. How to find and fix bugs in real code is practised in the Python track, in Errors and debugging.
ئەمڕۆ نزیکەی هەموو هەڵەیەکە لە خودی : هەنگاوێکی هەڵە، هەنگاوێکی ونبوو یان هەنگاو بە ڕیزبەندیی هەڵە. هەموو دەنووسێت. باش بە وردی تاقی دەکەنەوە بۆ ئەوەی زوو بیاندۆزنەوە. چۆنیەتیی دۆزینەوە و چاککردنی لە کۆدی ڕاستەقینەدا لە ڕێڕەوی Pythonـدا، لە وانەی هەڵەکان و کرمەکوژی ڕاهێنانی لەسەر دەکرێت.
Finding and fixing in a program. Common methods: read the error message, print values (print() in Python, echo or var_dump() in PHP), trace the code by hand and test small parts.
دۆزینەوە و چاککردنی لە . ڕێگە باوەکان: خوێندنەوەی ، چاپکردنی نرخەکان (print() لە Pythonـدا، echo یان var_dump() لە PHPـدا)، بەدواداچوونی کۆد بە دەست و تاقیکردنەوەی بەشە بچووکەکان.
A short history of programmingمێژوویەکی کورتی بەرنامەسازی
The first compilers and languagesیەکەمین کۆمپایلەرەکان و زمانەکان
Setting cables by hand was slow, and writing 0s and 1s was easy to get wrong. So programmers began to write programs that translate for them:
بەستنی کێبڵ بە دەست هێواش بوو و نووسینی 0 و 1 زوو هەڵەی تێدەکەوت. بۆیە دەستیان کرد بە نووسینی کە بۆیان وەربگێڕن:
| Yearساڵ | What happenedچی ڕوویدا |
|---|---|
| 1952 | Grace Hopper finishes the A-0 system for the UNIVAC I computer and calls it a compiler: from short codes that a person writes, it puts together ready-made pieces of machine code. By today's standards it was closer to a tool that joins pieces, but it opened the way to real compilers. Her later work led to COBOL (1959), a language that used English words.Grace Hopper سیستەمی A-0 بۆ UNIVAC I تەواو دەکات و ناوی دەنێت : لە کۆدی کورتەوە کە مرۆڤ دەینووسێت، پارچە ئامادەکانی پێکەوە دەبەستێت. بە پێوەری ئەمڕۆ زیاتر ئامرازێکی بەیەکەوەبەستنی پارچەکان بوو، بەڵام ڕێگای بۆ ڕاستەقینە کردەوە. کارەکانی دواتری بوونە هۆی دروستبوونی COBOL (1959)، زمانێک کە وشەی ئینگلیزیی بەکار دەهێنا. |
| 1957 → | High-level languages follow one another: FORTRAN (1957), C (1972), Python (1991), Java (1995) and many more. Each makes it easier to say more with fewer, clearer lines. یەک لە دوای یەک دێن: FORTRAN (1957)، C (1972)، Python (1991)، Java (1995) و زۆری تر. هەر یەکێکیان ئاسانتری دەکات بە دێڕی کەمتر و ڕوونتر زیاتر بڵێیت. |
Z(1) = Y + W(1). سەرەتای FORTRAN لەسەر کارتی کونکراو دەنووسران، بۆ هەر کارتێک. ئەم کارتە Z(1) = Y + W(1) هەڵدەگرێت.Arnold Reinhold, via Wikimedia Commons · CC BY-SA 2.5From machine code to assembly language and the assembler, then the first high-level languages like FORTRAN: why each step made programming easier.
لە بۆ و ، پاشان یەکەم وەک FORTRAN: بۆچی هەر هەنگاوێک ئاسانتر کرد.
Whole video: machine code, assembly, Grace Hopper's A-0, FORTRAN (7:23) and COBOL.
هەموو ڤیدیۆکە: ، ، A-0ـی Grace Hopper، FORTRAN (7:23) و COBOL.
Common mistakesهەڵە باوەکان
| Mistaken ideaبیرۆکەی هەڵە | What is trueڕاستییەکە |
|---|---|
| “The computer will understand what I mean.”« لە مەبەستم تێدەگات.» | It does exactly what is written. Write every step clearly and in order.ڕێک ئەوە دەکات کە نووسراوە. هەموو هەنگاوێک بە ڕوونی و بە ڕیز بنووسە. |
| “Programming is just typing code.”« تەنها نووسینی کۆدە.» | Most of the work is understanding the problem, planning, testing and debugging.زۆربەی کارەکە تێگەیشتن لە کێشەکە، پلاندانان، تاقیکردنەوە و . |
| “You must be a maths genius to program.”«بۆ دەبێت بلیمەتی بیرکاری بیت.» | Clear thinking and patience matter most. You learn the maths a task needs when you need it.بیرکردنەوەی ڕوون و ئارامگرتن لە هەمووی گرنگترن. ئەو بیرکارییەی کارێک پێویستی پێیەتی کاتێک پێویست بوو فێری دەبیت. |
| “Source code and machine code are the same thing.”« و یەک شتن.» | People write source code; the CPU runs machine code. A compiler or an interpreter translates between them.مرۆڤ دەنووسێت؛ جێبەجێ دەکات. یان لە نێوانیاندا وەردەگێڕێت. |
| “Programs only run on desktop computers.”« تەنها لەسەر کار دەکەن.» | Phones, cars, ATMs, washing machines and traffic lights all run programs.مۆبایل، ئۆتۆمبێل، ئامێری ATM، جلشۆر و گڵۆپی هاتوچۆ هەموویان جێبەجێ دەکەن. |
| “It worked once, so it is finished.”«جارێک کاری کرد، کەواتە تەواوە.» | Test with many inputs, including unusual ones such as 0 or an empty answer.بە چەندین تاقی بکەرەوە، تەنانەت نائاسایی وەک 0 یان وەڵامی بەتاڵ. |
Exercisesڕاهێنانەکان
For each program, name the input, the processing and the output: (a) a taxi-fare app, (b) a phone's step counter, (c) a money-changer's program in the bazaar that turns US dollars into Iraqi dinars.
بۆ هەر ، و دیاری بکە: (أ) کرێی تەکسی، (ب) هەنگاوژمێری مۆبایل، (ج) سەڕافێک لە بازاڕدا کە دۆلاری ئەمریکی دەکات بە دیناری عێراقی.
Show answerوەڵامەکە پیشان بدە
| Program | Input | Processing | Output |
|---|---|---|---|
| (a) Taxi fare(أ) کرێی تەکسی | distance in kmدووری بە کیلۆمەتر | distance × 500, then + 2000دووری × 500، پاشان + 2000 | the fareکرێکە |
| (b) Step counter(ب) هەنگاوژمێر | movement measured by the sensorئەو جووڵەیەی دەیپێوێت | decides when a step happened and adds 1بڕیار دەدات کەی هەنگاوێک نرا و 1 زیاد دەکات | the number of stepsژمارەی هەنگاوەکان |
| (c) Money changer(ج) سەڕاف | the amount in dollars and today's rateبڕەکە بە دۆلار و نرخی ئەمڕۆ | amount × rateبڕ × نرخ | the amount in dinarsبڕەکە بە دینار |
For example, with a rate of 1400 dinars per dollar, 100 dollars give dinars. (The rate is only an example; it changes every day.)
بۆ نموونە، ئەگەر نرخی هەر دۆلارێک 1400 دینار بێت، 100 دۆلار دەکاتە دینار. (ئەم نرخە تەنها نموونەیە؛ ڕۆژانە دەگۆڕێت.)
This instruction is too vague for a computer: “Work out a student's final mark and see if they passed.” Rewrite it as exact steps. The coursework mark is out of 40, the exam mark is out of 60, and a student passes with a total of 50 or more. Then follow your steps for a coursework mark of 32 and an exam mark of 25.
ئەم بۆ زۆر ناڕوونە: «نمرەی کۆتایی خوێندکارێک حیساب بکە و بزانە دەرچووە یان نا.» وەک هەنگاوی ورد بینووسەرەوە. نمرەی کۆششی ساڵ لە 40ـە، نمرەی تاقیکردنەوە لە 60ـە و خوێندکار بە کۆی 50 یان زیاتر دەردەچێت. پاشان هەنگاوەکانت بۆ نمرەی کۆششی 32 و نمرەی تاقیکردنەوەی 25 جێبەجێ بکە.
Hintئاماژە
Say where each number comes from, what to calculate, and what to show in each case.
بڵێ هەر ژمارەیەک لە کوێوە دێت، چی حیساب بکرێت و لە هەر حاڵەتێکدا چی پیشان بدرێت.
Show answerوەڵامەکە پیشان بدە
Read the coursework mark (0 to 40).
نمرەی کۆششی ساڵ وەربگرە (0 تا 40).
Read the exam mark (0 to 60).
نمرەی تاقیکردنەوە وەربگرە (0 تا 60).
Add the two marks to get the total.
دوو نمرەکە کۆ بکەرەوە بۆ ئەوەی کۆکە دەربچێت.
If the total is 50 or more, show “Pass”; otherwise show “Fail”.
ئەگەر کۆکە 50 یان زیاتر بوو، «دەرچوو» پیشان بدە؛ ئەگەرنا «کەوتوو» پیشان بدە.
With 32 and 25: , and 57 is 50 or more, so the output is “Pass”.
بە 32 و 25: و 57 لە 50 کەمتر نییە، بۆیە «دەرچوو»ـە.
Name each item: source code, machine code, an algorithm in plain words, or a flowchart. Which one can the CPU run directly? (a) total = price * 3 (b) 10110000 00000101 (c) “Multiply the price by 3, then show the total.” (d) a drawing of boxes and diamonds joined by arrows.
ناوی هەر یەکێک بنووسە: ، ، بە وشەی ئاسایی یان . دەتوانێت ڕاستەوخۆ کامیان جێبەجێ بکات؟ (أ) total = price * 3 (ب) 10110000 00000101 (ج) «نرخەکە لێکبدە لە 3، پاشان کۆکە پیشان بدە.» (د) وێنەیەکی چوارگۆشە و شێوەی ئەڵماسی کە بە تیر بەیەکەوە بەستراون.
Show answerوەڵامەکە پیشان بدە
- (a) source code in a high-level language; (b) machine code; (c) an algorithm in plain words; (d) a flowchart.
- Only (b) can be run by the CPU directly — and only by the kind of CPU it was made for. (a) needs a translator first; (c) and (d) are plans for people.
- (أ) بە ؛ (ب) ؛ (ج) بە وشەی ئاسایی؛ (د) .
- تەنها (ب) دەتوانێت ڕاستەوخۆ لەلایەن جێبەجێ بکرێت، ئەویش تەنها لەلایەن ئەو جۆرە بۆی دروست کراوە. (أ) سەرەتا پێویستی بە وەرگێڕێکە؛ (ج) و (د) پلانن بۆ مرۆڤ.
These steps should find the average of three marks, but they contain a bug. Find it and fix it. 1. Read the three marks. 2. Divide the total by 3. 3. Add the three marks to get the total. 4. Show the result.
ئەم هەنگاوانە دەبێت تێکڕای سێ نمرە بدۆزنەوە، بەڵام تێدایە. بیدۆزەرەوە و چاکی بکە. 1. سێ نمرەکە وەربگرە. 2. کۆکە دابەش بکە بەسەر 3دا. 3. سێ نمرەکە کۆ بکەرەوە بۆ ئەوەی کۆکە دەربچێت. 4. ئەنجامەکە پیشان بدە.
Show answerوەڵامەکە پیشان بدە
Steps 2 and 3 are in the wrong order: step 2 divides a total that does not exist yet. Swap them — first add the three marks, then divide the total by 3, then show the result. A computer would not notice the problem by itself; it would simply follow the wrong order.
هەنگاوی 2 و 3 بە ڕیزبەندیی هەڵەن: هەنگاوی 2 کۆیەک دابەش دەکات کە هێشتا بوونی نییە. شوێنیان بگۆڕەوە: سەرەتا سێ نمرەکە کۆ بکەرەوە، پاشان کۆکە دابەش بکە بەسەر 3دا، پاشان ئەنجامەکە پیشان بدە. خۆی هەست بەم کێشەیە ناکات؛ تەنها ڕیزبەندییە هەڵەکە جێبەجێ دەکات.
Summaryپوختە
- A program is a list of exact instructions; programming is planning, writing, testing and debugging programs.
- Big programs are tested in four levels: unit, integration, system and acceptance testing.
- A computer follows a program exactly and never guesses what you meant.
- Programs are everywhere: phones, ATMs, cars, traffic lights. Programs and data together are software; the machine is hardware.
- Almost every program takes input, does processing and gives output.
- People write source code in a high-level language; the CPU runs only machine code (0s and 1s). A compiler or an interpreter translates.
- Milestones: Lovelace's Note G (1843), the ENIAC programmers (1945–1946), the Mark II “bug” (1947), Hopper's A-0, an early compiler (1952).
- لیستێکە لە ورد؛ پلاندانان، نووسین، تاقیکردنەوە و .
- گەورەکان لە چوار ئاستدا تاقی دەکرێنەوە: ، ، و .
- ڕێک وەک خۆی جێبەجێ دەکات و هەرگیز مەزەندەی مەبەستت ناکات.
- لە هەموو شوێنێکن: مۆبایل، ATM، ئۆتۆمبێل، گڵۆپی هاتوچۆ. و پێکەوە ؛ ئامێرەکە .
- نزیکەی هەموو وەردەگرێت، دەکات و دەدات.
- مرۆڤ بە دەنووسێت؛ تەنها (0 و 1) جێبەجێ دەکات. یان وەردەگێڕێت.
- وێستگەکان: تێبینیی Gـی Lovelace (1843)، ENIAC (1945–1946)، Mark II (1947)، A-0ـی Hopper، یەکێک لە یەکەمین (1952).
What are the three things almost every program does?نزیکەی هەموو بەرنامەیەک کام سێ کار دەکات؟
It takes input, processes it and gives output.
وەردەگرێت، دەکات و دەدات.
Why can the CPU not run source code directly?بۆچی CPU ناتوانێت ڕاستەوخۆ کۆدی سەرچاوە جێبەجێ بکات؟
The CPU understands only machine code in binary. Source code must first be translated by a compiler or an interpreter.
تەنها لە بە تێدەگات. سەرەتا دەبێت لەلایەن یان وەربگێڕدرێت.
Where does the word “bug” come from?وشەی «bug» لە کوێوە هاتووە؟
Engineers used it for faults in machines already in the 1800s; in 1947 a real moth found in the Harvard Mark II made it famous in computing.
ئەندازیاران لە سەدەی نۆزدەدا بۆ کەموکوڕیی ئامێرەکان بەکاریان دەهێنا؛ لە 1947 مێرووێکی ڕاستەقینە کە لە Harvard Mark II دۆزرایەوە لە بواری بەناوبانگی کرد.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
Language-neutral chapters: what programming is (exact instructions, like guiding a friend through a Lego set) and how to track down bugs with print statements.
دوو بەشی گشتی، بێ زمانێکی دیاریکراو: چییە ( ورد، وەک ڕێنماییکردنی هاوڕێیەک بۆ پێکەوەنانی Lego) و چۆن بە print بدۆزیتەوە.
Watch 1:37-6:19, the chapter 'What is Programming?'.
بەشی What is Programming? (لە 1:37 تا 6:19) سەیر بکە.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Programming Languagesزمانەکانی بەرنامەسازی
Related lecturesوانە پەیوەندیدارەکان
- Programming Languagesزمانەکانی بەرنامەسازی
- How Code Becomes a Running Program: Compilers and Interpretersچۆن کۆد دەبێت بە بەرنامەیەک کە کار دەکات: کۆمپایلەرەکان و ئینتەرپرێتەرەکان
- Algorithms, Pseudocode and Flowchartsئەلگۆریزمەکان، نیمچەکۆد و هێڵکارییەکانی ڕەوت
- Programming Languages and Algorithmsزمانەکانی بەرنامەسازی و ئەلگۆریزمەکان
- Number Systems and Place Valueسیستەمە ژمارەییەکان و بەهای خانەیی
- How a Computer Runs a Programکۆمپیوتەر چۆن بەرنامەیەک جێبەجێ دەکات
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Harvard CS50x 2026, lecture notes week 0 (input, output, algorithms, pseudocode)
- Python documentation: glossary (interpreted, bytecode)
- Wikipedia: Note G (Ada Lovelace's 1843 program)
- Wikipedia: ENIAC (how it was programmed; its first programmers)
- Wikipedia: Grace Hopper (A-0, COBOL, the 1947 bug)
- Wikipedia: Bug (engineering) — Edison 1878 and the Mark II moth
- Wikipedia: A-0 System (Grace Hopper, UNIVAC I, 1951–1952)
- Wikipedia: Software testing (testing levels: unit, integration, system, acceptance; regression testing)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.