0% found this document useful (0 votes)
18 views14 pages

Lecture 1

ملخص

Uploaded by

Mohamed Labib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views14 pages

Lecture 1

ملخص

Uploaded by

Mohamed Labib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Lecture 1

OVERVIEW Part-1

Main Course Resource


EDX, LouvainXLouv1.1x
•Paradigms of Computer Programming –Fundamentals, MIT University

Description
This course introduces students to the main constructs of contemporary
programming languages and provides the tools needed to evaluate the existing and
future programming languages.

Objectives
The purpose of this course is to :
1. Provide students with better understanding of significance of
implementation.
2. Acquaint students with the ability to learn new languages.
3. Introduce students to various programming language concepts including
binding, scope, lifetime, parameter passing etc.
4. Enable students to be efficient in their work.
‫ األساسية للبرمجة في العموم و الفروقات بين لغات البرمجة عشان الطالب يخرج عارف‬concepts‫الكورس دا بيعرفنا الـ‬
.paradigms‫إزاي يقدر يعمل لغة برمجة خاصة بيه و يقدر يحدد أسس بناءها و دا طبعًا هيحصل بعد فهمه للـ‬

TEXT-BOOK
CONCEPTS OF PROGRAMMING Concepts, Techniques, and Models of
TH
LANGUAGE, 10 BY ROBERT W. Computer Programming BY PETER
SEBESTA VAN ROY AND SEIF HARIDI

.‫دي الكتب اللى هنشتغل منها في الكورس دا‬

1 Minders’22 AC
‫‪Chapter –1,BY ROBERT‬‬
‫‪1. Reasons for Studying Concepts of Programming Languages.‬‬

‫‪2. Programming Domains.‬‬ ‫و دي محتوايات شابتر ‪ 1‬إللى هندرسها إن شاء هللا‪.‬‬

‫‪3. Language Evaluation Criteria.‬‬

‫‪4. Influences on Language Design.‬‬

‫‪5. Language Categories.‬‬

‫‪Why study programming language‬‬


‫الزم نعرف ليه إحنا بندرس لغات البرمجة؟‬

‫‪ To improve the ability to develop effective algorithms.‬‬


‫عشان يكون عندنا القدرة إننا نـ‪.develop effective algorithms‬‬

‫‪ To improve the use of familiar languages.‬‬


‫عشان نـ‪ improve‬استخدامنا للغات البرمجة و إنها تكون مألوفة بالنسبالنا بحيث أما نشوف أي كود خاص بلغة ما نعرف اللغة‬
‫دي بتدعم أنهي ‪.paradigm‬‬

‫‪ To increase the vocabulary of useful programming constructs.‬‬


‫عشان تزود الـ‪ terminologies‬بتاعتك و الـ‪ vocabularies‬إللى بتمييز بنية كل لغة عن التانية‪.‬‬

‫‪ To allow a better choice of programming language.‬‬


‫عشان تقدر تحدد أنهي لغة برمجة هتكون مناسبة أكتر للى إنت هتنفذه‪ ،‬و الزم تعرف اللغة المناسبة للبروجيكت إللى هتنفذه مش‬
‫تختار اللغة على حسب إنت بتحب تشتغل بأنهي لغة فتختارها‪ ،‬ال المفروض تسأل الناس إللى حواليك و تاخد من خبرتهم أو‬
‫تسرش أو تسأل في السوق و تعرف إيه المناسب لشغلك‪.‬‬

‫‪ To make it easier to learn a new language.‬‬


‫و فهمك للـ‪ paradigms‬المختلفة هيسهل عليك تعلم لغات برمجة جديدة بشكل أسرع‪.‬‬

‫‪ To make it easier to design a new language.‬‬


‫كمان هيسهل عليك تصميم لغة برمجة جديدة و إنك تفهم أسس بناء أي لغة برمجة و تقدر تعمل لغة جديدة بنا ًءا على إللى‬
‫اتعملته و فهمته‪.‬‬

‫‪ To simulate useful features in languages that lack them.‬‬


‫عشان نـ‪ simulate‬الـ‪ useful features‬إللي مش موجودة في بعض اللغات‪.‬‬

‫‪ To make better use of language technology wherever it appears.‬‬


‫عشان نستفيد بشكل أفضل من تكنولوجيا اللغة أينما ظهرت‪.‬‬

‫‪2 Minders’22 AC‬‬


Programming Domains: Scientific applications

Views on scientific languages


11 Aug 2015, Andrew Ning
• I’ve used a number of scientific programming languages over the past 16
years: C++, C, Matlab, Java, Fortran, Python, and Julia, and I wouldn’t
name any one as the “best” (I’ve also used Objective-C, JavaScript, and PHP
quite a bit, but not for scientific computing). Usually, I try to pick the right
tool for the job, not necessarily just the tool I happen to know best (as they
say: if all you have is a hammer, everything looks like a nail).
‫ ليه مقالة كاتب فيها إنه‬Andrew ‫ و في واحد اسمه‬Scientific applications‫ هو الـ‬Programing domains‫من ضمن الـ‬
‫ و قال إنه كان داي ًما بيشتغل باللغة إللى‬،‫ و غيرهم‬Python‫ و الـ‬Java‫ و الـ‬C++‫ و الـ‬C‫فضل يتعلم لغات برمجة كتير زي الـ‬
‫ و مش شرط يكون بيحب اللغة إللى هتشتغل بيها أو يكون اختيارك للغة إللى‬،‫هتكون مناسبة للحاجة إللى هو عايز ينفذها‬
‫هتشتغل بيها مبني على أساس حبك أو كرهك ليها ال؛ و شبه الكالم دا بمثال و قال "اعتبر نفسك محتاج تدق مسامير و بالتالي‬
."‫هتشوف أنهي مطرقة مناسبة لدق نوع المسامير إللى قدامك و المناسب أكتر هو إللى هتستخدمه‬

Programming Domains: Business applications


COBOL (Common Business Oriented Language): It is an imperative, procedural
and, since 2002,object-oriented language. COBOL is primarily used in business,
finance, and administrative systems for companies.
‫ و هي اختصار‬COBOL ‫ لغة اسمها‬Business application‫ إللى بتُستخدم في الـ‬Programing domains‫و من ضمن الـ‬
.OOP‫ و الـ‬procedural‫ و الـ‬imperative‫ و هي معتمدة على الـ‬Common Business Oriented Language‫لـ‬

3 Minders’22 AC
Programming Domains: Artificial Intelligence
5 Most Popular AI Programming Languages
• LISP.
• Python.
• C++.
• Java.
• Prolog.
.AI‫و دي أمثلة للغات إللى بتُستخدم في الـ‬

Programming Domains: Systems programming


• Need efficiency because of continuous use.
‫ بسبب‬Operating Systems‫بنحتاج دايما ً إننا نطور كفاءة الـ‬
.‫استخدامنا الكتير ليهم‬

Programming Domains: Web Software

Top languages for web applications

..‫ هنحتاج نشتغل بلغات برمجة زي المتوضحين في الجدول دا كدا‬websites ‫طيب لو هنعمل‬

4 Minders’22 AC
Language Evaluation Criteria
‫ فإيه إللى هيعرفك إن لغة البرمجة دي كويسة و ال‬،‫ على لغة معينة‬judge ‫طب لما تيجي تعمل لغة برمجة جديدة أو لو هتعمل‬
‫ و هنعرفهم‬Cost ‫ و‬Reliability ‫ و‬Writability ‫ و‬Readability :‫ بتقيم أي لغة برمجة و هم‬Criteria ‫< عندنا‬-- ‫أل؟‬
.‫بالتفصيل‬
• Readability: the ease with which programs can be read and understood.
ً ،‫ يعني سهلة القراءة‬read ‫ من اسمها‬Readability‫الـ‬
‫ فدا مش مفهوم أوي فكدا‬x++ ‫مثال لو الكود فيه متغير بالشكل دا‬
..‫ هنا مش أحسن حاجة و هكذا‬Readability‫الـ‬

• Writability: the ease with which a language can be used to create programs.
.‫) من اسمها إنها تكون سهلة الكتابة‬write ‫ (جاية من‬Writability‫الـ‬

• Reliability: conformance to specifications (i.e., performs to its


specifications).
ً ‫إن اللغة يكون موثوق فيها و دا هيحصل لما تكون مبنية على مواصفات و بتمشي عليها‬
.)‫فعال (متطابقة مع المواصفات‬

• Cost: the ultimate total cost.


.‫ اإلجمالي بيكون قد إيه؟ و هكذا‬cost‫الـ‬
.‫و هنناقش كل نقطة منهم بتفصيل أكتر في الجزء الجاي‬

Evaluation Criteria: Readability


• Overall simplicity.
o A manageable set of features and constructs.
o Minimal feature multiplicity.
− More than one way to accomplish a particular operation, For
Example in java
Count=Count+1
Cout+=1
Cout++
++Count
‫ كمان بيكون فيها حد أدنى‬constructs‫ و الـ‬features‫ هي امكانية التحكم في الـ‬Readability‫بشكل عام كدا من أهم سمات الـ‬
‫ ليها نفس المعنى زي المثال إللى فوق دا بالجافا و‬operation ‫ بمعنى إن يكون عندى أكتر من‬feature multiplicity‫من الـ‬
.‫هنالحظ إن دا اختفى من البايثون إلنها أجدد من الجافا‬

o Minimal operator overloading.


− A single operator symbol has more than one meaning, example
in C++
Count=1if (Count=1)
.C++‫ زي المثال دا بلغة الـ‬statement‫هنا بيقولنا إنها بتتميز بقلة تداخل العمليات الحسابية في نفس الـ‬

5 Minders’22 AC
• Orthogonality.
o A relatively small set of primitive constructs can be combined in a
relatively small number of ways to build the control and data
structures of the language.
− Primitive data type (int, float, double, character).
− Two type operators (array, pointer).
o Every possible combination is legal.
‫ مش‬primitive ‫ أو‬small data type‫ و بنقسمها لـ‬data type ‫ دي المقصود بيها إننا عندنا أكتر من‬Orthogonality‫الـ‬
.combination ‫ و األهم من دا إننا نعمل‬complicated

• Data types.
o Adequate predefined data types.
− If there isn't Boolean data type what is this case meaning?
Timeout=1 (it is true or value one).
Timeout=true(it is clear to know that).
string ‫ و ال‬integer ‫ بتاعته و تحدد إذا كان‬data type‫ بالـ‬variable ‫ من األفضل أنك تعرف من األول كل‬Data types‫الـ‬
‫ و‬true or value one ‫ طب يا ترى هو نوعه إيه؟‬1 ‫ إنه بيساوي‬variable ‫تعرف‬ ً ،‫ و هكذا‬boolean ‫و ال‬
َّ ‫فمثال إنت ممكن‬
.‫ بتاعته من البداية‬data type‫بنا ًءا عليه الزم تحدد الـ‬

Evaluation Criteria: Writability


1. Simplicity and orthogonality:
o Few constructs, a small number of primitives, a small set of rules for
combining them.
‫ بتاعتك بشكل بسيط يعني ما تضطرش تكتب كذا سطر عشان تنفذ حاجة واحدة لكن لو‬rules‫المقصود هنا إنك تقدر تكتب الـ‬
.‫تقدر تكتب سطر كود واحد ينفذلك الحاجة إللى عايز تعملها دا هيكون أفضل و أسهل ليك في الكتابة‬

2. Support for abstraction:


o The ability to define and use complex structures or operations in ways
that allow details to be ignored.
complex ‫ يعني لما تستخدم‬.‫ دي معناها إن الداتا بتاعتك تكون متغلفة و مش معروف تفاصلها الدقيقة أوي‬abstraction‫الـ‬
‫) دا هيكون‬abstracted = ignored( ‫ بحيث إن تفاصيلها الداخلية لبناءها مش متوضحة‬operations ‫ أو‬structures
.more writability

3. Expressivity:
o A set of relatively convenient ways of specifying operations.
o Example: the inclusion of for statement in many modern languages.
ً ‫ إللى هتتم‬operation‫هنا المقصود إن يكون في اللغة تعبيرات نقدر منها نحدد نوع الـ‬
.for statement ‫مثال زي‬

6 Minders’22 AC
Evaluation Criteria: Reliability
1. Type checking:
o Testing for type errors.
2. Exception handling:
o Intercept run-time errors and take corrective measures.
‫ يعنى إننا نقدر نعتمد على اللغة دي و ماتقعش مننا طب إزاي؟‬Reliability‫الـ‬
.‫ دي و نهندلها‬errors‫ و نحدد نوع الـ‬check‫ و نـ‬test‫ فنقدر نـ‬errors ‫عن طريق إن لو حصل فيها‬

3. Aliasing:
o Presence of two or more distinct referencing methods for the same
memory location.
.‫لو عندنا أكتر من بوينتر بيشاوروا على نفس المكان في الميموري فإزاي نقدر نعرف إنهي فيهم أحق بالمكان دا في الميموري؟‬

4. Readability and writability:


o A language that does not support ―natural‖ ways of expressing an
algorithm will necessarily use ―unnatural‖ approaches, and hence
reduced reliability.
‫ و‬Reliability‫ تبقى كدا اللغة دي بنسبة كبيرة متحقق فيها الـ‬Writability‫ و الـ‬Readability‫لو اللغة دي متحقق فيها الـ‬
.‫نقدرر نعتمد عليها‬

Evaluation Criteria: Cost


• Training programmers to use language.
• Writing programs (closeness to particular applications).
• Compiling programs.
• Executing programs.
• Language implementation system: availability of free compilers.
• Reliability: poor reliability leads to high costs.
• Maintaining programs.
.‫ و كل العوامل التانية المذكورة دي‬memory‫ في الـ‬space‫ و الـ‬execution time‫ بيتمثل في الـ‬cost‫الـ‬

Influences on Language Design


The programming language affected with ….
• Computer Architecture
o Languages are developed around the prevalent computer architecture,
known as the von Neumann architecture (processor and memory).
‫ نفسه و‬Computer architecture‫؟ اه الـ‬PL‫ الـ‬develop‫ هل فيه حاجة بتأثر عليا و أنا بـ‬developer‫طيب أنا كـ‬
.‫ بتاعي ماشي إزاي‬OS‫ ماشي إزاي؟ و الـ‬system‫الـ‬

7 Minders’22 AC
• Programming Methodologies
o New software development methodologies (e.g., object-oriented
software development) led to new programming paradigms and by
extension, new programming languages.
ً OOP‫ زي الـ‬software‫ طرق جديدة في الـ‬develop‫كمان أما بنـ‬
new programming paradigms ‫مثال دا بيخلينا نعرف‬
.‫و بالتالي بنبني لغات برمجة جديدة‬

Computer Architecture Influence


• Well-known computer architecture: Von Neumann.
• Imperative languages, most dominant, because of von Neumann computers.
o Data and programs stored in memory.
o Memory is separate from CPU.
o Instructions and data are piped from memory to CPU.
o Basis for imperative languages.
− Variables model memory cells.
− Assignment statements model piping.
− Iteration is efficient

The von Neumann Architecture

Fetch-execute-cycle (on a von Neumann architecture computer).


1. Initialize the program counter.

2. Repeat forever.
• Fetch the instruction pointed by the counter.

8 Minders’22 AC
‫‪• Increment the counter.‬‬ ‫لو أنا في الـ‪ main program‬و واقف فى سطر كود‬
‫فى ‪ IDE‬ما فالـ‪ IDE‬دي متخزنة في الـ‪ RAM‬يعني‬
‫‪• Decode the instruction.‬‬ ‫في الـ‪ .Memory‬فأنا في الـ‪ main memory‬طالما‬
‫قولت ‪ run‬فالكومبيلر بتاعي في الـ‪ IDE‬اتعمله ‪load‬‬
‫‪• Execute the instruction.‬‬ ‫في الـ‪ ،Memory‬فأنا كاتبة شوية ‪ code‬و الكود إللى‬
‫أنا كاتباه دا واقفة عند ‪ int x=0‬فعندي حاجة اسمها‬
‫‪3. End repeat.‬‬ ‫‪ program counter‬دا بيكون شايف أنا واقف في‬
‫أنهي مكان و بعدها بيعمل الـ‪ Von Neumann‬دا إللى‬
‫هي ‪.Fetch Execute Cycle‬‬
‫‪ Fetch‬يعني هياخد واحدة من الـ‪ instructions‬بتاعتي‬
‫في الكود و يعرف إيه القيم إللى فيها و بعدين يعملها‬
‫‪ execute‬يزود القيم إللى فيها أو ينقصها ‪whatever‬‬
‫هيعمل إيه و يرجع تاني للـ‪ main memory‬عشان‬
‫يزود الـ‪ program counter‬بتاعي‪ .‬العملية دي ممكن‬
‫تأثر عليك في الـ‪.Programming Languages‬‬

‫‪Language Categorical‬‬
‫‪Hundreds of programming languages are in use...‬‬

‫?‪So many, how can we understand them all‬‬

‫إحنا عندنا لغات برمجة كتير أوي و كل لغة منهم عبارة عن مجموعة من الـ‪ paradigms‬و كل ‪ paradigm‬ليه ‪concepts‬‬
‫عايزين نعرفها‪.‬‬

‫‪9 Minders’22 AC‬‬


What is a paradigm?
• A programming paradigm is an approach to programming a computer based
on a coherent set of principles or a mathematical theory.
• A program is written to solve problems.
• Any realistic program needs to solve different kinds of problems.
• Each kind of problem needs its own paradigm.
• So, we need multiple paradigms, and we need to combine them in the same.
‫ يعني مجموعة من المفاهيم و‬set of principles or a mathematical theory ‫ هي‬paradigm ‫يبقى معنى كلمة‬
.‫النظريات الرياضية‬
sub ‫ واقعي بيحتاج لحل مشكلة و المشكلة دي لها‬program ‫ و أي‬.‫ هو خطوات مكتوبة لحل مشكلة ما‬program‫الـ‬
‫ كمان‬،‫ كتيرة‬paradigms‫ فبالتالي إحنا محتاجين لـ‬.‫ خاص بيه‬paradigm‫ فكل نوع من المشاكل دي بيحتاج لـ‬،problems
.‫ دول مع بعض عشان ندعم كل االختالف بين المشاكل دي‬paradigms‫محتاجين ندمج كل الـ‬

How can we study multiple paradigms?


How can we study multiple paradigms without studying multiple languages (since
most languages only support one, or sometimes two paradigms)?
multiple ‫ طيب إزاي هنذاكر‬،‫ واحد بس أو اتنين بالكتير أحيانًا‬paradigm ‫عرفنا إن في األغلب كل لغة برمجة بتدعم‬
‫ من غير ما نذاكر كذا لغة برمجة؟‬paradigms

Each language has its own syntax, its own semantics, its own system, and its own
quirks.
.‫ و نظامها العام الخاصين بيها‬semantics‫ و الـ‬syntax‫كل لغة برمجة ليها الـ‬

• We could pick three languages, like Java, Erlang, and Haskell, and structure
our course around them.
• This would make the course complicated for no good reason.
ً ‫ على سبيل المثال‬،‫ إللى عايز اتعلمها و أعرفها‬paradigms‫و بالتالي ماينفعش أقول إني هتعلم لغات البرمجة إللى بتدعم الـ‬
‫مثال‬
.Haskell ‫ و‬Erlang ‫ و‬Java ‫أقول أنا همسك تالت لغات برمجة أدرسهم و هما‬
paradigms‫ أركز على تعلم الـ‬+ ‫كدا الموضوع هيكون صعب عليا إني أتعلم لغات البرمجة و طريقة كتابة كل واحدة منهم‬
.‫الموجودة في كل لغة منهم و بالتالي الكورس هيكون معقد بالنسبالي‬

Our pragmatic solution: we use one language, Oz, a research language designed for
many paradigms.
• This lets us focus on the real issues.
‫ إللى محتاجين نتعلمهم و بكدا إحنا ركزنا على‬paradigms‫ دي بتدعم كل الـ‬OZ ‫عشان كدا هنستخدم لغة واحدة بس و اسمها‬
‫ المختلفة بدون ما نضطر نتعلم أكتر من لغة برمجة عشان نعرف‬paradigms‫تحقيق هدفنا األساسي و هو تعلم الـ‬
.‫ بتاعتهم‬paradigms‫الـ‬
‫ يعني مش بنشتغل بيها في مشاريع واقعية هي بس بتفيدنا عشان نتعلم‬business language ‫ دي مش لغة‬OZ language‫الـ‬
.‫ إللى محاجين نتعلمها‬paradigms‫ معينة و هي كل الـ‬concepts

10 Minders’22 AC
How can we combine paradigms in a program?
• Each paradigm is a different way of thinking.
o How can we combine different ways of thinking in one program?
• We can do it using the concept of a kernel language.
o Each paradigm has a simple core language, its kernel language, that
contains its essential concepts.
o Every practical language, even if it’s complicated, can be translated
easily into its kernel language.
o Even very different paradigms have kernel languages that have much
in common; often there is only one concept difference.
• We start with a simple kernel language that under lies our first paradigm;
functional programming.
o We then add concepts one by one to give the other paradigms.

‫ واحد؟‬program ‫ المختلفة دول مع بعض في‬paradigms‫ بين الـ‬combine‫طب إزاي إحنا هنقدر نـ‬
‫ فإزاي بردو نجمع بين أكتر من طريقة تفكير في‬paradigms‫ ليه طريقة تفكير مختلفة بتميزه عن غيره من الـ‬paradigm ‫كل‬
‫؟‬program‫نفس الـ‬
‫ كل‬،‫ كل لغة عن غيرها‬paradigm ‫ و بنعتبره كإنه الزتونة إللى بتميز‬kernel‫نقدر نعمل كدا عن طريقة حاجة اسمها الـ‬
.‫ خاص بيه‬kernel ‫ ليه‬paradigm
‫ يعني‬paradigms‫ لباقي الـ‬kernels‫ إللى على أساسه اتحطت باقي الـ‬main kernel‫ أو الـ‬base kernel‫ هو الـ‬kernel ‫عندنا‬
‫ و كل مرة هنزود حاجة جديدة عليه فهيكونولي‬functional paradigms‫ بتاع الـ‬kernel‫ دا هوالـ‬main kernel‫الـ‬
.‫ جديد خاص بيه و مختلف عن إللى قبله‬kernel‫ جديد بـ‬paradigm

Summary of the approach


Hundreds of languages are used in practice: we cannot study the mall in one course
or in one lifetime.
• Solution: focus on paradigms, since each language is based on a paradigm
and there are many fewer paradigms than languages.
‫ بس طبعًا مش هنقدر في كورس واحد‬practice‫ عندنا مئات اللغات ال ُمستخدمة في الـ‬:‫ملخص سريع لكل إللي قولناه فوق بقى‬
concepts ‫ و بالتالي هنركز أكتر على تعلم‬paradigm ‫نتعلم كذا لغة برمجة عشان نستشف منهم االختالفات بتاعة كل‬
.‫ و بالتالي دا هيوفر علينا وقت و مجهود‬paradigm ‫ نفسها بغض النظر عن اللغات الموجودة كتطبيق على كل‬paradigms‫الـ‬

One language per paradigm is too much to study in a course, since each language
is already complicated by itself.
• Solution: use one research language, Oz, that can express many paradigms.
‫ إللى بتدعم‬OZ ‫ دا هيكون كتير و معقد لتطبيقه في كورس واحد و بالتالي هنستخدم لغة‬paradigm ‫دراسة لغة برمجة لتعلم كل‬
.paradigms‫استخدام كل الـ‬

Realistic programs need to combine paradigms, but how can we do it since each
paradigm is a different way of thinking?

11 Minders’22 AC
• Solution: define paradigms using kernel languages, since different
paradigms have kernel languages with much in common.
• Kernel languages allow us to define many paradigms by focusing on their
differences, which is much more economical in time and effort.
‫ إللى محتاجه و بالتالي إزاي‬paradigm‫طيب كل برنامج عايزين ننفذه في أرض الواقع ليه طريقة تفكير مختلفة على حسب الـ‬
‫ و إللي بيميز‬paradigm ‫ الخاص بكل‬kernel language‫ دي في نفس البرنامج؟ عن طريق الـ‬paradigms‫هنجمع بين الـ‬
.‫ و بعضها‬paradigms‫االختالفات بين الـ‬

Let’s get started


• Probably you already know an object-oriented language.
o Object-oriented programming, with its coherent principles, is clearly
an important paradigm.
o But what about the other paradigms?
• Isn’t object-oriented programming by far the most important and useful
paradigm?
• Actually, no, it’s not!
• Many other paradigms are extremely useful, often more so than OOP! For
example, to make robust and efficient distributed programs on the
Internet, OOP just does not solve the right problems. Multi-agent dataflow
programming is much better.
• We will cover five paradigms that solve many problems.
‫ مهم بس هل دا معناه إنه‬OOP‫ الـ‬concept ‫ و قد إيه إن‬..‫ و إننا أكد اتعرضنا الستخدامها قبل كدا‬OOP‫طيب هنا بيتكلم عن الـ‬
.‫ و أكثر إفادة عنه‬OOP‫ تانية أهم من الـ‬concepts ‫ موجود؟ فعليًا ال فيه‬paradigm ‫أهم‬
system ‫ إنت هتعمل‬Developer‫ و دا بيرجع ليك كـ‬OOP‫؟ في منهم أهم من الـ‬paradigms‫طب إيه النظام بالنسبة لباقي الـ‬
ً ..‫ المناسبة أكتر لتنفيذه و تبدأ تستخدمها و هكذا‬paradigms‫عامل إزاي و بالتالي هتفكر إيه الـ‬
robust ‫فمثال لو عايزين نعمل‬
OOP ‫ مش‬dataflow ‫ نستخدمه هو‬concept ‫ فهيكون أنسب‬and efficient distributed programs on the Internet
،Multi agent dataflow‫ يعني متوزع أو بيقوم بيه أكتر من حد و بالتالي هيدعمه الـ‬distributed ‫عشان السيستم نفسه هو‬
.‫ و اشتغل بيها في البرنامج بتاعي‬dataflow‫فأروح أشوف إيه لغات البرمجة المعتمدة على الـ‬
.‫ و إللى هيساعدونا لحل مشاكل كتير‬5 paradigms ‫في الكورس بتاعنا دا هنتعلم‬

Paradigms
• Functional programming.
• Imperative programming.
• Object-oriented programming.
• Deterministic dataflow programming.
• Multi-agent dataflow programming.
• Active objects.
.‫ إللى هندرسها إن شاء هللا‬paradigms‫و دول الـ‬

12 Minders’22 AC
What we study?
• These are probably the most important programming paradigms for general
use.
o But there are many other paradigms, made for other problems: this
course give you a good foundation for studying them later if you wish.
‫ الموجودة و معرفة الفروقات بينهم دا هيخلي الكورس دا بداية‬paradigms‫طيب إحنا كدا عرفنا هندرس إيه و هو تعلم أهم الـ‬
.paradigms‫كويسة ألي حد عايز يكمل تعمق أكتر في دراسة و تعلم باقي الـ‬

Syllabus
• Introduction.
• Identifiers and environments Of Mozart Software.
• Functional programming.
o Variables Declaration.
o Recursion, loops, and invariant programming.
o Lists and pattern matching.
o Higher-order programming.
o Trees and Record.
o Kernel languages.
• Imperative programming.
• Object Oriented Programming.
• Deterministic Programming.
.‫و دا محتوي الكورس بتاعنا كله‬

Questions
• What is a paradigm?
"an approach for programming a computer based on a coherent set of
principles or a mathematical theory".
..‫ و وضحناه فوق قبل كدا‬paradigm‫دا تعريف الـ‬

• Why do we use Oz?


Oz is designed to support many paradigms.
..‫ في الكورس دا تحديدًا دونًا عن أي لغة تانية‬OZ‫بردو عرفنا فوق ليه بنستخدم لغة الـ‬

13 Minders’22 AC
‫‪Practical Exercise‬‬
‫‪declare‬‬
‫‪X=42‬‬
‫‪Z=~3‬‬
‫}‪{Browse X‬‬ ‫)‪% (a‬‬
‫الـ‪ output‬هنا هيكون ‪42‬‬

‫}‪{Browse Z‬‬
‫الـ‪ output‬هنا هيكون ‪~3‬‬

‫‪declare‬‬
‫‪Y=X+5‬‬
‫}‪{Browse Y‬‬ ‫)‪% (b‬‬
‫الـ‪ output‬هنا هيكون‪47‬‬

‫‪declare‬‬
‫‪X=1234567890‬‬
‫}‪{Browse X‬‬
‫الـ‪ output‬هنا هيكون ‪1234567890‬‬

‫شوية معلومات بسيطة لكتابة الـ‪ OZ‬هي إن بنعرف الـ‪ variables‬بـ‪ Capital letter‬يعني الزم أول حرف للمتغير يكون‬
‫‪ ،Capital‬تاني حاجة الزم ابدأ تعريف أي حاجة بكلمة ‪ declare‬في البداية‪ ،‬و لو عايزين نطبع بنكتب }‪( {Browse X‬و‬
‫الـ‪ Browse‬دي ‪ Method‬متعرفة و أنا بنادي عليها و دي طريقة الـ‪ Calling‬في الـ‪ )OZ language‬و بنعتبر إن الـ‪ X‬دا‬
‫‪ variable‬أنا عرفته قبل كدا‪ .‬و الزم الـ‪ variable‬يبدأ بحرف ‪ Capital‬زي ما عرفنا و لو بدأ بحرف ‪ small‬هيكون اسمه‬
‫‪ atom‬يعني الـ‪ OZ‬بتعتره كإنه ‪ String‬و دا عشان تقدر تفرق بين الـ‪ paradigms‬و بعضها‪.‬‬

‫‪14 Minders’22 AC‬‬

You might also like