How to place cubes around in a square shape
You may use Dupliverts to achieve it.


In Edit Mode add a plane and subdivide it, then delete the faces. In Object Mode add a cube and scale it as you like. 


In Object Mode parent the cube to the plane (Ctrl+P-->Object).


Select the plane and go to the Object header-->Duplication panel and push the Verts button.


Finally with the plane selected press Shift+Ctrl+A to make the duplicates real meshes.