zlacker

[return to "My Favorite Programming Problem to Teach: Digit Length"]
1. svnpen+Jm[view] [source] 2019-11-11 03:14:08
>>jstrie+(OP)
> As a result, solutions using strings are disallowed on problem sets and quizzes until they are taught. However, the few students who have prior Python programming experience may be tempted to find digit length without loops using a variant of the following (for our purposes) invalid solution.

Wow. this is one of the reasons I hated school. No programmatic reason what given for why a string solution couldnt be used, only an arbitrary reason. Here students may have knowledge from self teaching or whatever, but they are unallowed to use that knowledge because "reasons".

To any teacher that thinks its a good idea to punish students for thinking outside the box: shame on you. All youre going to end up doing is crushing enthusiasm and/or creating drones. Please dont.

◧◩
2. wflemi+Lo[view] [source] 2019-11-11 03:46:41
>>svnpen+Jm
Because I am a smart-ass, I did something like this in college. There was an intro course in MATLAB my freshman year, but I'd been programming for several years at that point so I found it too basic to hold my interest. In one of our early labs, we were told to implement a function that calculated a Fibonacci number. I figured that sounded like something MATLAB probably had in its stdlib, and it did, so I wrote a 1 liner and called over a TA to approve my work.

Thankfully this TA agreed with you (as do I). He said it looked good, and I think that's the shortest lab I ever had.

◧◩◪
3. em-bee+Up[view] [source] 2019-11-11 04:02:59
>>wflemi+Lo
if i was the TA i would have said: "congratulations, for you have not learned anything new"

personally, when something is to basic to hold my interest, i try to find ways to make it more challenging.

◧◩◪◨
4. Retric+fs[view] [source] 2019-11-11 04:37:20
>>em-bee+Up
I personally learned quite a bit in a similar situation.

In an operating systems class we had a little project to create a command line calculator in C, with the added hoop of using x86 ASM for all control flow and calculations. As this was not a programming class we had a very brief overview of the very basics needed to get this done. I assumed using floating point arithmetic would make this easier, but knew that was not part of the early spec, so I asked the professor in class what version of x86 and he said pentium 1.

I then found and read intel’s documentation for the first generation Pentium. Which completely changed my mental model of CPU’s. Honestly, it was probably the closest collage assignment to how real world coding works and much more useful long term than just implementing some simple algorithms by hand.

[go to top]