9 ms·
How We Teach Programming, and Where We're Going Wrong
- conceit 11y agoSo, don't just learn to code, learn to solve problems? Well, duh. There's at least two sides to this. CS comes down to code and it's a prerequisite to computational problem solving, most of the time. Problem solving OTOH is like language, it's expected to be learned by doing. Code is the simpler, formalized of the two topics. I'd rather have not every step of development guided by institution, just in case the methods are maybe just a little bit flawed. Maybe, just in case. Arguably, learning problem solving is a problem to be solved, so it seems almost impossible to teach, anyway.
- anta40 11y ago>> While I enjoy tackling these exercises (and have devoted my academic career to doing so), most people don't, further raising the barrier for learning to code. My formal background is computer science, so somehow I can resonate with the author. My 1st programming language is C, though, not Scheme/Lisp. Damn I hate messing with pointers :D So, what is the best (most feasible) way to teach non-CS folks to program, then?
- s986s 11y agoI would argue some important concepts to understand are. - programming is commanding a machine to do what they want. - computers speak a non-english language so everything they write is translated before the machine follows it - a machine is only limited to its hardware. You cannot save without a harddrive, you cannot communicate without an antenna of somesort. Instructing a machine can come in a variety of forms - Robotics - commands reinterpreted into physical movement - User Experience - commands reinterpreted to produce graphics or sound - Logical - Encoding and decoding, list management and prediction, mapping commands to actions, language grammer If anyone disagrees or has more to add, let me know
- geocar 11y agoI observe that programmers must be understood: If they can program, they can make the computer do what they want, at least some of the time. If they are good at programming, they will do this quickly, and in a way that the computer does not have to do any (or many) unnecessary steps. However I also observe a programmer must understand: If they can program, they can understand the computer, at least in some circumstances and at some level. If they are good at programming, they will also be good at understanding others. I believe mathematics teaches people to understand by helping them recognise when they do not yet understand. To know when you have convinced someone, and yourself have been convinced, is clearly not exclusive to mathematics: Writers, artists, lawyers and lobbyists, all specifically develop these two kinds of understanding, and it is this line of thinking I am currently exploring.
- s986s 11y agoI appreciate this sentiment. Correct me if Im wrong but you are implying, if an individual understands how to command something or do a task, they have a realization of how the bigger picture works to some extent. I agree with this from a personal perspective. Are you interviewing individuals/doing this scientifically or is this a personal theory you test when given the opportunity?
- geocar 11y ago> Correct me if Im wrong but you are implying, if an individual understands how to command something or do a task, they have a realization of how the bigger picture works to some extent. No: I am not trying to say someone knows how to program if they can program. In fact, I suspect strongly the opposite: Most people who can program do not have any idea how they program, let alone how to program. I am saying there are at least two essential skills which are "programming", and not just the one you brought up. There are more: One must also have a command of the grammar and syntax, but I find that despite how much time people spend on it, this speaks more about how complex languages are, than it does about programming[1], and so I did not bring it up. [1]: https://news.ycombinator.com/item?id=9122299 https://news.ycombinator.com/item?id=9122299 > Are you interviewing individuals/doing this scientifically or is this a personal theory you test when given the opportunity? I'm a professional and not an academic, and yet a big part of my role is to grow programmers, so it's a little more than a personal theory, but a lot less than a study.
- douche 11y agoGames, and game modding, seems to be the most accessible and most successful gateway drug to programming. Games that have decent mod support can offer a natural skill progression, without overwhelming all at once. Start by tweaking some data; move on to basic scripting. Eventually, you start to chafe against the limitations of the game's modding abilities, and want to start building your own thing. This whole process is grounded in something real, and something that is more fun than crunching numbers or building a fake CRUD app. I'm curious about the spate of games that directly incorporate programming. Maybe they have been more effective than I think, but for the most part, they just aren't really that fun, IMHO. They lean too hard towards the edu, and not enough toward the tainment... Particularly in comparison to, say, building a custom StarCraft map with triggers and conditions or a Quake level, that you can go play with your friends after.
- s986s 11y agoI grew up making starvraft maps and warcraft 3 maps. Allowed me to believe in myself and grow a thick skin
- bluejellybean 11y agoI'll second games being a great gateway drug. My first introduction to programming was game development. Around early 2007, Bungie ( the game studio that made Halo ) released a bunch of devcasts in which a handful of the developers would all sit around, shoot the shit, and talk about building the game. I naturally thought it was awesome and looked for tutorials on Youtube. Unfortunately I didn't stick with it due to the steep learning curve and decided software development was too hard ( If only I had a mentor/teacher at the time ). A few years later though my friend and I wanted to bot the game Runescape to make some money. The most ban-proof way at the time was to use this program called Simba and you wrote scripts with a pasacal-like language. Everything was based on the pixel color of something and most of the bots were simple procedural programs. Due to the simple nature of the scripts, you could easily write something without a ton of prerequisite knowledge and see if it worked or not. The biggest problem with this method was color and object detection, how do you know if what you're clicking on is a tree or some grass? At the time, the hotshots in the community were mostly people enrolled in cs programs and building neat algorithms to detect stuff. The only way to compete with them was to learn the fundamentals of cs. so of course that's exactly what I did! Gaming provides a fantastic playground for learning because it's fun and there are very clear rewards for learning more ( Learn matrix manipulation, get better object detection, make more gold ). I think teachers would do well by getting games into the classroom. They really do open the imagination when paired with programming.
- geocar 11y agoI'm not convinced computer science curriculums are teaching even "CS-folks" to code; I have observed people come to university already knowing how to code, or possessing whatever it is that allows them to code.
- CryoLogic 11y agoI just got a phone call from a friend in his last quarter at a top 10 uni last night - he was stressed out because his research group hadn't actually written any code yet. It was all copy pasted from other projects. They ran into some issues, and have no idea how the code base works and can't fix it. I think (on my experience) schools teach you syntax, and lots of history. Not much application.
- conceit 11y ago> what is the best (most feasible) way to teach non-CS folks to program Teach them CS first. Start with the history. Make a connection from maths to CS - Logic. Show that representation is meaning. The Code is only an abstraction but it is the only way to communicate the abstract ideas, never mind there's different forms of code. Try to code to understand complexity, that the complexity is the reason that "Programming" is bigger than school. I don't mean run-time complexity, but that is an important bit. The code is just one of the real-world applications of programming, it's secondary to problem solving, but useful enough at that. It's well enough defined in the mathematical sense to be taught as a formally structured, rigorous generality (Theory). It's highly developed and abstract enough to go a long way with intuition applied to immediate problems (Practice). Recurse, apply code to code. Dont' forget the disciplined mantras: RTFM, KISS DRY ... Preferably it shouldn't even be a single class. Just like everyone has to learn about numbers, matter, elements or cells, it should be important to teach logic as the very basis on the search for boolean truth. Tie in self modifying code with evolution. Instead of just introducing calculators in math, introduce python, Matlab, R, all of them at appropriate times. As a prime example of applied CS that's relevant to about any teenager with a smartphone, explain the graph theory that they are the data in. It all depends on the children being on an appropriate level already when they enter elementary school. That depends on the knowledge of the previous generation. Therefore it's a slow progress, that picks up every iteration. There generally isn't a one size fits all program to teach programming, it depends on individual parameters. The ideal OTOH is very narrow minded and far from optimal, given many more pressing needs. Biology is booming, isn't it? Should we ask the same question in Bio, how to teach non-Bio folks to do research? It's coming along, the only hindrence I see is dangerous half knowledge and knowing to much.
- douche 11y agoThis is going to be so mind-numbingly boring for most people that they will check out completely. If you make programming a math class, people will hate it just the same way they hate math.
- conceit 11y agoIntegrating programming in maths class would improve the maths class experience. So, pupils would love programming all the more for it.
- hotcool 11y agoSo, don't just learn to code, learn to solve problems? Well, duh. Maybe that's not such an obvious point. I'm learning Javascript and php strictly to build new things. Solving problems and streamlining processes for other people was never a motivation in learning.
- conceit 11y agoIt's like saying, don't just teach the syntax, teach the semantics. It's rather obvious. The two can't be separated, because they are the same thing from two different perspectives.
- hotcool 11y agoYour comment doesn't make any sense. Syntax and semantics aren't the same thing. That is like saying freeway and tunnel are the same thing from a different perspective.
- conceit 11y agoAt least in programming, syntax is structure. A structure can have substructures. If the whole structure has a different meaning than each substructure on its own, then syntax has meaning. Vise-versa, how could you tell the structure of something that doesn't have any meaning to you? How do you know the meaning of a word without knowing the grammar and context? The context is the perspective. I didn't come up with syntax semantics duality myself and I can't really explain it, because it's actually rather mathematical.
- deleted 11y ago[deleted]
- stepvhen 11y agoI was hoping for a much more in depth post after reading the title. It doesn't really go into much detail past an anecdote.
- mch82 11y agoThe article doesn't scan well, but the main ideas I got from it were that (1) the general population has different needs than people who intend to make a career in software, and (2) adapting the delivery and content of general programming education to address those needs may improve the accessibility and learning experience for non-career programmers. I agree with you that I'd hoped for more depth to backup the title.
- mch82 11y agoOne of the big gaps in programming education is the relative lack of material on how to find, comprehend, and use code written by others. Most "Learn language X" references assume the programmer is starting from scratch. Yet as I explore programming farther I'm increasingly understanding the value of learning about applications, libraries, and frameworks written by others. To use human language education as an analogy, syntax, reserve words, and grammar are the equivalent of grade school topics in programming. We need more high school style tutorials that survey, critique, and teach the style of code written by top programmers.
- s986s 11y agoI would argue we need more analysis tools for testing. Top programmers arguably just work the hardest, test the most and often focus on speed over readability. Being able to test something is much better imo - grade school - list manipulation, loops, strings and if statements - middle school - servers and clients, oop, types and validation - high school - parsing, streams, byte code and efficiency
- dclowd9901 11y agoI was surprised to see a lack of emphasis in this post on philosophical education, which has a great emphasis on logic. To me, it is a keystone of programming.
- conceit 11y agoPhilosophy is the keystone to any knowledge, by the claim of the name.
- 20years 11y agoI agree with this. I personally think you need to have really good critical thinking skills in order to be half decent at programming. The education system is failing with teaching critical thinking. I would love to see more focus on teaching critical thinking at a young age, which would give kids the tools needed to be a good programmer and problem solver.
- justifier 11y agohello world is outdated i think this alone probably turns away the majority of would be computationally literate individuals as i was being taught programming i was so ridiculously underwhelmed by a program writing out hello world here i am on this machine that can play my favourite movie, entertain me with a beautiful interactive gaming experience, and connect me to the world's information and i am supposed to be wowed by 'hello world' i only understood the power of hello world when i became interested in embedded systems so much time setting up the ide and connections and circuits and somehow i managed to make this previously idle pile of organised metals print hello world that was a a profound experience but this was years after i had become a competent programmer and had the understanding of physics to appreciate what was happening if you want to teach programming then you have to show people that the process can help them do something they want to do there used to be classes to solely teach typing without looking everyone i knew hated it, it was a pain for everyone in the class, then instant messenger came out and suddenly everyone was a professional typist banging out 60wpm if social media was only available to people through bash scripts i assure you everyone would be able to program in a few weeks because that is what people want to use a computer for right now but that would be regressive at this point so i'd suggest the future of programming education should be folded into mathematics education learning times tables? write a script to express that table even better would be to pull problems from a web api, solve, and post
- mastax 11y ago> hello world is outdated I agree with this sentiment in the general case. But it reminded me of something from when I was in high school I was taking some sort of electronics class that had rudimentary programming and the first assignment was to just get the computer to print your name. I was working with another student and this student was amazed when it worked. Amazed just that they got the computer to do anything. I was baffled by this, so much that I still remember it.
- chris11 11y agoI disagree. "Hello World" as a problem is completely uninteresting. But it can be a part of a great introduction. I'd expect most "Hello World" tutorials to quickly tell me how to go from reading text in my browser to running code on my pc. And that is really useful.
- sjbase 11y agoLike most here I always liked math and science. Nonetheless, growing up, I never felt like I was given a meaningful answer on "why do I need to learn math?" I think we can do better with programming. The anecdote the OP gives, "learn coding so your really boring job [no offense to OP] will be less painful" is useful. Even better for high-school kids: "learn coding so you can Instagram all day at your job while your program works for you." I'm not condoning this, and obviously it's better to actually inspire true curiosity (extremely hard), but I think this kind of message would work for a lot of kids.
- nickpsecurity 11y agoGames from people like World of Goo are exciting. I wasn't sure how I'd even imagine a game that could teach skills with good mapping to programming. They're doing a good job. Prior to that, the best results we were getting were projects like the brilliant MIT Scratch that turned it into collaborative, creative, lego building (below). Should still invest in stuff like that, too, which is more direct but fun. https://scratch.mit.edu/ https://scratch.mit.edu/ On other hand, that programming is a fundamental skill is an assertion that's being repeated by many without evidence. It's a useful skill that will become more useful as we go along. Yet, something like 80-90% of America, including top 1%, know nothing about programming despite their job success or quality of life. There's no direct tie in. Meanwhile, they use reading/writing and mathematics on a regular basis. So, I think people should stop making this claim as most people will mentally tune out upon seeing something like that. This brings to a bigger point where software isn't engineered despite prior work showing how to do it. That started with Margaret Hamilton and Dijkstra in the 1960's where both of them used modularity, layering, and interface checks to build flawless systems. By the 1980's, Hansen had safe concurrency (Concurrent Pascal), Mill's Cleanroom let teams hit almost no defects first try, LISP machines let you live-edit, incrementally-develop running systems w/ no compile phase, Schell had a NSA-resistant kernel (GEMSOS) that ran other things as processes/containers on virtual CPU's (sound familiar?), and Wirth's simplicity + safe language approaches let ETH run on their students' OS's. Each of these approaches led, with small teams, to systems that reached high levels of security, reliability, extensibility, and (for Lisp machines) productivity. Yet, the techniques that built them are largely not used by mainstream. The negative results are predictable. So, we have two problems: (a) getting nonprogrammers into programming so they can solve problems with some approach and toolset; (b) getting programmers into engineering so they can build robust, maintainable systems using lessons learned from the past. Like other engineering fields do. So far, we're doing better at (a). Some good news at least.
- contingencies 11y agoAt the risk of stating the obvious, (b) doesn't progress because it's more expensive and often unnecessary. In the cases where it would be useful, when TCO incorporating whole lifecycle costs such as maintenance and/or rebuilds are considered, (b) is still often a failure because it requires higher lead time and up front investment. That's not to say there's no space for very carefully built systems, just that they're a niche and likely always will be, particularly as hardware is now basically free and improved tooling (eg. popularization of CI) helps to reduce the difference between one-off hacks and "robust, maintainable" systems built with knowledge of prior work and theory.
- 32bitkid 11y agoI used to be more involved in the educational space–I used to teach college-level classes and also participate/organize/mentor coding spaces for young adults–and I don't think there is anything inherently wrong with the way that we teach programming. I have come to believe, after years of teaching, that you cannot _teach_ curiosity, but you can help create environments that foster a students desire to learn and explore. As such, the point of education is to expose and empower children (people, really) to have the tools they need to explore and discover the things that they _want_ to understand and master. You really can't _make_ someone enjoy "x", where "x" is the passion of the teacher. Programming, to me, is like writing, painting, or mathematics. In so much that it is a multi-faceted discipline. Coding is to writing as typing is to penmanship. There are _many_ reasons to write; from jotting down a grocery list to writing an epic novel, just as there are many reasons to code; from bulk automation/text transformation to diving into deep artificial intelligence. Just as there are many reasons to paint, and many reasons to do math. The "how" is dependent on the "why". Most people don't learn to mix oil paint simply for the joys of mixing oil paints, most people don't learn penmanship simply because they long to see a well formed letterform. Few people learn the how to take the functional derivative, simply because. It's a means to an end; they learn to do it because they need to express something _else_. I don't expect every child in my english classes to go on to write a great non-fiction masterpiece or an epic novel. In fact, most of them wont, but I _do_ think its important that they are exposed to the fundamental skills involved; penmanship, vocabulary, basic composition, in the event they _do_ want to write, or code, or compute, or paint, or whatever... I think "school" is exposure to the mechanics, and individuals who desire more will seek out the rest.
- deleted 11y ago[deleted]
- hellcow 11y agoAs a counter-point: my favorite classes were always the ones in which the teacher instilled their love of the subject into their teaching. Show me what can be accomplished--show me the best of what can be done--and let my imagination run with that. The mechanics are generally simple and can be learned online or through routine practice. It's the passion, the love, of the subject that teachers can uniquely give their students, whether that's history or painting or programming. Show us the joy behind it, and we'll seek out the rest. I know that mechanics and passion aren't mutually exclusive, but the question ultimately comes down to what teachers should prioritize. What's their goal? Is it to teach how to add, multiply, and divide, or is it really to inspire a lifelong love of mathematics in their students' lives?
- LeighJohnson 11y agoI agree with the article's thesis: programming general-education needs to step away from abstracted problem sets. Instead, I think programming should first be presented as a tool - rather than a complicated science. The comp-sci courses I had access to in high school / college were all depth-first, so the barrier of entry was overwhelming. The dense theory, to me, was so much less attractive than solving a problem with a BB plugin or broken Javascript in the real world. I believed I was going to be a script kiddy forever, because I enjoyed tinkering and tweaking more than traditional coursework. It didn't click for me that I could be a "real" programmer until after I dropped out of college (was studying Latin/Classics, no science or math background). I started building my own games and game-helper apps, in Python, while working an IT helpdesk. Observing people interact and engage with things I built gave me the confidence to pursue a career in web development, using MOOCs (MITx series was excellet) and project-based tutorials to self-educate. I stepped up to tackle more real-world problems outside the scope of my helpdesk position, mostly day-to-day scripting and org automation. So, educational strategies like Human Resource Machine really tick the right boxes for me. If I had played that game years ago, I think I would've gravitated towards comp-sci much earlier. I needed a strong reward system (coworker's gratitude) to propel me through advanced topics, and game-ification of edu is all about treadmilling through a reward track. I hold the title of software engineer today, without ever having completed a formal comp-sci course outside of MOOCs. I don't think this narrative is uncommon, especially among women or first-generation programmers. I clearly demonstrated the skills necessary to be a successful developer: linguistics and programming share many common themes. But I was funneled towards a silly Latin program, because I and my academic advisers thought my non-existent math/science background precluded me from computer science. Progamming has seeped into the vernacular of day-to-day problem solving, and I think this is the angle that intro courses should seize.
- mch82 11y agoThe [Head First Labs](http://www.headfirstlabs.com/ http://www.headfirstlabs.com/) series of books is a terrific example of teaching programming with relatable, real-world problem sets. I've found these books are good for a general overview of a topic that can later be supplemented by more advanced references.