Computer Science Educators Asked on June 15, 2021
I’m a freelance computer science tutor with junior high and high school students (working outside of school – I give them assignments.
Mostly my assignments are problems we find online, such as Codewars or USACO problems. This isn’t the best way to teach them about large project issues, such as "maximize cohesion, minimize coupling" or clear structure and documentation.
When I had fewer students I did unique projects with each one, but that takes way too much time outside the session for me to prepare. So what I’m looking for now is some kind of project I can do with my students that would teach large project concepts.
This project may be fairly complex. But — it should be the kind of complexity that my students can wrestle with on their own. I need to be able advise them on it in a one hour lesson. The problem with most student projects is that they spend the week making a mess of things and I can’t sort them out in an hour.
It should be doable in Python or C++. I don’t know much about web programming so that’s probably out.
It should be fun and hold their attention – which probably means graphical game. I can’t think of a text-based project which would hold their attention enough. If we use Qt then at least that is available in both C++ or Python.
(I don’t want to use PyGame – too primitive and frustrating as a game engine.)
A simple game alone probably wouldn’t teach "maximize cohesion minimize coupling" very well. Perhaps a game in which they implement the AI strategy? That might have complex enough algorithms. Maybe we could even play their AI’s against each other.
Maybe a turn-based game like Civilization? (A primitive form of it, of course.)
You're definitely on the right track with your project scope but high school students can pay attention to large scale text based games. I have had great success having them implement Blackjack. This project is large by nature but you can place restrictions on how they solve the problem. I've found that using three classes helps cut down on confusion.
I give this problem to AP CSA students in two parts, the deck and card classes with methods, and the hand class with functional game parts.
For higher level students, I give an open ended problem to algorithms & data structures kids where they need to write an algorithm that will procedurally generate a solvable (and interesting) puzzle. It forces them to do their own research while implementing core functionality to a game. Typically slide puzzles work well because they can be represented in a 2d array.
Middle School students tend to lack the attention to work on and understand a large and complex program. Drawing an animal with Python turtles or something similar can be a good way to show how quickly bad code can get out of hand. Just mentioning Discord bot is a good way to grab attention. Going through the steps of creating a bot that does something even as simple as outputting a link by chat command goes over very well.
I have plenty more examples but as a general rule, the more "out there" the program while having clearly defined instructions, the better it holds high school student's attention.
Correct answer by guitarcat on June 15, 2021
I think you're onto the right track. I've had great luck teaching these sorts of concepts in Unity, where you are trying to get so many different systems to operate together that architecture really starts to demonstrate its value.
And that's the key; you can't push this much beyond where they can see the value in it.
When I work with middle school students, I only gently lean on students for clean code. I've found that most of what middle school students program is too small in scope for good practice to demonstrate its own value back to the students.
In high school, on the other hand, I have a different tact. I get my initial buy-in to the notion of clean(er) coding by having the kids try to interpret short bits of absolutely abysmal code. (These are very short, and purely meant to demonstrate how very hard code can get to interpret if you don't follow at least some norms. You can see an answer where I have discussed this practice here.)
I will later follow up with code interviews in which they explain code that they created months ago. By this point, they have mostly forgotten what they did, and we can establish the idea that clean code is usually self-explanatory, and that the person who will most likely be editing their old code is... them. And that the person who most benefits, then, from being able to read it is also them.
One huge advantage you have by tutoring (as opposed to a classroom environment) is that code reviews become the most natural way to work, so you get a chance to look over their code in great detail and clarify good practices in ways that feel genuine to the student and their experience. Take full advantage of this, but remember that you will not be able to get buy-in to cleaner coding until they can really feel the benefits.
Answered by Ben I. on June 15, 2021
Here is the set of mini-projects, I've designed but never took in class. So, completely untested, though most of this was either done by me or by my peers back in past.
Graphics. All of these should be done using two primitives: putpixel() and getpixel():
Though you wanted some large project, so you can combine several of above into one big project. You may also add topics like "databases" to some of those (the psychology ones -- store all the data in shared DB). The "visualize" are pretty hard projects too.
The big idea for these projects is to ignite more ideas after implementation done.
Answered by danbst on June 15, 2021
There are some very good ideas in the answers but have you considered asking your learners to perform a simple task on a very large piece of code? For example, adding a new item to the GIMP about menu or changing the error messages the AWK compiler to include the date of compilation using
I feel that learners are too often presented with exemplar code and rarely with real world code that, for example, contain large sections of Fortran 77 mixed that call libraries of routines written in assembler commented in German.
Many of our lessons concentrate on the need to have well structured and documented code with helpful comments. It is only when confronted with modifying code that the importance of this becomes evident. There are practical difficulties with large software objects for which tools such as grep and sed are very handy, again the importance of this only comes from maintaining code not from writing it.
[ As an adjunct you could introduce your learners to the obfuscated C competition https://www.ioccc.org/ and ask them if they fancy maintaining some of that! ]
I find students really like this approach as they start with something that works e.g. an alpha-beta pruning draughts playing program written in pascal, over which they have rights to augment and modify. This gives the learners a sense of empowerment rather than a feeling that after 10 hours of work they can sort six numbers into order having written a program they know nobody will ever use.
I have also some specially written code for exercises which I have deliberately written to reflect some poor programming practices or code problems which illustrate why techniques for large software projects exist. I have variously, commented out large parts of the code; used #define statements in slightly misleading ways; used inconsistent interfaces etc. The aim then is to get the learners to form criticisms of the code.
Answered by Jon Guiton on June 15, 2021
4 Asked on February 1, 2021 by user9137
3 Asked on January 29, 2021 by neal-zupancic
1 Asked on January 28, 2021
3 Asked on January 5, 2021 by user9790
5 Asked on December 30, 2020 by buffy
3 Asked on December 29, 2020 by neelesh-v
8 Asked on December 27, 2020 by louis-b
3 Asked on December 20, 2020 by pluke
21 Asked on December 11, 2020 by ben-i
0 Asked on December 8, 2020
5 Asked on December 7, 2020 by totera
3 Asked on December 4, 2020 by technosam
Get help from others!