I'm a US citizen. Assume I have a webapp. I develop this app as I travel, have paying customers, etc. It doesn't matter I'm in the middle of nowhere Africa, because I'm accepting payments with Stripe into a US-based business checking account, which I then run payroll from into a US-based personal checking account. I then pay my taxes electronically from this account.
In that case, your taxes are pretty straightforward.
It depends heavily on the tax laws of the countries in which you are traveling, the type of work you perform, and the amount of such work in proportion to work performed elsewhere.
There's a reason that so many multinational companies hold their board meetings in the Caymans, with a quorum of directors physically present. It's not because the Caymans are a great vacation destination (they are) but because they must hold the board meetings there to satisfy location requirements arising from the company's tax structure. (See e.g., the Dutch Sandwich structure and the Double Irish structure.)
How would you suggest they treat it as income if your business is incorporated in US (Delaware preferably)? It doesn't become foreign income based on where you wrote the code.
Also, how are countries in South America or Africa going to know where your business income is derived from when all your financial transactions occur with the US?
In practice, most countries require a certain "level" of activity to subject a foreign enterprise to taxation (i.e., the US and all EU nations). And at any rate, we have treaties with most countries worth visiting which generally define the type and extent of activities that could give rise to taxation in the foreign country (see, e.g., "permanent establishment"). Thus, it is unlikely that simply writing some code for your app in the EU would result in an EU nation trying to tax your app's income.
However, not all nations require a substantial threshold before they try to tax business activity. Such countries will tax income arising from any activities performed in that nation by a foreign entity. (For example, Peru and Venezuela have both generated headlines about this recently.) Worse, these countries will frequently try to lay claim to all of the income that arises from the activity, even if only a minor portion of it can be "sourced" to activities performed in that country. This isn't usually a problem for a US resident/company--U.S. courts won't enforce such foreign tax levies--however, many nations are willing to enforce the tax levies of other countries. Netherlands, in particular, is a danger on this front. The Netherlands has friendly relations with a good many countries which the US is not friendly with, and a Dutch judgment enforcing a foreign tax lien stands a good chance of being enforced by other member nations of the EU.
As for your second point: say you blog about how you traveled while coding the app...or you give an interview to that effect. All it takes is one person in that country's tax authority to stumble upon the blog post/interview, and they'll try to go after you. (This doesn't mean they'll go as far as seeking a judgment, or that such a judgment would succeed, but foreign legal difficulties aren't something you'll ever want to deal with if you plan on letting your app get acquired.
I guess it might seem a bit shady, but since you're working on your laptop with no help/input from the host country (consider the laptop a "tunnel" back to your home country or wherever your company is registered), why would you bother to go through all the bullshit required to get actual work visas everywhere (the bureaucracy is really nuts).
Besides, you pay local taxes when you shop, rent an apartment, etc.
I.e., for example, if you code a $1 million project for a client, half in the US and half while traveling in France, you could owe France income taxes on 50% of that 1 million. (However, if that income is also taxable in the U.S., you generally would be protected from double-taxation by virtue of the tax treaty between the two nations.)
Moreover, depending on the amount of time spent working in a country, you could be in violation of your visa, which could result in civil or criminal sanctions (most likely fines, but possibly including revocation of your visa).
This issue is a very real concern, and multinational companies go to great lengths to avoid dealing with it. The EU has been aggressive about auditing companies on this issue, going so far as to demand detailed records about the physical location of directors during board meetings or about company operations conducted by traveling employees.
Some places are pretty easy to get extended visas and they look the other way if you have money in the pocket.