It has been noted in Brussels that Mr Erdogan did not refer to the EU in his election victory speech. But after the fall of Greece, the Turks may well be thinking - and with some justification - that they are better off on their own.
On the Aegean Sea, a parable about economic sovereignty
Who would have imagined a generation ago that Greece would have sunk so low, and Turkey would be riding so high? Greece is practically bankrupt and its status as a sovereign nation in doubt. Just about every independent economist recognises that Greece is never going to repay its debts.
The agreement on Friday among the governments of the 17-nation euro zone to keep lending to Greece has bought some time, but there are no good outcomes for this crisis. The immediate issue is whether it can be dragged out long enough for the creditor banks to prepare themselves for the financial shock that comes, even if it is delayed a year or two.
If we look back to the 1980s, Greece seemed to be on a roll. It had joined the European Economic Community, later to become the European Union, and its position as the fountainhead of democracy was recognised. Development funds flowed in from Brussels, transforming the country's infrastructure and boosting living standards.
In 2001 it joined the euro, the common currency. And Greece looked forward to enjoying a good life of endlessly low interest rates.
The ominous rise in the cost of living that accompanied joining the euro zone was offset by successive governments borrowing from foreign banks as if there were no tomorrow. In 2004 it held the Olympic Games at a cost of $15 billion (Dh55 billion), leaving a legacy of waste and debt.
As for Turkey, Greece's rival across the Aegean Sea, in the 1980s it seemed a basket case: it suffered hyper-inflation, military coups and perennial unrest in Kurdish regions.
Yet only last week, Prime Minister Recep Tayyip Erdogan was re-elected for a third term. The economy is booming and after almost a century of isolation, Turkey's voice is now heard all over the Middle East. Indeed, in his victory speech Mr Erdogan could not resist reviving the ghost of the Ottoman empire.
The winners of the election, he said, were Sarajevo, Beirut, Damascus, Ramallah, Nablus, Jenin and Jerusalem just as much as the cities of Turkey itself. All these foreign places were part of the Ottoman empire and all have been, or are, subject to bitter battles over their identity or political future. If the High Gate of the Sultan's divan is once again going to cast its shadow over these trouble spots, then Turkey's ambitions really do know no bounds.
To list all the reasons why Greece is prostrate before the bankers would take too long. It is a story of European wishful thinking, of the primacy of the political ideal of building a European Union while ignoring harsh economic reality. In Athens, the too cosy political and media establishments are also to blame. No one blew the whistle in time.
It is easier to explain what went right with Turkey. As Turkey was emerging from its last period of military rule in the 1980s, a junior minister named Turgut Ozal set about transforming the economy in a way that would unleash the entrepreneurial spirit of the Turks, long confined by the centralised state that Kemal Ataturk bequeathed.
Under pressure from the International Monetary Fund, he dismantled the system of state-administered prices, the over-valued exchange rate and the subsidised public sector. The result was an export boom, which has turned Anatolian cities such as Kaysari into great manufacturing centres.
Mr Ozal, who later became prime minister and then president, may not have been the most attractive politician, but he knew which direction he wanted to take Turkey. His reforms set off a virtuous circle, creating a business-minded and outward-looking middle class.
The connection between wealth-creation and piety which was reinforced by his reforms bears some similarity to ways of thinking in the US. In the view of many researchers, it is a key factor in the rise of the new "Turkish model" of politics, based on moderate Islamic values in a prosperous and democratic Islamic setting. Mr Erdogan's Justice and Development Party is at the centre of this.
The lesson here is that Turkey relied on its own resources to cope with challenges. Turkey had some advantages: the shadow of a military government made it easier to set tough reforms in train. Turkey's relationship with the EU has given a spur to democratisation.
With hindsight it is clear that Greece was spoiled by joining the euro zone, with its artificially low interest rates. Successive governments in Athens got free access to the cookie jar of capital markets.
The punishment for losing control of your finances is to lose your sovereignty. The prime minister, George Papandreou, has to take dictation from the European Union, the European Central Bank, the IMF and - less visibly - from Germany. Foreign accountants and economists take up residence in the Greek finance ministry, like envoys from an imperial power.
This is nothing new: in the 19th century the ruler of Egypt, Ismail Pasha, could not pay his debts, and the Anglo-French bond holders moved in to take control of his finances. The European powers deposed Ismail Pasha in 1879, and Egypt became a British protectorate.
These days Greece is being forced to swallow a massive austerity package and agree to privatisations in the teeth of trade union anger, with living standards squeezed. The Greeks increasingly see their country as a colony of the EU's bigger powers.
The Greeks cannot escape responsibility for the debts their governments took on. But one has to feel some sympathy for them: if the debts cannot be repaid (which is undeniable) then why proceed with this austerity plan which no one believes is going to work? If the divided European leaders could work out a convincing plan, the Athens government would have something concrete to offer its people.
In the longer term, the EU leaders have to rethink what is the purpose of their bloc. If the bloc has a common currency then logically the stronger countries have to support the weaker ones, but Germany does not feel like subsidising the sunnier parts of the EU forever more.
As for Turkey, its application to join the EU, made by Mr Ozal in 1987, is still stymied. It has been noted in Brussels that Mr Erdogan did not refer to the EU in his election victory speech. But after the fall of Greece, the Turks may well be thinking - and with some justification - that they are better off on their own.