zlacker

[return to "My Favorite Programming Problem to Teach: Digit Length"]
1. netmon+cE[view] [source] 2019-11-11 07:46:39
>>jstrie+(OP)
From my point of view, this isn't programming. This is high level language tricks. It would be much more fun doing it in Assembly language, without any use of any kind of library, expect for input and output. This way student would have learnt so much more, about how integer are manipulated into cpu (just bits in base 2) doing smart math conversion to represent it in base 10. And why not generalise the problem to also compute the size in base 8, or any base N.

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 !

◧◩
2. proc0+F72[view] [source] 2019-11-11 20:34:24
>>netmon+cE
Exactly this and programming screening interviews are full of this!

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

[go to top]