Script the UI or do it in the Hierarchy, which case to use which one of them?

I found it is difficult to judge which case to use UI in script or assign it in the hierarchy:
I usually do it like this in script:

void OnGUI(){
		// GUI.Label(XXX)
		if (GUI.Button (new Rect (Screen.Width * .5f, Screen.Height * .5f, 100, 100), "button")){
			// do something
	    }
}

It is convenient to control it in the script. But dont work properly in different resolution.
So I try to use it in hierarchy, it work properly in different resolution, but not convenient to control.
So I want to know that which case to use which one of them will perform better.

UI: Positioning an element relative to another element with Scale With screen Size

PS. Dont place UI objects with scripts unless you absolutely have to! Use the UI tools, and set these within the editor.