Qadr, Free Will, and the Things We Cannot Control

One question that completely changed my life.

Uqie Rachmadie

Uqie Rachmadie

8/3/2026 · 18 min read

Qadr, Free Will, and the Things We Cannot Control

One Question

There’s one question about destiny had always bothered me.

If Allah has already written everything, then what exactly am I choosing?

At first glance, it sounds like a contradiction.

If my career, failures, relationships, decisions, and even the smallest events are already known and decreed by Allah, why should I bother making an effort? Why study for an exam? Why prepare for an interview? Why make plans at all?

As someone who spends a lot of time writing software, I sometimes find myself approaching this question through a rather strange doorway: systems engineering.

Software is full of things that are defined beforehand and things that only become apparent when the system is actually running. There is configuration, but there is also runtime. There are known constraints, but there are also inputs we cannot predict. There are failures we can prevent and failures we simply have to deal with.

Of course, Allah is not a computer program, and qadr is not some giant piece of source code.

The analogy has limits.

But thinking this way has helped me understand one practical point about qadr:

I don't need to know what has been written for me in order to be responsible for what I choose today.

That distinction is, I think, where the Islamic understanding of destiny becomes much more interesting.


Qadr: The part of reality we cannot see

In Islam, qadr (قدر) refers to Allah's decree and determination of everything that happens. Allah's knowledge encompasses the past, present, and future.

The Qur'an says:

مَآ أَصَابَ مِن مُّصِيبَةٍۢ فِى ٱلْأَرْضِ وَلَا فِىٓ أَنفُسِكُمْ إِلَّا فِى كِتَـٰبٍۢ مِّن قَبْلِ أَن نَّبْرَأَهَآ

This is a serious statement.

Nothing is outside Allah's knowledge. Nothing catches Him by surprise. Our lives aren't a series of events that Allah discovers as they happen.

But there is another side to the picture.

Free will: Our choices are still real

The Qur'an says:

وَمَا تَشَآءُونَ إِلَّآ أَن يَشَآءَ ٱللَّهُ ۚ إِنَّ ٱللَّهَ كَانَ عَلِيمًا حَكِيمًا

Notice something easy to miss.

The verse doesn't say, “You don't will.”

It says, “You do not will unless Allah wills.”

There is still a human will.

This is important because Islam does not teach us to live as though we are puppets being dragged from one event to another. At the same time, it also does not teach that human beings operate independently of Allah.

Mainstream Sunni theology holds these two truths together:

Allah is the ultimate Creator and Knower, and human beings genuinely choose and act.

Exactly how divine decree and human choice coexist is part of the unseen. We shouldn't pretend that a software analogy, a philosophical argument, or even a clever thought experiment can completely unpack it.

Sometimes the honest answer is simply: there are things about Allah's reality that are beyond our categories.

Responsibility: Qadr isn't an excuse

This becomes clearer when we look at how the Qur'an talks about our actions.

فَمَن يَعْمَلْ مِثْقَالَ ذَرَّةٍۢ خَيْرًا يَرَهُۥ ۝ وَمَن يَعْمَلْ مِثْقَالَ ذَرَّةٍۢ شَرًّا يَرَهُۥ

If our choices were meaningless, accountability would make little sense.

The Prophet ﷺ also addressed this question directly.

When the companions asked about what had already been decreed, the Prophet ﷺ said:

اعْمَلُوا فَكُلٌّ مُيَسَّرٌ لِمَا خُلِقَ لَهُ

The instruction is remarkably practical:

Act.

Not: sit around trying to figure out your destiny.

Not: stop making decisions because everything is already written.

Act.


Analogies

This is where my profession gives me a few useful metaphors.

Again, these are metaphors—not theological explanations.

Configuration vs. runtime

When I deploy an application, there are things defined before the application starts.

Environment variables. Database configuration. Infrastructure. Dependencies. Permissions.

But once the application is running, requests still arrive one by one.

The application doesn't have access to some magical file containing every request it will receive tomorrow.

Neither do we have access to the complete future.

From our perspective, life happens one moment at a time.

---
config:
  look: handDrawn
---
flowchart LR
    A["Allah's decree
and complete knowledge"] --> B["Unknown to us"] B --> C["Present moment"] C --> D["Our choices"] D --> E["Our actions"] E --> F["Consequences"] F --> C

The difference is crucial.

Allah knows the entire reality. We don't.

So from our side of the equation, we still have to make decisions with the information available to us.

That is why “it's already written” isn't a useful excuse for doing nothing.


Deterministic doesn't mean meaningless

In computer science, a deterministic system can produce predictable results from a given state and input.

But that doesn't mean the operations happening inside the system are imaginary.

Likewise, Allah's prior knowledge of my decision doesn't mean I experienced that decision as a meaningless illusion.

When I sit in front of two choices, I actually deliberate.

I consider the consequences.

I want one thing more than another.

Then I choose.

That choice matters.

The theological mistake would be to assume:

“If Allah already knows what I'll choose, then I cannot really be choosing.”

Knowledge and compulsion are not the same thing.

Someone knowing what you will do is not, by itself, the same as forcing you to do it.

And Allah's knowledge is obviously far beyond human prediction anyway.


Error handling

This is probably my favorite analogy.

When something breaks in production, there are usually two very different questions:

What can I learn from this?

and

What was outside my control?

Suppose an API suddenly starts returning errors.

I don't say:

“Well, it was destined.”

I check the logs.

I inspect the deployment.

I look at the database.

I reproduce the bug.

I fix what I can.

If the problem came from an external service that I genuinely couldn't control, I accept that part too.

The Prophet ﷺ gave remarkably similar practical guidance:

احْرِصْ عَلَى مَا يَنْفَعُكَ، وَاسْتَعِنْ بِاللَّهِ، وَلَا تَعْجِزْ

There are three pieces here that I really like:

Be keen.

Ask Allah for help.

Don't give up.

That doesn't sound like fatalism.

It sounds like responsibility with tawakkul.


Observability and logging

Modern software systems rely heavily on observability.

We collect logs, metrics, and traces because we want to understand what happened.

But there's a funny limitation:

You cannot inspect tomorrow's logs today.

You only get them after the event.

Human beings are in a similar position with qadr.

We don't get to open some hidden dashboard and inspect next month's events.

So obsessing over “what Allah has written for me” isn't particularly useful.

The useful question is:

Given what I know right now, what is the right thing to do?

That's a much more actionable question.


“I didn't get the job. Maybe it wasn't meant for me.”

Maybe.

But that sentence should come after you've honestly looked at your own effort.

Did you prepare?

Did you practice?

Was your portfolio good enough?

Did you communicate well?

Could you have done something differently?

If yes, learn from it.

Then accept the outcome.

Qadr should help us avoid two unhealthy reactions.

The first is arrogance:

“I got this job because I'm simply better than everyone.”

The second is despair:

“I failed, therefore I'm worthless.”

Neither is particularly healthy.

You can work hard without believing you control everything.


“My project failed.”

This one is painfully familiar to developers.

Maybe you built something nobody wanted.

Maybe your architecture was over-engineered.

Maybe you misunderstood the requirements.

Maybe your server died at exactly the wrong moment.

A good engineer performs a postmortem.

What went wrong?

What was preventable?

What wasn't?

What should we change next time?

That attitude fits remarkably well with qadr.

Learn from what you could control. Accept what you couldn't.

Qadr shouldn't prevent reflection.

It should prevent reflection from turning into endless regret.


“What if I make the wrong decision?”

This is probably where qadr becomes especially comforting.

We often imagine that there is one perfect decision hidden somewhere in the future, and if we make the wrong move, we've permanently ruined our lives.

But we don't have that kind of knowledge.

We make the best decision we can with the information we have.

We consult people.

We think.

We pray istikhara when appropriate.

We consider the consequences.

Then we move.

Afterward, if things don't go as expected, we learn and continue.

We don't get to replay life with unlimited checkpoints.

And perhaps that's part of what tawakkul teaches us.


What Frankl, Taleb, and Algorithms to Live By Can Teach Us

These writers aren't authorities on Islamic theology, so their books shouldn't be treated as evidence for qadr.

Still, I find some of their ideas useful for thinking about uncertainty.

Viktor Frankl, in Man's Search for Meaning, wrote about the possibility of choosing one's attitude even when circumstances cannot be changed.

The idea resonates with something important in Islamic spirituality: we don't always control what happens, but we remain responsible for how we respond.

Frankl's point isn't identical to the Islamic concept of sabr or tawakkul, but there is a useful overlap.

Then there's Nassim Nicholas Taleb and his idea of antifragility.

Some things don't merely survive uncertainty; they become stronger because they encounter it.

That makes me think about character.

A person who has never experienced failure may look confident, but confidence hasn't really been tested yet.

Difficulty can expose weaknesses.

It can force us to become more patient, more realistic, more dependent on Allah, and less impressed with our own plans.

Again, this isn't to say that every bad event automatically makes us better.

Sometimes we become bitter instead.

The point is that our response to uncertainty can shape us.

And then there is Algorithms to Live By by Brian Christian and Tom Griffiths.

One of the book's recurring ideas is the balance between exploration and exploitation.

When you don't know enough, explore.

Try things.

Collect information.

Once you have enough information, use what you've learned.

That sounds remarkably close to how many of us actually navigate our twenties.

We don't know exactly what career we want.

So we experiment.

We build projects.

We take internships.

We change technologies.

We meet people.

We fail at things.

Eventually, patterns emerge.

And perhaps that's a healthier way to think about the future.

You don't need to know the destination to make a good decision at the next intersection.


Concise Takeaways

If I had to compress the whole discussion into a few points, I'd keep these:

  1. Qadr means that Allah knows and has decreed everything that happens.
  2. Human beings still have real will and are accountable for their choices.
  3. We don't know the unseen decree, so we shouldn't use it as an excuse for passivity.
  4. Before an outcome: make plans, work hard, make du'a, and take the available means.
  5. After an outcome: learn from your mistakes and accept what was outside your control.
  6. Qadr doesn't eliminate responsibility; it puts a boundary around our sense of control.
  7. Software metaphors can help us think about qadr, but they can never fully explain it.

As a developer, I think about it this way:

I can write the code carefully, test it thoroughly, monitor the system, and still not control everything that happens in production.

Life is obviously much bigger than software.

But the analogy leaves me with a useful habit:

Do your part seriously. Ask Allah for help. Then let go of the illusion that you control everything.

Maybe that's one of the quieter meanings of tawakkul.

Not giving up.

Not pretending that effort doesn't matter.

But doing what is within your reach and being at peace with the fact that the entire system was never yours to control in the first place.


Three Reflection Questions

  1. Which parts of my current life are actually within my control?
  2. When something goes wrong, do I examine my own mistakes before calling it “qadr”?
  3. Can I work seriously toward my goals while still accepting that the final outcome belongs to Allah?

Short Bibliography

  • The Qur'an — especially Qur'an 13:11, 54:49, 57:22, 76:30, and 99:7–8.
  • Sahih al-Bukhari, Book of Divine Will (Al-Qadar), including Hadith 4949.
  • Sahih Muslim, Book of Destiny, Hadith 2664.
  • Viktor E. Frankl, Man's Search for Meaning.
  • Nassim Nicholas Taleb, Antifragile: Things That Gain from Disorder.
  • Brian Christian & Tom Griffiths, Algorithms to Live By: The Computer Science of Human Decisions.
  • Ibn Abi al-'Izz al-Hanafi, Sharh al-'Aqidah al-Tahawiyyah — a major classical Sunni exposition of Islamic creed, including qadr.