Live data from Hacker News

Stanford study shows success of different programming styles in CS class

ed.stanford.edu

21–30 of 53 posts

Re: Stanford study shows success of different programming styles in CS class

#21
I think data mining editor/IDE use is a pretty useful idea overall and the "paradigm shift" of constant monitoring which allows immediate teacher feedback is much needed (not just for programming).

The other interesting approach I read about a while back was using tracing quiz data to identify "blind spots". A typical example was identifying students that had problems understanding loop constructs (they would always assume one iteration for example).

I talked to one of the authors of this paper and he had some interesting ideas fro CS education in general: http://dl.acm.org/citation.cfm?id=2526978

My gut instinct and thinking back to my university days make me think that a blind spot for recursion may very well be a thing. I'd be pretty interested in identifying students that struggle with loops and/or recursion and investigating that further. For example...is there a correlation? If not what happens if you give a loop-struggler group only recursive tasks and a recursion-struggler group only loop tasks? Etc.

Re: Stanford study shows success of different programming styles in CS class

#22

What was interesting is that the higher-performing group (Alpha) was stuck less often that the lower-performing group (Gamma). Is this the next programming motto after "Don't Repeat Yourself"? Don't Get Stuck! Now how does one avoid getting stuck while programming? I still get stuck a lot, but these really helped: - Test what you write as quickly as you can. - Hold it in your head! Or you won't have a clue what all y…

> Test what you write as quickly as you can. Until you run into that one problem where you can't test between the small steps, because you need the whole thing to be up (to some degree) and working for any test to work. Operating system kernels would be an example of that: The best test for a *nix OS kernel is, if it can run a shell. You need all the essential syscalls to do something sensible and if any of the requi…

> Operating system kernels would be an example of that: The best test for a *nix OS kernel is, if it can run a shell. You need all the essential syscalls to do something sensible and if any of the required parts doesn't work the whole thing fails.

How do you test kernel? Run a virtualised kernel? I think at least DragonflyBSD supports that.

Re: Stanford study shows success of different programming styles in CS class

#23

What was interesting is that the higher-performing group (Alpha) was stuck less often that the lower-performing group (Gamma). Is this the next programming motto after "Don't Repeat Yourself"? Don't Get Stuck! Now how does one avoid getting stuck while programming? I still get stuck a lot, but these really helped: - Test what you write as quickly as you can. - Hold it in your head! Or you won't have a clue what all y…

> Hold it in your head! Or you won't have a clue what all your code, together, is doing. Do you mean to say: if you can't hold it all in your head, you're overcomplicating things? Because if so, I agree. I just finished giving an introduction to programming course, using Processing. I tried teaching my students to write structured code from the start, splitting functionality into smaller methods as much as sensible.…

When I see students posting on /r/programming, what they usually seem to have a problem with is problem decomposition. i.e.: What are the steps needed to solve this part of the problem? Or algorithm design, critical thinking, or whatever you want to call it. How do I get from A to B, basically.

Remembering back to my first year, it seems that some people "get this" and some do not. Which is nothing against them -- everyone is different.

Re: Stanford study shows success of different programming styles in CS class

#24
post #15

It sounds like they discovered that some people already knew how to program.

It seems to me that there are way too many variables that aren't really measurable for this to be completely accurate -- such as this example, some people probably had programmed before.

Re: Stanford study shows success of different programming styles in CS class

#25
post #15

It sounds like they discovered that some people already knew how to program.

Having recently (last year) enrolled in a Computer Programming program, I can say this is likely the case. The class has a number of people who are simply enrolled to get a piece of paper that states they know how to code and then there are those that are breaking new ground in learning.

I have the logic down quite well but my biggest issue is the syntax - it would appear that Stanford thinks I'm doomed to fail.

Re: Stanford study shows success of different programming styles in CS class

#26

What was interesting is that the higher-performing group (Alpha) was stuck less often that the lower-performing group (Gamma). Is this the next programming motto after "Don't Repeat Yourself"? Don't Get Stuck! Now how does one avoid getting stuck while programming? I still get stuck a lot, but these really helped: - Test what you write as quickly as you can. - Hold it in your head! Or you won't have a clue what all y…

It's also likely that these guys had already programmed before coming to the class. We all tend to get stuck when programming something for the first time. Second and third times are much smoother experiences.

You’ve reminded me of a quote from Chuck Moore:

> Before you can write your own subroutine, you have to know how. This means, to be practical, that you have written it before; which makes it difficult to get started. But give it a try. After writing the same subroutine a dozen times on as many computers and languages, you'll be pretty good at it.

Or, as Fred Brooks put it, “plan one to throw away”.

Re: Stanford study shows success of different programming styles in CS class

#27
post #15

It sounds like they discovered that some people already knew how to program.

> 70 students enrolled in an introductory undergraduate course in programming methodology

I'm curious about that too; is this course optional? Would people who can already program take this course?

Re: Stanford study shows success of different programming styles in CS class

#28
post #15

It sounds like they discovered that some people already knew how to program.

> 70 students enrolled in an introductory undergraduate course in programming methodology I'm curious about that too; is this course optional? Would people who can already program take this course?

Anecdotally, at my university (graduated 2013 so still a recent experience), a lot of CS students took the intro to programming course. In fact, it was (and still is) a requirement for a BS in CS at the school. The only way you could get out of it was if you had taken AP CS in high school and passed the test for the credits.

A large majority of my CS friends in that class had all been programming for either a little bit or quite some time, and the class was mostly a joke for them. Lectures were optional, and a bunch of friends (including myself) only attended three classes the entire semester: the first class (where we found out we didn't need to go to class except for tests) and the mid term and final.

Of course on the other side of things, I had friends who had never programmed before and found the course grueling and struggled to pass.

Re: Stanford study shows success of different programming styles in CS class

#29

What was interesting is that the higher-performing group (Alpha) was stuck less often that the lower-performing group (Gamma). Is this the next programming motto after "Don't Repeat Yourself"? Don't Get Stuck! Now how does one avoid getting stuck while programming? I still get stuck a lot, but these really helped: - Test what you write as quickly as you can. - Hold it in your head! Or you won't have a clue what all y…

> Test what you write as quickly as you can. Until you run into that one problem where you can't test between the small steps, because you need the whole thing to be up (to some degree) and working for any test to work. Operating system kernels would be an example of that: The best test for a *nix OS kernel is, if it can run a shell. You need all the essential syscalls to do something sensible and if any of the requi…

> Operating system kernels would be an example of that: The best test for a *nix OS kernel is, if it can run a shell. You need all the essential syscalls to do something sensible and if any of the required parts doesn't work the whole thing fails.

So start with something simpler. Start by making a kernel that can run /bin/true, that never reclaims memory, that only boots on whichever VM you're using for testing. You absolutely can start with a kernel that's simple enough to write in a week, maybe even a day or hour, and work up from there. See http://www.hokstad.com/compiler for a good example of doing something in small pieces that you might think had to be written all at once before you could test any of it.

> I spent the past 3 weeks doing exactly that, refactoring a code base. I knew exactly where I wanted to go, but eventually it meant working for about a week on code without being able to compile, not even think of testing it, because everything was moving around and getting reorganized. However now I'm enjoying the fruits of that week; a much cleaner codebase, easier to work with and I even managed to eliminate some Voodoo code nobody knew why it was there, except that it made things work and things broke if you touched it.

Which is great until you put it back together and it doesn't work. Then what do you do? I've watched literally this happen at a previous job, and been called in to help fix it. It was a painful and terrifying experience that I never want to go through again.

In my experience with a little more thought you can do these things while keeping it working at the intermediate stage. It might mean writing a bit more code, writing shims and adapters and scaffolds that you know you're going to delete in a couple of weeks. But it's absolutely worth it.

Re: Stanford study shows success of different programming styles in CS class

#30

What was interesting is that the higher-performing group (Alpha) was stuck less often that the lower-performing group (Gamma). Is this the next programming motto after "Don't Repeat Yourself"? Don't Get Stuck! Now how does one avoid getting stuck while programming? I still get stuck a lot, but these really helped: - Test what you write as quickly as you can. - Hold it in your head! Or you won't have a clue what all y…

> Test what you write as quickly as you can. Until you run into that one problem where you can't test between the small steps, because you need the whole thing to be up (to some degree) and working for any test to work. Operating system kernels would be an example of that: The best test for a *nix OS kernel is, if it can run a shell. You need all the essential syscalls to do something sensible and if any of the requi…

I think as you get more experienced, what is considered a "small step" changes as you're able to keep more context in your head (subconsciously of course). For the complex library example, that would be keeping the new vs the old architecture at the forefront of your mind instead of switching all thought to "const? maybe? what does that mean in this context?" and "how can I get rid of this reinterpret_cast?"

Absolutely agree with "Instead you should write code in a way that it's easy to get back into it" though!

Post reply on HN