diff options
Diffstat (limited to 'reveal.js/python-oo.html')
| -rw-r--r-- | reveal.js/python-oo.html | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/reveal.js/python-oo.html b/reveal.js/python-oo.html deleted file mode 100644 index 5279993..0000000 --- a/reveal.js/python-oo.html +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | <!doctype html> | ||
| 2 | <html lang="en"> | ||
| 3 | <head> | ||
| 4 | <meta charset="utf-8"> | ||
| 5 | <title>Object-oriented programming in Python</title> | ||
| 6 | <meta name="author" content="Simeon Simeonov"> | ||
| 7 | <meta name="apple-mobile-web-app-capable" content="yes"> | ||
| 8 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> | ||
| 9 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="dist/reset.css"> | ||
| 12 | <link rel="stylesheet" href="dist/reveal.css"> | ||
| 13 | |||
| 14 | <link rel="stylesheet" href="dist/theme/statnett.css" id="theme"> | ||
| 15 | |||
| 16 | <!-- Theme used for syntax highlighting of code --> | ||
| 17 | <link rel="stylesheet" href="plugin/highlight/monokai.css" id="highlight-theme"> | ||
| 18 | <!-- <link rel="stylesheet" href="plugin/highlight/zenburn.css" id="highlight-theme"> --> | ||
| 19 | </head> | ||
| 20 | <body> | ||
| 21 | <div class="reveal"> | ||
| 22 | |||
| 23 | <!-- Any section element inside of this container is displayed as a slide --> | ||
| 24 | <div class="slides"> | ||
| 25 | |||
| 26 | <section> | ||
| 27 | <h2>Object-oriented programming in Python</h2> | ||
| 28 | <h4>Data Engineering @ Statnett</h4> | ||
| 29 | </br> | ||
| 30 | <p><small>Simeon Simeonov</small></p> | ||
| 31 | </section> | ||
| 32 | |||
| 33 | <section> | ||
| 34 | <h2>Goals</h2> | ||
| 35 | </br> | ||
| 36 | <ul> | ||
| 37 | <li><p>Present the Python programming language in a different way than <a href="https://docs.python.org">https://docs.python.org</a></p></li> | ||
| 38 | <li><p>Avoid information overload</p></li> | ||
| 39 | <li><p>Use examples and interaction rather than documents and slides</p></li> | ||
| 40 | </ul> | ||
| 41 | </section> | ||
| 42 | |||
| 43 | <section> | ||
| 44 | <h2>Preliminary plan</h2> | ||
| 45 | </br> | ||
| 46 | <ul> | ||
| 47 | <li><p>Basics: About the language, the Python eco-system, types, modules, functions, scopes, decorators, string formatting</p></li> | ||
| 48 | <li><p><b>Object-oriented programming in Python: How Python "really works"</b></p></li> | ||
| 49 | <li><p>Control flow: if / for / while / try, iterators, "tactical programming" tips</p></li> | ||
| 50 | <li><p>A brief tour through Python's standard library</p></li> | ||
| 51 | <li><p>Code design and best practices: How to design your code</p></li> | ||
| 52 | </ul> | ||
| 53 | </section> | ||
| 54 | |||
| 55 | <section> | ||
| 56 | <h2>What is object-oriented programming?</h2> | ||
| 57 | </br> | ||
| 58 | <p>Object-oriented programming does <b>not</b> mean using an object-oriented programming language.</p> | ||
| 59 | <p>It is rather a programming paradigm based on the concept of <em>object</em>, as well as on some general principles and best practices aiming at:</p> | ||
| 60 | <ul> | ||
| 61 | <li><p>improving readability</p></li> | ||
| 62 | <li><p>improving re-usability</p></li> | ||
| 63 | <li><p>improving modularity</p></li> | ||
| 64 | <li><p>providing foundation for a more intuitive design</p></li> | ||
| 65 | </ul> | ||
| 66 | </section> | ||
| 67 | |||
| 68 | <section> | ||
| 69 | <h2>General principles</h2> | ||
| 70 | </br> | ||
| 71 | <p>The following four concepts / principles are presented in most object-oriented programming books:</p> | ||
| 72 | <ul> | ||
| 73 | <li><p>separate and hide "private" details from the outside world and / or child (inheriting) functionality (encapsulation)</p></li> | ||
| 74 | <li><p>separate the interface from its implementation (abstraction)</p></li> | ||
| 75 | <li><p>inherit and extend / adapt existing functionality, through "is-a" relationship hierarchy (inheritance)</p></li> | ||
| 76 | <li><p>execute different code / functionality based on the object's place in the hierarchy (polymorphism)</p></li> | ||
| 77 | </ul> | ||
| 78 | </section> | ||
| 79 | |||
| 80 | <section> | ||
| 81 | <h2>Building blocks and definitions</h2> | ||
| 82 | </br> | ||
| 83 | <p><b>Note:</b> "Lacking universally accepted terminology to talk about classes, I will make occasional use of Smalltalk and C++ terms." - The Python tutorial (https://docs.python.org)</p> | ||
| 84 | <p>When talking about object-oriented programming, the following building blocks are involved:</p> | ||
| 85 | <ul> | ||
| 86 | <li><p>class - a blueprint / template for creating objects</p></li> | ||
| 87 | <li><p>object - an instance of a class that may contain its own attributes as well as references to its class' attributes</p></li> | ||
| 88 | <li><p>attribute - variable, property, function defined in the class and present in its instances</p></li> | ||
| 89 | <li><p>class variable - attribute of which a single copy exists, regardless of how many instances of the class exist</p></li> | ||
| 90 | <li><p>object / instance variable - attribute for which each instantiated object of the class has a separate copy, or instance</p></li> | ||
| 91 | <li><p>method - member function - function that is an attribute</p></li> | ||
| 92 | </ul> | ||
| 93 | </section> | ||
| 94 | |||
| 95 | <section> | ||
| 96 | <h2>The object-oriented world of Python</h2> | ||
| 97 | </br> | ||
| 98 | <p>Some additional concepts and definitions are introduced in Python, as well as in some other programming languages:</p> | ||
| 99 | <ul> | ||
| 100 | <li><p>metaclass - a class whose instances are classes</p></li> | ||
| 101 | <li><p>property - attribute that provides a flexible mechanism to read, write, or compute the value of a "private" attribute</p></li> | ||
| 102 | <li><p>type - old C object-oriented term, now (in Python 3) considered to be the same as class</p></li> | ||
| 103 | </ul> | ||
| 104 | <p> As is true for modules, classes partake of the dynamic nature of Python: they are created at runtime, and can be modified further after creation.</p> | ||
| 105 | </section> | ||
| 106 | |||
| 107 | <section> | ||
| 108 | <h2>The object-oriented world of Python (cont...)</h2> | ||
| 109 | </br> | ||
| 110 | <p>The < </p> | ||
| 111 | <ul> | ||
| 112 | <li><p>metaclass - a class whose instances are classes</p></li> | ||
| 113 | <li><p>property - attribute that provides a flexible mechanism to read, write, or compute the value of a "private" attribute</p></li> | ||
| 114 | <li><p>type - old C object-oriented term, now (in Python 3) considered to be the same as class</p></li> | ||
| 115 | </ul> | ||
| 116 | </section> | ||
| 117 | |||
| 118 | </div> | ||
| 119 | </div> | ||
| 120 | |||
| 121 | <script src="dist/reveal.js"></script> | ||
| 122 | <script src="plugin/zoom/zoom.js"></script> | ||
| 123 | <script src="plugin/notes/notes.js"></script> | ||
| 124 | <script src="plugin/search/search.js"></script> | ||
| 125 | <script src="plugin/markdown/markdown.js"></script> | ||
| 126 | <script src="plugin/highlight/highlight.js"></script> | ||
| 127 | <script> | ||
| 128 | |||
| 129 | // Also available as an ES module, see: | ||
| 130 | // https://revealjs.netlify.app/initialization/ | ||
| 131 | Reveal.initialize({ | ||
| 132 | controls: true, | ||
| 133 | progress: true, | ||
| 134 | center: true, | ||
| 135 | hash: true, | ||
| 136 | |||
| 137 | // Learn about plugins: https://revealjs.netlify.app/plugins/ | ||
| 138 | plugins: [ RevealZoom, RevealNotes, RevealSearch, RevealMarkdown, RevealHighlight ] | ||
| 139 | }); | ||
| 140 | Reveal.configure({ pdfSeparateFragments: false }); | ||
| 141 | |||
| 142 | </script> | ||
| 143 | |||
| 144 | </body> | ||
| 145 | </html> | ||
