A Basic Window

I find the commands for creating interfaces in Maya to be very well thought it.
They make UI creation easy, so you can focus on the script behind the interface.
Remember though, creating a well designed interface can be pretty involved.
You need to make sure everything in it makes sense to the user, and that it
won't do unexpected things to confuse them.
Here's the code for the starter window.

{
	string $windowName = "checkerCubeWindow";
	if (`window -exists $windowName`) deleteUI $windowName;
	window -t "3d Cube of Checkers" $windowName;
		columnLayout;
			intFieldGrp -l "XYZ dimensions" -nf 3;
			button -l "Create Checkers";
		setParent..;
	window -e -wh 400 150 $windowName;
	showWindow $windowName;
}

Heres what its doing:

{
	string $windowName = "checkerCubeWindow";
	Heres where pick the name for the window. I'm using a variable to hold the name because
	I have to use the name several places in the script.  This way, if I need to rename
	the window, I only have to change it in the variable and I know the rest is taken care of.
	
	if (`window -exists $windowName`) deleteUI $windowName;
	If the window is already open, this line will close it.  If you try to create
	a window with a name conflicting with a window already open you'll get an error.
	
	window -t "3d Cube of Checkers" $windowName;
	Actually creating the window.  The "-t" flag is for the window title.
	Your Mel command reference has a complete list of every flag.
	See where the $windowName variable is?
	Every time you declare a UI element, if you put a string at the very end of the command,
	it will be the name of the element.
	
		columnLayout;
		Beginning a columnLayout. Layouts are necessary to hold "controls", which are
		Maya's name for buttons, fields, and any other elements inside an interface.
		
			intFieldGrp -l "XYZ dimensions" -nf 3;
			button -l "Create Checkers";
			Theres a group of three intFields, and a button.
			
		setParent..;
		Remember this one.  You need to use a setParent command to close out your layouts.
		
		
	window -e -wh 400 150 $windowName;
	Here I edit the window's size to where I want it.  Adding controls to a window
	can affect the size, so always set the size after all controls have been added to force
	it to the size you want.
	
	showWindow $windowName;
	By default a window is created invisible.  This speed up adding the controls,
	because the screen doesn't have to refresh after each one.  The showWindow
	command is a convenience command to make a window visible.
	
}

A little more about the setParent command.  Using the command followed by three dots setParent...;
means to Parent the UI to the next level up, in this case the window.
Notice how the lines are tabbed in?  Its the same style as with {...} brackets, in other parts of code.
Thats because its the same idea. columnLayout; starts a layout, setParent...; closes it.
Next we'll make the window actually do something.