Programming Paradigms Seminar 1

3,826 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,826
On SlideShare
0
From Embeds
0
Number of Embeds
168
Actions
Shares
0
Downloads
233
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Programming Paradigms Seminar 1

  1. 1. Seminar 1 : The bird’s eye view<br />The Paradigms<br />Programming Paradigms<br />
  2. 2. Outline<br />Programming Paradigms<br />4 Main Programming Paradigms<br />Learning Objective<br />Plans<br />2<br />
  3. 3. Solution:<br />Find info from books <br />Paradigm A<br />Problem:<br />Assignment<br />Solution:<br />Copy from classmates<br />Paradigm B<br />Paradigm - Student<br />
  4. 4. Paradigm – The Dancer<br /> 664<br />X 5<br />RIGHT BRAIN<br />(clockwise)<br />Intuitive<br />Images<br />Non-linear<br />Big picture<br />abstract<br />LEFT BRAIN<br />(counter –clockwise)<br />Analytical<br />Numbers<br />Linear<br />Details<br />Concrete<br />
  5. 5. A programming paradigm is a framework that define how the user conceptualized and interpret complex problems. <br />Paradigm A<br />Solution:<br />A<br />Problem:<br />Create a calculator program <br />Solution:<br />B<br />Paradigm B<br />Programming Paradigm<br />
  6. 6. Paradigms VsLanguages<br />Programming Paradigm: <br />A programming paradigm is an approach to programming a computer based on a mathematical theory or a coherent set of principles.<br />Programming language:<br />A programming language is a tool for developing executable models for a class of problem domains.<br />6<br />In general, programming paradigms influence language design.<br />
  7. 7. Why Programming Paradigm?<br />7<br />Model 1<br />Model 2<br />Problems<br />Paradigm A<br />Model 3<br />Model 4<br />
  8. 8. Overview of 4 Programming Paradigms<br />8<br />
  9. 9. <ul><li>View everything as an “object”
  10. 10. Key characteristic of OO
  11. 11. Data Abstraction
  12. 12. Encapsulation
  13. 13. Polymorphism
  14. 14. Inheritance
  15. 15. Best for problems with a large number of related data abstractions organized in a hierarchy</li></ul>Object-Oriented Paradigm<br />9<br />Human<br />“Alice”<br />Name:<br />Gender:<br />Size:<br />Eue _colour:<br />Shopping()<br />Animal<br />Building<br />“Bob”<br />
  16. 16. Object-Oriented Paradigm<br />Question:<br />Is Object-Oriented the best paradigm for solving every problems?<br />If so, there wouldn’t be a need for other paradigm…<br />calSal()<br />Find the payroll of the salaries for all the employee in the company<br />Employee 1<br />getSal()<br />return amt1<br />Company <br />sumAll()<br />calSal()<br />getSal()<br />Overheads!!<br />return amt1<br />Employee 10000<br />
  17. 17. Imperative Paradigm <br />11<br />Analogy:<br />Cooking a cup noodles<br />Order of Commands is Important!!<br /><ul><li>View everything as </li></ul> “a sequence of steps to perform”<br /><ul><li>Characterized By
  18. 18. Procedures
  19. 19. Functions
  20. 20. Abstract Data Types (ADTs)
  21. 21. Best for expressing algorithms and the most common paradigm in use today</li></li></ul><li>Functional Paradigm<br />12<br />Resulting Value<br />An Expression<br />Another Expression<br />Used By<br />Evaluates<br />Evaluates<br /><ul><li>View everything as “functions”
  22. 22. Characterized by
  23. 23. Single Assignment
  24. 24. Referentially Transparent
  25. 25. Compositionality
  26. 26. Higher Order Function
  27. 27. Best for abstracting and reducing complexity in programming task with noside effects</li></li></ul><li>Logic Paradigm<br />13<br />Object-Oriented<br />Imperative<br />Functional<br />Logic<br />Automated<br />Search<br />List all programming paradigms<br />Answer a question via search for a solution<br /><ul><li>View everything as “Predicate Calculus”
  28. 28. Characterized by
  29. 29. Axioms
  30. 30. Facts
  31. 31. Inference rules
  32. 32. Queries
  33. 33. Best for solving problems in artificial intelligence such as medical diagnosis, fault finding in equipment and robot control</li></li></ul><li>Learning Objective<br /><ul><li>Each paradigm has its place
  34. 34. Learning different paradigms allow us to
  35. 35. Identify suitable paradigms for a given complex problem
  36. 36. Decide the most suitable language to implement
  37. 37. Reason for focusing on paradigms
  38. 38. Increasing number of programming languages implementing similar paradigms exists
  39. 39. 27 paradigms in total but some are in similar concept
  40. 40. Studying the 4 distinct basic paradigms allow us to easily pick up any programming languages on our own!</li></ul>14<br />
  41. 41. 15<br />
  42. 42. Plans<br />Research [S2]<br />Paradigms<br />Advantages & Disadvantages<br />Case Studies / Examples<br />Project [S3 / S4]<br />Conclusion [S4]<br />Summary and reflections<br />16<br />
  43. 43. 17<br />Summary<br />
  44. 44. Thank you!<br />End of Presentation<br />
  45. 45. 19<br />WAIT! <br />Please help us to help you!<br />3-5 min survey<br />

×