The Stack Overflow podcast is back! Listen to an interview with our new CEO.
5

Focus on the idea that the sets can be finite. They don't need to be defined by a formula. Any set of ordered pairs is a relation. If there is a unique second element for any given first element then it is a function. For example, the set of pairs {(5,2), (5,4)} is not a function, since the value associated with 5 is not unique. This is a relation: a set of ...


4

Actually they are not the same thing at all. In mathematics a function consists of a univalent map between a domain and a range this is a subset of a cartesian product or just as you have described, a table. The continuous case is an extension to infinate domains and ranges, usually over the real numbers. Functions in computing do not always behave this way....


3

Talk about step functions. This might get the point across that functions do not need to be continuous. (I think going into lambda calculus would just confuse your students here - there's no need.) As for whether this is really a function - sure it is! To make it clearer, here's something you can do. The written numbers we have - '7', for instance - just ...


3

It seems to me that your students are asking for external validation: they want evidence that other people (the industry) value what you are teaching. For these students abstract claims such as "This will help you write better non functional code" or "you might need it in the future" usually do not suffice. Toy examples such as computing array/string length ...


3

I think the answer to that depends on how you're structuring the course overall, and what Kotlin brings to the teaching of those ideas. I know of three distinct approaches to an upper-division PL course: the "paradigms" curriculum (à la Sebesta's book), the "interperter/design space" curriculum (EOPL, Scott's "Programming Language Pragmatics", Louden, ...


3

What macro are, and how the work, changes from language to language. That said, they are very generally a way to reuse code, often by doing searches and replacements within the code before it gets compiled or interpreted. For example, in C and C++ you could type: #include <string> which is a macro asking for the entire contents of the file "string" ...


2

What I ended up doing (partly because I didn't have much prep time for me or the students) was using the class period to have pairs of students work together through Kotlin Koans. I walked around pointing out similarities to and differences from other languages we studied. The advantage of this approach was that students got to actively learn parts of the ...


2

Just free associating here, actually. The single session of 75 minutes is awfully short to actually have you do anything and then have the students learn anything. So.... First, flip the classroom for that session even if you don't generally. Give them a week (more or less???) to study Kotlin on their own, so that they have some sense about its syntax and ...


1

I guess I'm slightly confused about what your students are confused about. Did they somehow get tripped up by the definition of function? If so, I can't help but wonder what you did to cause that, because I've never encountered any sort of reaction to the term whatsoever. As others have addressed, your example is still a perfect set-to-set function. That ...


1

Out in the real world (and I use this phrase only because the question is about the criticism of functional programming being useless) a functional language that is used often is SQL. I have seen too many reasonable developers that are unable to grasp how to use SQL effectively because they can only think iteratively and not “functionally”. I have seen way ...


Only top voted, non community-wiki answers of a minimum length are eligible