Japan was really not intending to surrender. At all. The only other option was to invade Japan, but that would've causted thousands of lives on both sides, especially for Japanese civilians.
The U.S had no option but to use the nukes.
And besides, the point that there were no millitary bases and it was just for bombing civilians is not true.
Hiroshima had the head quarter of Japan's second army and was a communication center n' all that.
As for Nagasaki, they were extremely unlucky. Kokura was the original target, but most of the city was covered by clouds and it got in the way of the bombing, so they just bombed Nagasaki instead.
I agree that the nuke was a horrible thing, but it was necessary to end World War II. It really is basically being between a rock and a hard thing.