======Object Oriented Programming - Lectures 2018/2019====== This page contains materials for the first half of lectures for [[https://is.cuni.cz/studium/rozvrhng/roz_predmet_macro.php?tid=2&skr=2018&sem=1&ustav=32-KSVI&predmet=NMIN201&fak=11320|Object Oriented Programming (NMIN201)]] course that is being/has been taught during winter semester 2018/2019 at [[http://www.mff.cuni.cz/|Charles University]] in [[http://www.praha.eu/jnp/cz/home/magistrat/index.html|Prague]], Czech Republic. The first half will be dedicated to C language and we will tenderly touch C++. These lectures will be given by me ([[http://gamedev.cuni.cz/contacts/|Jakub Gemrot]]). Slides we will be using are based and/or were completely created by Martin Pergel. The second half of lectures (about C# language) will be led by Martin Pergel. Permalink: [[http://bit.ly/mff-uk-oop-lecture-2018]] History: [[http://bit.ly/mff-uk-oop-lecture-2017|http://bit.ly/mff-uk-oop-lecture-2017]], [[http://bit.ly/mff-uk-oop-lecture-2016|http://bit.ly/mff-uk-oop-lecture-2016]] ------------------------------- ======Dates====== Tuesday's lecture, 17:20, [[hhttps://is.cuni.cz/studium/rozvrhng/roz_ucebna_macro.php?tid=2&skr=2018&sem=1&fak=11320&ucebna=K4|K4]]. You can contact me at any time: [[mailto:jakub.gemrot@gmail.com|jakub.gemrot@gmail.com]] ------------------------------- ======Lectures====== =====L05 - 30.10.2018===== **Topci: Introduction to C++ Part 1** Tip: * If you want to get kickstarted into the flame war between Object Oriented Programming vs. Functional Programming slightly (a considerable deal of) biased towards OOP in a way that is hard to follow, but that does not matter as the *h*t is real, read this edit on [[https://www.quora.com/What-does-object-oriented-programming-do-better-than-functional-programming-and-why-is-it-the-most-popular-paradigm-when-everybody-seems-to-say-functional-programming-is-superior|Quora]] Details: * First, we start what might seem bad at pure-C * Then, we detail how that might be addressed using OOP and therefore C++ * Hopefully, it gives us enough ammunition to deal with con/destructors, methods, overloading, composition and inheritance Slides * [[https://drive.google.com/open?id=0B49ID9s3-zhTRGFoLXliOXM5cDg|PDF 4]] (courtesy of Martin Pergel) =====L04 - 23.10.2018===== **Topic: Introduction to C Part 4** Details: * Preprocessor * Enums * We have started with C++! But I forgot to show you unions from C, I will start with them next week. Slides: * [[https://drive.google.com/open?id=0B49ID9s3-zhTRmFpZERfY2dRN00|PDF 3]] (courtesy of Martin Pergel) * the rest of the slides VS2017 Solution from the lecture: * [[https://drive.google.com/open?id=1kS8W86D8JC6XHkikOSto4sX5dajhNicm|Solution L04]] =====L03 - 16.10.2018===== **Topic: Introduction to C Part 3** Details: * Struct, typedefs, linked list, custom "safe string" * Files Slides: * [[https://drive.google.com/open?id=0B49ID9s3-zhTRmFpZERfY2dRN00|PDF 3]] (courtesy of Martin Pergel) * a few first slides * [[https://drive.google.com/open?id=0B49ID9s3-zhTNzRNSEpnSGtxejA|PDF 2]] (courtesy of Martin Pergel) * slides 19+ VS2017 Solution from the lecture: * [[https://drive.google.com/open?id=1HRUzWtuzxVgA9XND0lKtcyrDAMSnCo-f|Solution L03]] =====L02 - 09.10.2018===== **Topic: Introduction to C Part 2** Details: * We discussed pointer, arrays, dynamic allocation * Struct, typedefs, linked list Slides: * [[https://drive.google.com/open?id=0B49ID9s3-zhTMFlSR09jV1dCLWM|PDF 1]] (courtesy of Martin Pergel) * slides 34-39 * [[https://drive.google.com/open?id=0B49ID9s3-zhTNzRNSEpnSGtxejA|PDF 2]] (courtesy of Martin Pergel) * slides 01-18 VS2017 Solution from the lecture: * [[https://drive.google.com/open?id=1cR7OOMvjaWB7ixa3nkg294zMzJ2P0XtY|Solution L02]] =====L01 - 2.10.2018===== **Topic: Introduction to C Part 1** Details: * History of language C, Pascal vs. C (types, comments, procedures and functions, operators, return) Slides: [[https://drive.google.com/open?id=0B49ID9s3-zhTMFlSR09jV1dCLWM|PDF 1]] (courtesy of Martin Pergel) * History of language C, Pascal vs. C (types, comments, procedures and functions, operators, return), if, for, while, switch * We briefly touched the topic of pointers, arrays and "strings" VS2017 Solution from the lecture: * [[https://drive.google.com/open?id=1eZO-j0gAqHe8g6GOhDit4EdxEN94ux0r|Solution L01]] Useful: * [[http://www.cs.gordon.edu/courses/cs320/handouts/C_C++_Syntax_vs_Pascal.html|Comparison of syntax Pascal vs. C/C++]] * Turned into handouts that compare Pascal and (ANSI) C syntax * [[https://drive.google.com/open?id=0B49ID9s3-zhTNTFPX0RNVVRZU2M|Handout 1]] - Constants, Variables, Types, Pointers * [[https://drive.google.com/open?id=0B49ID9s3-zhTeF85akFJcGtISmM|Handout 2]] - Procedures, Functions, Program * [[https://drive.google.com/open?id=0B49ID9s3-zhTMFVVRWpmRExWaEk|Handout 3]] - Operators and Expressions * [[https://drive.google.com/open?id=0B49ID9s3-zhTRUJINnl5VVA2Vms|Handout 4]] - Executables and Statements * [[https://www.programiz.com/c-programming/examples|Very simple C programs]] containing their in-depth explanations * [[https://3.bp.blogspot.com/-HSQTjkw0djk/WcpnMonIX9I/AAAAAAAAAXY/oxbpvKw8mXkKvuGJxBpSVxherKEy37pSACLcBGAs/w1200-h630-p-k-no-nu/ASCII-Table.png|ASCII Table]]