is two people pairing better in a training class?

This girl and her coworker are pairing together in this class. She said to the instructor pairing is pointless. Her partner in crime said its distracting and silly.

Someone e-mailed me this story suggesting it would make a good blog.  I feel for both sides of the story here so I’m going to present an argument for both points of view.  I bet the e-mailer didn’t see that coming!

Pair programming on a project

On an actual task, I think pair programming is great.  It is faster, higher quality, both people know the code and provides a great way to learn from each other.  In a $5,000 training class, I have mixed feelings.

Pros – why two students per computer in class rocks

I’ve never actually done this so it is more hypothetical.

  1. You get stuck less because there are two minds.
  2. You go down less dead ends completing the labs faster.
  3. Your partner can point out when you aren’t getting something or doing it the longer way.
  4. One person can explain to the other when it takes longer for one person to grasp a concept.
  5. You can learn tricks from the other person like how to use the IDE better.
  6. You don’t have to ask the instructor for help as often – which is a big benefit if a lot of people in the class have questions.

Cons – why two students per computer in class is a waste of time

  1. I want to make as many mistakes as humanly possible while in class so I don’t on the job.
  2. I want to get hands on experience *doing* each step rather than just watching.  I’m a tactile learner and I’m going to retain more by doing.
  3. I want to gain experience with debugging/troubleshooting in a controlled setting where the instructor can bail me out as needed.
  4. I think faster than the average person and always finish labs very early.  I want to use that time to explore the subject matter rather than have the whole lab take longer.
  5. Sometimes asking the instructor a question sparks a good discussion.
  6. Sometimes I want to try something that isn’t strictly covered in class so I can ask the instructor/expert when I get stuck.  Can’t do this with a partner.

The ideal in my mind

Having one computer for each student and asking the person next to you when you have a question.  Benefits:

  1. Frees up the instructor for the hard questions
  2. Lets you see the mistakes of two people rather than just your own
  3. Gain practice trying to explain things

What do you think?  Do you prefer pairing with someone else in class?   Ultimately, I think it depends on the learning style of both people.  For my style, having my own computer is more conducive to learning a technology.

“example goes here”

A light post for a Friday:
Now that the FIRST robotics season is over, I think back to some documentation that says “example goes here.” Or our personal favorite to laugh at: a very serious description that says to carefully follow all the settings in the picture. Immediately followed by “picture goes here”.

I thought of this because I came across something in the PMD plugin:

 
      <documentation>
         [Enter extension point usage example here.]
      </documentation>
... 
    <documentation>
         [Enter API information here.]
      </documentation>

I think this meant by the Eclipse developers to show what a plugin looks like. To me, it’s a nice reminder to proofread what you develop.

GWT: Bounded TextField in GXT

This article provides a solution for creating a TextField with bounded user input in Sencha GXT (aka Ext GWT), for use in GWT applications.

The Problem

Recently, I was looking for a way to limit the amount of text a user could enter on an HTML form within a GXT application – for example, limiting a zip code input field to five characters. I wanted something that functions identically to the maxlength attribute found in HTML <input type=”text”> fields. While GXT does offer a maxlength attribute within a TextField object, it does not function as one might expect. Instead of limiting the number of characters the user could enter, it interacts with the validation process and displays a validation error (such as highlighting the TextField in red) after the fact if a user entered too many characters.

The Solution

I discovered a post on the Sencha support forum that shows how to create a subclass of TextField with the expected functionality, ie, to limit the number of characters the user can type to be the maxlength attribute. Since I believe such a class is desirable throughout my application, I generalized the original anonymous inner class solution to be a regular Java class.

Simply add the following class to your application and replace all your instances of TextField with BoundedTextField and the maxlength attribute will function as a text limiter. I hope Sencha will eventually include support for this form of maxlength functionality within the API. Thanks to Sven at Sencha for providing the original solution.

package net.selikoff.gxt.ui.widget;

import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.gwt.user.client.Element;

/**
 * Class works like TextField class but Max Length specifies the maximum
 * amount user can type, instead of being used as limit for validation.
 * 
 * @author Scott Selikoff
 */
public class BoundedTextField<D> extends TextField<D> {
	@Override
	public void setMaxLength(int m) {
		super.setMaxLength(m);
		if (rendered) {
			getInputEl().setElementAttribute("maxLength", m);
		}
	}

	@Override
	protected void onRender(Element target, int index) {
		super.onRender(target, index);
		getInputEl().setElementAttribute("maxLength", getMaxLength());
	}
}