0%

Chapter 3

Where Python Is Not the First Choice

"Can It?" Is the Wrong First Question

Python can automate reports, run a web server, carry research data through an analysis, and coordinate AI tools. That range is real, and it sets a trap.

Once you learn that Python can do something, it is tempting to stop asking questions. But “can Python do this?” only helps when the answer is no. When the answer is yes, which it usually is, you have learned almost nothing about whether you should.

A van can get down a country lane. Whether it should depends on the lane, the load, and who is waiting at the other end.

Start from what the project needs

A requirement is something a project must do, or a condition it has to meet. Run on a phone with no internet connection. Fit into very little memory. Feel like it belongs on the device it is installed on.

Some requirements bend. A report that takes six seconds instead of five is still a report. Others do not bend at all.

So I do not choose a language by popularity. I start by asking what would make this particular project succeed or fail, and a few questions usually surface it:

Where does it have to run? A laptop, a browser, a phone, and a company server are different worlds, and the target often decides which tools are available at all.

What does a person see and touch? Python sits comfortably behind many interfaces. It is rarely the usual choice for building the interface itself.

How fast does it need to be? Ask for a number rather than “as fast as possible”, and ask what being late actually costs.

What already exists? A team with years of working software in another language is solving a different problem from someone starting fresh.

The same service, three settings

A company receives invoices and produces a daily report. The business rule never changes. Where people use it does.

On a server, this is a strong fit. Python’s document, data, and web tooling all point the same direction.

As a small desktop program for office staff, it is workable with tradeoffs. Python can build the window and run the report, but somebody has to package it for every system the team supports, which may be perfectly reasonable for forty known office machines.

As the main interface of a consumer phone app, it is usually not the first choice. There the interface is not part of the product, it is the product, and the phone platforms supply their controls, permissions, and release process through their own tools.

Notice what did not happen. Python did not get worse between those three. The project asked it to do a different job somewhere else.

That is oddly good news. You never have to defend one language everywhere. You only have to understand the job well enough to pick tools that help with it.

Python stays near the front of my list because it fits so many useful jobs, and I trust that recommendation more after saying plainly where I would choose something else. The next lessons do exactly that, starting with the part people actually touch.