I hate those programming class just trying to teach python surface use, while in a programming class you have time to go deeper and learn about how python works, cause basically python use all str to binary and loop for doing all the work requested by the teacher, without student even being aware of how it does it !
One could say as well: this isn't programming, this is low level language tricks.
You don't need to know "how integers are manipulated into cpu" when learning to program, and at an introductory class like that described in the article you shouldn't either. There's a reason SICP at MIT was in Lisp and then Python.
I also very much doubt it would be "much more fun doing it in Assembly language".
The author went at length to explain how this is a useful exercize for programming, as it introduces edge cases, alternative implementations, testing, etc.
Well, as long as he disallowed the obvious solution (last paragraph of the OP), and then he still got the solution wrong... (see other comments up threat)
In our collage, one of the first semester classes we were doing assembly on old Motorola 8 bit, the other one was Java.
people that never programmed before had more trouble with java, than assembler.
But if you want to teach programming, i would follow my path, and provide a deeper understanding at how to control a cpu and how it really works. In order to demystify computer and gives student a real experience of all the hidden works that are done with a 4 lines python code.
and for the fun side, guess why assembly is the second searched language on Stack overflow during weekend : https://stackoverflow.blog/2017/02/07/what-programming-langu...
i guess people are trying to have more fun on weekend than on boring office project during work days :)
And those numbers show a real interest about Assembly which is usually greatly discarded in any common CS teaching anywere. So teachers decides it's not interesting, while in fact most peoples search about it on weekend...I mean it illustrates a real issue here. May be understanding how to program a cpu at low level is something natural, that only scholar peoples cannot understand, therefore neglecting natural tendency of normal peoples to try to understand how things really work...
And for those really wanting to even dig deeper and understand what is a CPU, i strongly suggest looking for "from nand to tetris" https://www.nand2tetris.org/ wich basically start at nand logical gate, to the extent to create a full working cpu and programming it to play tetris.
For the purposes of teaching, the best approach is not always to start from the foundations and build upwards.
> Evaluating different solutions leads to natural questions about the definitions implicit in the problem statement: mathematically, what is digit length?
OF COURSE! This is a MATHEMATICAL problem that is posed as a PROGRAMMING question. This has always confused me and I could never justify until reading this article why I felt them to be irrelevant to showcasing my programming knowledge. At the very least just tell people, this is the mathematical reasoning behind it, and watch the person implement it.