Lessons 19–20 · 2 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
20
Programming languages
Textbook: pp. 48–51
GoalLists the main programming languages and where they are used, tells a compiler from an interpreter and an IDE, and knows the six stages of creating a program.
New words
programming language: a formal language with strict rules for writing programs · dasturlash tilicompiler: translates the whole program into machine code before it is run · kompilyatorinterpreter: translates and carries out the program step by step and reports an error at once · interpretatorIDE (integrated development environment): a program with an editor, translator and debugging tools for writing code · IDE
Explanation
The processor does not directly understand text in a programming language; it carries out only machine code (0s and 1s). So a translator is needed. A compiler reads the whole program, translates it into machine code and produces an executable file. An interpreter translates the program line by line while carrying it out and reports an error as soon as it meets one. Popular languages: C – for operating systems and system programs; Java – for computer and Android phone applications (today Kotlin is also widely used for Android apps, and Swift for iPhone apps); JavaScript – for making web pages interactive; PHP – for the server side of dynamic websites; Scratch – a visual language for learning; Python – for many kinds of tasks, data analysis and artificial intelligence. An IDE is a program that joins a text editor, a translator and tools for finding errors. The six stages of creating a program: finding the requirements, design, writing the code, finding errors and testing, putting it into use, and support.
Worked examples
To write an app for an Android phone, Java or Kotlin fits; for a colour change when a button is clicked on a web page – JavaScript; for teaching children to build programs from blocks – Scratch; for both learning and data analysis – Python.
Interpreter: line 1 ran fine, line 2 has an error – the program stops there and reports it. Compiler: it first checks the whole program; if there is an error, no executable file is made and a list of errors is given.
Class activity
“Choosing a language”: cards show tasks (web animation, game engine, a teaching program for children, artificial intelligence); groups choose the matching language and give a reason.
Practice
1
State the main difference between a compiler and an interpreter.
A compiler translates the whole program in advance; an interpreter translates and runs it line by line.
2
Which language would you choose: a) a phone app; b) making a web page interactive; c) teaching children visual programming?
a – Java or Kotlin (Android), Swift (iPhone); b – JavaScript; c – Scratch.
3
Write the stages of creating a program in order: testing, writing code, putting into use, finding requirements, support, design.