<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Teaching Programming Ideas - Medium]]></title>
        <description><![CDATA[Ideas on how to teach programming topics - Medium]]></description>
        <link>https://medium.com/teaching-programming-ideas?source=rss----c4965caa0d2---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Teaching Programming Ideas - Medium</title>
            <link>https://medium.com/teaching-programming-ideas?source=rss----c4965caa0d2---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 19:18:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/teaching-programming-ideas" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Teaching Functions, Part 2]]></title>
            <link>https://medium.com/teaching-programming-ideas/teaching-functions-part-2-444e6945ef85?source=rss----c4965caa0d2---4</link>
            <guid isPermaLink="false">https://medium.com/p/444e6945ef85</guid>
            <category><![CDATA[teaching-programming]]></category>
            <dc:creator><![CDATA[Fabio Vinicius Binder]]></dc:creator>
            <pubDate>Wed, 10 Apr 2019 14:35:30 GMT</pubDate>
            <atom:updated>2019-04-10T18:16:12.368Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Disclaimer: this text contains spoilers of the movie Dr. Strange.</em></p><p>The next step on teaching functions is to teach how to create and use your own functions. In my Swift classes I teach functions before conditionals and loops, so the question is: what kind of functions a student may create with no knowledge about the fundamental concepts of programming?</p><p>One possible answer is: tell a story! How? Two aspects of functions may be adressed by telling a story: organization and reuse (avoid repetition). The first one is easy, since stories have parts or chapters. And there are some good stories with parts that are repeated, so there you are, a story can be used as the starting point of understanding functions.</p><p>What about the end of Dr. Strange&#39;s movie? Several events are repeated: the death and a few phrases like &quot;Dormammu&quot;, &quot;I came to bargain&quot;, etc. We can create a function for each of these events, each function representing a part of the story that can be called to tell the story:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*6w1_UKKG7-N4_7iRig4SDQ.png" /><figcaption>Each event of the story can be created as a simple function that prints a text</figcaption></figure><p>All those calls can be put together in a new function to perform the entire scene:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*1ki5nAiJznVOrvcHjTO_Nw.png" /><figcaption>A scene from Dr. Strange&#39;s movie</figcaption></figure><p>And of course, it may be called more than once like the movie:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*pDtHvJUNwTr10oK6hgDOZQ.png" /><figcaption>As in the movie, our scene is called more than once.</figcaption></figure><p>Resulting in the following output to the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*JxYGPEseij9Ee6ajvZotaA.png" /><figcaption>The final result of our little story.</figcaption></figure><p>At the end of the class the students can be challenged to create their own stories. In my classes I gave them a suggestion: tell a story about a day in the life of a Hobbit. This theme has the benefit of having several repetitions, since Hobbits eat at least 7 times a day: breakfast, second breakfast, elevenses, lunch, afternoon tea, dinner, supper.</p><p>A story as a function may be used in the next programming classes: the student can insert elements with ifs, loops, arrays and any other topic of the course&#39;s syllabus.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=444e6945ef85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/teaching-programming-ideas/teaching-functions-part-2-444e6945ef85">Teaching Functions, Part 2</a> was originally published in <a href="https://medium.com/teaching-programming-ideas">Teaching Programming Ideas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Teaching Functions]]></title>
            <link>https://medium.com/teaching-programming-ideas/teaching-functions-87b1573a849a?source=rss----c4965caa0d2---4</link>
            <guid isPermaLink="false">https://medium.com/p/87b1573a849a</guid>
            <category><![CDATA[teaching-programming]]></category>
            <dc:creator><![CDATA[Fabio Vinicius Binder]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 13:24:14 GMT</pubDate>
            <atom:updated>2019-04-08T13:24:14.223Z</atom:updated>
            <content:encoded><![CDATA[<p>Functions are somewhat like daily activities, they have names and a set of instructions that define them, like brush your teeth, cook a meal, etc. When we need to talk about such activities we only use their names because it is easier than repeating all the instructions every time. Everyone knows about this process, it is a great common ground to start talking about functions to new programming learners.</p><p>The swift language has a lot of functions, so it is a good idea to begin to teach this subject by showing the students some useful functions in order to motivate and give them food for thought. Functions are taught after variables, constants, and operations so the students already have some basic understanding of numbers, booleans, and strings. Of course, a teacher may resort to math functions because every student knows about them, but I think there are other useful functions that may be more interesting to the students.</p><p>How about using something very popular among students, like memes? For instance, take the young guy (Aaron Bailey) that makes a really funny face:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*LVg-xs-GjKQXdHIPF3-OHQ.jpeg" /></figure><p>In Brazil there is a popular meme related to this image that mocks someone by repeating what was said (usually something annoying) but changing every vowel with an “i”, for instance: “It’s always in the last place you look” would became “It’s ilwiys in thi list plici yii liik”. So, why not teach the students to make a generator for this meme? It does not involve conditionals or loops, only variables and a function, like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38WCukfaP7HobU9TwXk6Aw.png" /></figure><p>Of course there are some caveats, like the student not understanding the sintax: object dot function. But I don’t consider it a critical problem because the exact meaning is not imporant right here, the teacher may explain it intuitively now and only give the exact meaning when the time is right, usually in the classes and objects topic.</p><p>In the next post I will talk about an idea to explain the creation of your own functions to tell a story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87b1573a849a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/teaching-programming-ideas/teaching-functions-87b1573a849a">Teaching Functions</a> was originally published in <a href="https://medium.com/teaching-programming-ideas">Teaching Programming Ideas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>