Friday, February 14, 2014

Searching for Code Snippets–Good or Bad for Students?

This morning Rob Miles posted a link (C# Code Snippets on Demand) to a new site from Microsoft Research called Bing Code Search: C# code snippets on-demand. basically you enter a question “How do I …” and the site searches for a code snippet that can be used to solve you problem. Wow! Cool!


It’s a research project and there is still work to be done. Soon, they say, you’ll be able to automatically enter code snippets directly into popular IDEs. Since the language available is C# I assume that means Visual Studio and perhaps Eclipse.

And then I thought “Do I want to share this with my students?” and my thinking got complicated. On one hand I really do want my students to become adept at learning how to do things on their own. In this day and age that means searching for answers on the Internet. It means learning how to separate the good from the bad and learning from examples. So this site could be a big win.

On the other hand students also get good at asking other people to do their work for them. Hang out on any inline support forum enough and you’ll see cases of students looking for people to do their homework for them. They try to hide it but generally not very well. I want students to learn for themselves and to do their own work. I don’t expect them to memorize everything but I don’t want them to have to look up every little thing either!

When it gets down to it I will share this site. I want students to explore beyond what we can cover in lectures and demos. I want them to be able to find the tools to make their own programs truly their own programs. Exploration is why I like that Visual Studio has Intellisense for example. These snippets are short enough that they are not total solutions and so students will have to understand them to really use them. And if they can’t figure them out on their own I’ll get a teachable moment. Right? Plus the searches I have tried so far bring up enough options that students will have to use their own judgment about which possible option is what they really want/need.

What about you? Would you recommend this site (or one like it) to students? Or do you do as much as you can to discourage students from looking for code on the Internet?


Rita said...

1. Require students to code their own solutions in a controlled classroom environment (blocking Internet access temporarily if needed).
2. THEN have them search for a code snippet and compare to their solution - which is the better way, and why?
3. After they have proven their familiarity with the specific skills, assign a larger project that requires them and ENCOURAGE the use of code snippets (their own, their classmate's, or one found online) - that's just good engineering.

Garth said...

For a Programming I course I do not think it would do them any good. For Programming II I would want to monitor the use and really limit it. For Programming III I would expect them to use it but cite the source like any other thing found on the internet.

Mike Zamansky said...

We joke in my AP and SoftDev classes that we should have a page of resources where everything is linked to Stackoverflow.

For the most part, these types of sites aren't going to help them solve thinking problems or come up with algorithms so this just shortcuts plowing through docs which is a good thing.

Unknown said...

When I'm coding, I often use StackOverflow. I don't use a piece of code until I understand everything it's doing however.

I'd let the kids use it, but I'd have them comment how each line is helping them reach their end goal