Algorithms are probably one of the only disciplines of web development (maybe with testing) that requires lots of regular training before being mastered and correctly abstracted by the brain. But now that AI is everywhere, and is able to write algorithms, how do you teach students such a practice?

· Opinion  Â· 3 min read

How to teach algorithms to others now that AI is all over the place

Algorithms are probably one of the only disciplines of web development (maybe with testing) that requires lots of regular training before being mastered and correctly abstracted by the brain. But now that AI is everywhere, and is able to write algorithms, how do you teach students such a practice?

Before OpenAI and co

How did you teach algorithms before AI?

Well, dear students, “please solve the classic problem” : how to sort an array, how to count vowels in a sentence, etc.

This was already debatable IMHO, because these were already solved for a long time, and anyone could search for a decent solution by copy/pasting, without much brainstorming.

I guess that these past years, before AI, the trick was just to give a homemade, not-already-existing exercise, and ask a student to solve it.

Then the solution was a combination of StackOverflow answers, use of functional libraries, and intuition.

The more you automate…

Now you can ask ChatGPT to solve an algorithm problem, right?

False.

The more you automate, the more you need to understand what is going on under the hood.

Conceptual abstraction (like frameworks are) have limits, particularly when defining business rules.

What I wouldn’t suggest nowadays

Now I wouldn’t give students any problem that is 1) already solved, or 2) relies on things already solved.

Example of a problem that AI can solve : give me the number of palindromes for each unique anagram of a given String.

Given that “palindrome” and “anagram” are already well-known problems, I’m pretty sure that ChatGPT can solve it (I just tried, and that’s indeed true).

What I would do to teach other how to create algorithms

I would simply create a little homemade stuff, imagined from news, game, or whatever, like helping MBappe to join Real Madrid.

AI would be too confusing to help, since solving this requires thinking about it. AI only knows about the past, and barely assembles two well-known problems.

I wouldn’t rely on AI improvements, since new versions seem not to be as good as previous ones - probably because of regulations.

Wouldn’t the student try to cheat?

No. Students will again use StackOverflow, utility library, and intuition, like before.

And ChatGPT, unlike before.

Consider AI as one more tool in the wallet, not an enemy.

AI may give good insights, it can also give absolutely wrong inputs. In both cases, critical mind of the student is the key to success, like it was before.

Summary

AI can help students to solve algorithm problems, it’s just that teaching them is now a little more tricky, since you can’t really prevent them from using a tool like ChatGPT. My humble opinion would be not to train them with too classical things. Just create unsolved problems and tada - they can’t cheat (woops, copy-paste from AI results I meant;) anymore.

Back to Blog

Related Posts

View All Posts »
The simplest turbo-frame example

The simplest turbo-frame example

Turbo frame is a powerful feature of Hotwire, here is a quick memo about how to follow conventions in the simplest case. Convention over configuration is powerful, but sometimes it is also a problem when you are not sure anymore about conventions ;) so I plan to release more "simplest *** Hotwire feature".

My honest opinion about Hatchbox

My honest opinion about Hatchbox

Hatchbox.io is a deployment platform for Ruby-on-Rails users. I used it recently, so for people ashamed of trying, here is my review.