zlacker

[parent] [thread] 10 comments
1. netmon+(OP)[view] [source] 2019-11-11 07:46:39
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 !

replies(3): >>coldte+n >>rozab+A >>proc0+tt1
2. coldte+n[view] [source] 2019-11-11 07:55:10
>>netmon+(OP)
>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.

replies(2): >>roel_v+i3 >>netmon+55
3. rozab+A[view] [source] 2019-11-11 07:58:53
>>netmon+(OP)
You think students should be writing assembly before they even know what a string is?
replies(1): >>unionp+F3
◧◩
4. roel_v+i3[view] [source] [discussion] 2019-11-11 08:53:46
>>coldte+n
"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)

◧◩
5. unionp+F3[view] [source] [discussion] 2019-11-11 08:58:34
>>rozab+A
Basic assembly is easy. (adding numbers, counting, basic comparisons, even basic branching, all you need is 12 or so instructions ).

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.

replies(1): >>netmon+m4
◧◩◪
6. netmon+m4[view] [source] [discussion] 2019-11-11 09:09:35
>>unionp+F3
This is exactly what i mean ! :)
◧◩
7. netmon+55[view] [source] [discussion] 2019-11-11 09:17:12
>>coldte+n
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.

replies(2): >>SamRei+k5 >>soVery+du
◧◩◪
8. SamRei+k5[view] [source] [discussion] 2019-11-11 09:20:11
>>netmon+55
You can always learn assembly language later. Putting it in the intro class is a bad idea.
replies(1): >>netmon+66
◧◩◪◨
9. netmon+66[view] [source] [discussion] 2019-11-11 09:32:12
>>SamRei+k5
well can you develop a little bit your answer cause a one sentence opinion is just nothing.
◧◩◪
10. soVery+du[view] [source] [discussion] 2019-11-11 13:53:15
>>netmon+55
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.

11. proc0+tt1[view] [source] 2019-11-11 20:34:24
>>netmon+(OP)
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]