Archive

Archive for May, 2011

World of C#-craft part 2: what does the audience think?

05/31/2011 3 comments

In a previous post I ranted on how cool it would be to use pc-game mechanics in a programming course. Before actually getting down and dirty and try to come up with an actual system for this I surveyed my students to see if the idea has any resonation with the target audience, the students themselves, or not. Now it is very interesting to mention this cool project by Jonas Swiatek who is actually implanting an MEF-based extension for Visual Studio 2010 to allow achievements while coding! More on this project in a later post, but you should definitely check it out if you want to have a feeling of how achievements could be used in a programming environment. Read more…

Writing an event-wrapper

05/23/2011 1 comment

A while ago, two students asked me how one could write a wrapper around around an existing class and still expose the eventhandlers therein. I didn’t had the fainted clue how to solve this. If someone would ask me how to expose properties through the wrapper the answer would straightaway be: use properties again, e.g.:

class InnerClass
{
public int SomeProp { get; set; }
}
class WrapperClass
{
private InnerClass wrappedClass = new InnerClass();
public int SomeProp{
get { return wrappedClass.SomeProp;}
set { wrappedClass.SomeProp= value;}}
}

However, what I didn’t know is that there’s basically a basically an analogue solution for this using the add/remove accessors instead of the get/set way:
class InnerClass
{
public event EventHandler SomeEvent;
}

class WrapperClass
{
private InnerClass wrappedClass = new InnerClass();
public event EventHandler SomeEvent
{
add { wrappedClass.SomeEvent += value; }
remove { wrappedClass.SomeEvent -= value; }
}
}

Voila, another important lesson learnt! More info here.

Tags: , ,

XML-databinding in WPF using Blend 4

This tutorial shows how easy it is to use XML-databinding in Blend without writing a single line of code and mostly using the drag-and-drop magic of Blend. We will create a very simple rss-reader that shows the content of a single rss-feed. This post was inspired by the great talk by Isabel Gomez Miragaya and Katrien De Graeve they gave at TechDays 2011 Belgium titled “Designing and Building a Windows Phone 7 Application end-to-end” (video of the talk). Read more…

“World of C#-craft”: an achievement-based classroom?

05/17/2011 5 comments

In a previous post I already briefly hinted at this: wouldn’t it be cool to integrate popular pc-game mechanics in classroom labs?


What I am proposing in this post is another way of organizing practical program labs for an audience that isn’t necessarily 100% willing to become a good programmer. Teaching C# classes to undergraduates electronics-ict isn’t always easy:

  • The crowd is pretty diverse: some have no programming knowledge at all, others have already written whole VB.NET apps, etc.
  • They aren’t all interested in the programming aspect of the studies but perhaps are more in to the electronics-part. However in the end, they will need to be proficient in both electronics and ICT.
  • They can’t see why toying around with console-based programs is, in my opinion, a necessary evil for first-time programmers.

However, in the end, all if these students have to become proficient programmers, whether they want to or not.

Having tried several approaches I don’t seem to be able to find an all-encompassing way to reach each and every last one of the students. I even tried to incorporate live voting and twitter integration in slides during lectures…an experiment with mixed results. Don’t get me wrong, I’m pretty sure I’m reaching above an average number of students, but still: I want all of them to love to program! I think I’d be a poorly ambitious teacher if my aim wasn’t to try and get a full classroom to become passionate about programming.

The idea that I propose here lingered for quiet sometime in the back of my head. Being a fanatic gamer myself I am always fascinated how simple game mechanics like achievements, quests, constant feedback of the player’s progress and leveling can make any ordinary game more fun and worthwhile to play. Somehow the act of earning things only a select few can reach is strangely addictive. So why not use these game mechanics in programming classes? Could a simple, yet fun and addictive achievement-system that constantly gives feedback to the student on his progress, enabling him to compare his results with others enable a teacher to reach more students? Could students become more motivated to do menial programming tasks (I dare anyone reading this to come up with fun programming tasks for the first few weeks, when the only thing a student knows is how to create variables and write stuff to the screen)? Of course, a small side note here: this system is primarily aimed for the gray zone of students who ‘might become passionate programmers’ but who usually, in classic classrooms, grow a mild hatred towards anything containing things like i++, public static overrive int, etc. Passionate students will enjoy this system as well, but they actually simply like to code, no matter the form they are learning new things…they might even think of this system as redundant.

This post is not about actually making an achievement-system that I propose. I’m merely trying to give the reader an idea of what I think might be an interesting way to organize a classroom and secondly I hope I can enable some people in actively pursuing this topic. I’m certain some of my ideas (that are far from original) can be as easily applied in any practical-oriented classroom in higher education systems.

So yes, this will be a braindump with, I hope, tiny little ideas that can grow in people’s mind. This won’t be a coherent, scientific rambling about how a classroom can be organized…I leave that to the educationists of the world. And perhaps, if I’m bored with the gazillion other programming ideas I have, I might someday write a follow-up where I actually show a real, useable application. Who knows. Read more…

3 Small Silverlight tricks you might need some day

05/11/2011 1 comment

This little article describes 3 easy tricks that might come in handy from time to time, namely:

  • How to create application-wide variables without fancy tricks
  • Allow a user to install you application as a stand-alone OOB application
  • Detect whether your application is in browser or “Out-of-browser”

Read more…

Follow

Get every new post delivered to your Inbox.

Join 208 other followers