Minimal degree equations for curves and surfaces (variations on a theme of Halphen)