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. coldte+zE[view] [source] 2019-11-11 07:55:10
>>netmon+cE
>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.

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.

◧◩◪
3. netmon+hJ[view] [source] 2019-11-11 09:17:12
>>coldte+zE
I understand what you say, but i think you are wrong. Assembly is closest to what a cpu actually does for REAL, so you are programming. When using Python or whatever any advanced language, you are less programming CPU and more relying and tons of layers from other's works which are basically created to never let you understand how to program a CPU. So peoples feels they are programming, while they are just integrating tons of library and set them to do something usefull (which is good too).

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.

◧◩◪◨
4. soVery+p81[view] [source] 2019-11-11 13:53:15
>>netmon+hJ
Students are taught to manipulate real numbers long before they're taught about Dedekind cuts or equivalence classes of Cauchy sequences.

For the purposes of teaching, the best approach is not always to start from the foundations and build upwards.

[go to top]