14

This is a topic very close to my heart. I think that the skeptical attitude you've alluded to simply comes from the fact that most people were taught imperative programming first (and some were never exposed to any other paradigms at all). Turing's Machine was easier to conceive of as a physical, mechanical device than Church's $\lambda$, and it is ...


7

On the face of it, event-driven programming seems far easier to explain. "This code will run when the button is clicked" seems obvious, and similarly, visual environments that favour this technique seem relatively intuitive: It would seem obvious to explain that the code below that block runs when the sprite is clicked. Similarly, in Node.js, an event-...


7

Like any field with an active research community, Computer Science changes over the decades, sometimes quite drastically. If a practitioner doesn't keep up he or she will be left behind, not understanding the new work. Decades ago problems tended to be a bit smaller in scope. How do I sort an array? Now they are massive. How do I scale a cloud environment ...


6

It is true that these issues can be problematic in some cases, however, this depends on the context and the usage of the class. The "design problem" that you were hoping they would find also depends on the context and usage of the class. We have no idea whether the users of this class are obeying your JavaDoc. In fact, I could see an argument that your "...


5

I think this question is confusing "Computer Science" and "Software Engineering" / "Software Development" / "Programming". Computer Science has nothing to do with "cutting & pasting code". Type Theory is hotter today than it ever was, Type Systems can do more things than they ever could, Programming Language Theory is blooming, Compilers perform ...


5

The difference may be partially related to whether or not the student has a mental model of the machine (as in simple, possibly physically mechanical, computing hardware), rather than more abstract symbology (algebra). Changing the bits on a Turing machine tape, or the wheels on a Babbage engine, or the display of a pocket calculator, or the position of the ...


4

My worry here is that there is no general solution other than to improve any question when you reuse it based on the answers you saw in the past. I have to admit that, even as a very experienced Java developer who is also very Pattern literate, I missed it entirely since I didn't actually read the Javadoc before I looked at the code. I came up with only ...


4

I undertook this study myself about a year ago. I started working through the Programming Languages MOOCs on Coursera (Part A Part B Part C), which are based on a UW course of the same name. I didn't really know what I was getting into, but it sounded interesting. Before I knew it, I was learning a radically different approach to programming first with SML ...


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" ...


3

When I created my course for Scheme (under not dissimilar circumstances from yours), I used The Little Schemer as my primary source. The book itself rapidly became too dense for my HS students, so I designed my lessons around each chapter. My course, then, like the book, took the students slowly through a very foreign landscape. We took no effort to ...


3

This is a technical response, rather than a response of a teacher for beginner students. One of the big "aha" moments for me was understanding that they are the same thing. Under the covers, for a long time "event driven" systems were actually polling. There was a loop hidden in the framework that polled and dispatched the events. In the early days of ...


3

It almost entirely depends on the context of the function within the program and the program within its usage context. Here's my general approach: If only one event can happen at one time, especially if events are infrequent, use polling. This reduces the amount of function references needed when they would be unnecessary and also cuts down on the ...


3

Simple demonstration: Presenting this and asking, "What do you see?" is sure to get a variety of answers. Most might be along the line of a bird feeding baby birds. Not all will be, however. Possible answers include "A bunch of birds," "A birds' nest," "Tiny leaves," "A pretty picture," and even "A fuzzy background." None are wrong, and all will show what ...


3

I would break the question into parts. You can put a short paragraph describing what the code in front of them is supposed to do. When one (or more) writes code for something, the design is inseparable from the purpose of the code. Following the paragraph, put the code. Also, I suggest changing the documentation of the code by adding a short description ...


3

I taught a "Functional Programming" course on multiple occasions. It was basically a Haskell course. Phew, can't wait to teach it again. To answer you question precisely: you have no state, no classes and no usual OOP model. You have to abstract things much more than you are used. Oh, and there is this weird syntax. I mean--- uncurry f a b = f (a, b) But ...


2

Let me mention, at least, another dimension to this. There are various functional languages and some of them are closer to what your students may have in their backgrounds. A language with dynamic scope and abstract syntax is a very different beast from one with lexical scope and a rich syntax. The only functional language that I really worked at was ML ...


2

I think that both the question and the answers to date conflate two things that can be separated: imperative programming and programming with primitive data. These are not the same thing and thinking of them as one leads to some of the difficulties. Programs don't all have to be C-like programs from 1980. Using modern languages (java, python, ruby, scala......


2

The object-oriented and procedural, or imperative, paradigms, and the functional, logical and mathematical, or declarative, paradigms are just that "paradigms." They are the embodiment of thought patterns and methods for modeling solutions. So long as the end result of a paradigm, the language used to implement it, is Turing complete, and the associated ...


1

My earlier answer focused on overall program structure, not assignment and mutable state explicitly. The originator was focused otherwise, on assignment. One of the difficulties for beginners, I think, is that taking a Turing Machine view, or a program stack view, or a mail-box cubby hole view is that it isn't natural for students. Without criticizing that ...


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