At the Rabaa Al Adawiya encampment days before it was broken up, I stood as one of a few secular souls amid thousands of supporters of the ousted Egyptian president, Mohammed Morsi. I pondered a question I had repeatedly asked myself: what exactly is the point of an Islamist project in a Muslim society?
After all, Egypt already implements Sharia in its personal and family law, with all the gender bias and other inequalities that the law involves. And there is absolutely nothing to stop a devout Muslim from practising the facets of his or her faith. On the contrary, Egypt has no civilian family courts for those who wish to lead their personal affairs according to modern, secular standards. Moreover, though freedom of expression is a constitutional right, this freedom has been severely curtailed in recent years by the obscure, vague and novel legal concept of "insulting religion".
But does centuries-old Islam, the world's second largest religion, really need self-appointed defenders to shield it from "insult", when the Quran itself welcomes doubt, questioning and even derision?
Why do these self-appointed defenders of the faith contradict the example of Prophet Mohammed whom they claim to emulate? For instance, Prophet Mohammed pardoned one of his critics, Abdullah Ibn Saad, even after he claimed that the Quran was invented and that Mohammed was a false prophet.
These examples highlight how Islamism, rather than offering a solution as it claims, is actually built on illusions.
Islamist discourse, on the whole, holds that the reason for the Muslim world's decline is its deviation from Islamic law and values. That explains why the Muslim Brotherhood founder, Hassan Al Banna, despite his attempts to inject some elements of modernity into traditional Islamic thought, fixated on questions of morality and Sharia. One of his ideological descendants, Sayyid Qutb, went so far as to accuse Muslim societies of living a period of modern "jahiliyyah" (pre-Islamic ignorance), a dangerous concept that has been used to justify violence against Muslims.
But by misdiagnosing the malaise afflicting society, Islamists have prescribed the wrong medicine, with its severe and debilitating side effects.
Any objective, dispassionate reading of Islamic history reveals that Islam's former glory was actually built on a largely secular foundation. In addition, the start of its decline coincided with the victory of rigid dogma and orthodoxy, represented by the likes of Ibn Taymiyyah in the 14th century - considered the father of Salafism - over reason and intellect.
Prophet Mohammed himself never established anything resembling what we would call today an "Islamic state". His secular-leaning "Constitution of Medina" defined Jews, Christians and pagans - members of Medina's society - as being full and equal members of the Ummah.
During what is widely regarded as Islam's "golden age", the political and social mechanisms governing the lives of Muslims were generally secular. Though the Umayyad and Abbasid caliphs derived their claim to legitimacy from Islam, they were essentially secular rulers presiding over secular governments. They were autocratic, not theocratic.
In fact, the caliphs' honorific title "commander of the faithful"suggests that they derived their authority from their Muslim (and other) subjects and not from Islam per se. Moreover, enlightened caliphs were derided by conservatives and traditionalists as immoral and decadent. Take Harun Al Rashid, the fifth Abbasid caliph, as an example. Under his rule, science, culture and arts flourished despite the clergy's disapproval of the company he and his libertine son, Al Amin, kept, including the controversial court poet Abu Nuwas, considered the greatest poet of his time.
Free-thinking philosophy also flourished during this era, both under the Abbasids and the Umayyads. For example, the rationalist school of Al Mu'tazila held that rationality, expressed through reasoned debate known as "kalam", is the "final arbiter" that trumps "sacred precedent".
In such a climate, it is unsurprising that disbelief was accepted and that sceptic scholars, such as Ibn Al Rawandi in the 10th century, were published - only for their works to be destroyed by later, less tolerant generations.
The reasons for Muslim empires' subsequent decline are manifold: the loss of dominance over global trade, the Mongol invasions, intellectual stagnation, infighting, factionalism, colonialism and more. But deviation from some imagined "pure" moral state is not one of the factors. Belief in this illusory mirage will delay effective reform.
In the 21st century, the system that encompasses the spirit of past Muslim successes is enlightened secularism. That might explain why the renowned 19th-century Egyptian reformer Muhammad Abduh once said that, in France, he saw "Islam without Muslims".
Khaled Diab (www.chronikler.com) is a Belgian-Egyptian freelance journalist
On Twitter: @DiabolicalIdea