AI can code. Why do we still need software engineers?
AI can write code, but who decides what software should do? A ticket-selling example explains context, stakeholders, trade-offs, algorithms, and system design.

Mục lục
Suppose you are organizing a performance. Someone quickly builds a ticketing website for you: customers choose a seat, enter their name, and transfer money. But how long should a seat be held before payment arrives? Can someone whose transfer arrives late still attend? The website might be finished before those questions have answers.
AI can write code, but a software engineer’s job is not just writing code. Engineers also need to understand what the event requires, talk to the people responsible, and choose a suitable approach. AI helps write programs and brainstorm options. Those contributions are useful, but they do not replace all the work involved in making a service operate.
You do not need to know programming to see the distinction. Let us start with selling tickets using a notebook, then move to a computer. That will show how one seat can be sold to two people, and why writing more code is not necessarily the first thing to do.
Is someone keeping the records enough to start selling tickets?
Selling tickets by hand, you might draw a table: customer name, seat number, and whether payment has arrived. Having someone fill it in saves effort. But that person still needs to know when a ticket counts as sold.
A customer calls to reserve a seat and says they will transfer the money later. Do you mark the seat as sold, or leave it available for someone else? Another customer wants to change seats. Do you allow that immediately, or first check the payment already received?
These questions are not about neat handwriting or fast recordkeeping. They concern how you organize ticket sales. Whether you use paper, a spreadsheet, or a website, everyone needs rules they can follow consistently.
Code is a set of instructions telling a computer what to do. It can tell the computer to hold a seat, record a payment, and send a ticket. Before writing those instructions, though, someone needs to clarify when to hold, when to send, and when to refuse.
That is part of a software engineer’s, or developer’s, job. Engineers do more than turn clear requests into programs. They also work with the people making those requests to identify what remains unclear and how to resolve it.
Getting AI to write the recordkeeping code quickly does not settle the ticketing rules. Similarly, asking someone to draft a contract does not mean both parties have agreed on the price and delivery date. A tool can help draft a proposal; the agreement still needs to be worked out.
Why not use the same approach for every ticket sale?
A small performance for acquaintances might let guests pay at the door. A busy event where everyone wants a seat near the stage might require reservations and advance payment. The same “Book a ticket” button does not necessarily imply the same process behind it.
That is context: the surrounding circumstances that make a choice suitable or unsuitable. Cooking for your family differs from cooking for guests with food allergies. Knowing the recipe is not enough; you also need to know who will eat and what to avoid.
In our ticketing example, developers need to know how customers usually pay. If many people make bank transfers and send screenshots of receipts, the software must support that reconciliation process. A design that assumes instant payment confirmation might not solve the actual problem.
They also need to know who will run the service. If only one person answers the phone, a process requiring them to call every customer back should not be the default assumption. If the organizer has already promised seat changes, the new software cannot simply discard that promise because doing so is easier.
AI can read documents and suggest questions we have missed. But someone still has to ask about information that was never written down. Older information also needs checking with the people doing the work today.
Understanding context therefore involves more than reading a specification. It means finding out where customers struggle, how the organization currently works, and what must not change. Sometimes, after asking those questions, an engineer realizes the problem to solve differs from the original request.
When sales and recordkeeping pull in different directions
Continuing our hypothetical example, the person responsible for sales wants to hold seats long enough for customers to transfer money. The person tracking availability wants abandoned seats released quickly. The accountant needs a way to handle money that arrives after a seat has been given to someone else.
These are stakeholders: people with interests or responsibilities connected to the service. The term need not sound remote. At a catered dinner, the person ordering the food, the kitchen, and the servers also have needs that must be coordinated.
Each side has a reasonable concern. Longer holds help customers currently buying, but later customers may see a sold-out event even though many reservations will be abandoned. Shorter holds let seats sell again sooner, but someone who has transferred money may return asking why their seat is gone.
Engineers need to clarify this conflict, rather than accept every request and add a button for each one. They might explain that releasing a seat before payment is confirmed requires a way to reconcile and resolve late payments. Avoiding that situation means choosing another payment method or accepting longer holds.
This is where discussion needs to lead to a decision. Engineers explain technical consequences and make recommendations; the product owner and other teams agree on priorities. Engineers do not decide everything for everyone, but neither do they simply wait for a perfect specification.
AI can help prepare questions and brainstorm approaches. Like having someone help list possible table arrangements before a dinner, it expands the options. But a suggestion on a screen is not an agreement among the people who must implement it and live with the consequences.
Hold seats longer or release them sooner: neither gives you everything
Consider two options: hold a seat for 5 minutes or for 15 minutes. These are hypothetical durations for comparison, not recommendations for a real service. Either choice brings benefits and costs.
A 15-minute hold gives customers more time to open their banking app and transfer money. But if they leave, the seat remains reserved while someone else wants to buy it. A 5-minute hold returns the seat to sale sooner, but a slower customer may have to book again.
That is a trade-off. It is like a restaurant accepting more tables: it can serve more guests, but without more kitchen staff, everyone may wait longer. Looking at one benefit alone does not identify the best option.
| If you prioritize… | You might choose… | But you need to accept… |
|---|---|---|
| Giving customers time to pay | Longer seat holds | Later customers wait for seats that may be abandoned |
| Reselling abandoned seats sooner | Shorter seat holds | Customers who pay slowly are more likely to lose their reservation |
| Opening sales sooner with a simple reconciliation process | Staff manually check unmatched payments | Staff workloads grow as orders increase |
A reasoned decision depends on context. Where are customers getting stuck? Is someone available to handle unmatched payments? Would the organization rather accept longer waits or more reconciliation work?
Sometimes the appropriate decision is to do less. If seat changes after payment have not been worked out, the team may agree not to offer that feature in the first version. Delivering less with a clear explanation differs from promising everything and failing to deliver.
AI can list advantages and disadvantages and write either implementation. Engineers need to evaluate them, work with others to choose, and follow the consequences once the service is in use. Producing an option is one task; deciding which option to use is another.
AI writes code. Where do engineers still come in?
Once the seat-hold policy is agreed, we can ask AI to write the timer and release seats when their holds expire. It can also help build the seating page, draft notifications, and suggest additional situations to handle. There is no reason to type everything by hand to prove an engineer’s value.
Some tools can also read program files, run them, and revise the code in response to errors. AI can therefore help find problems and write checks, not just complete a line. Doing those tasks still differs from replacing the developer’s entire role.
One useful distinction is to ask: are we producing a way to do something, or deciding which way fits? AI helps generate and analyze options. Engineers need to place them in real circumstances, discuss them with stakeholders, and make reasoned recommendations.
If AI suggests releasing seats after 5 minutes, the question does not end with whether the program counts 5 minutes correctly. Can customers pay in time? How will late payments be handled? Who agreed to that rule? A single number in the code can carry an entire business decision behind it.
Engineers can misunderstand things or choose poorly too. What we need is not faith that people are always right, but a way to check decisions. GitHub’s documentation likewise tells users to review and test Copilot suggestions before using them[4].
What gets harder when the notebook becomes a website?
A person keeping a notebook can serve customers one at a time. A website, however, can receive requests from many people at once. At that point, even a rule as simple as “sell if tickets remain” can be carried out incorrectly.
Imagine two staff members selling the last ticket. The first checks the notebook and sees one remaining. Before they mark it as sold, the second sees the same entry. Both promise the ticket to their customer.
On a computer, that can look like the sequence below. This is a simplified model that leaves out payments and reservation expiry:
| Step | Customer A’s request | Customer B’s request |
|---|---|---|
| 1 | Read the record: 1 ticket remains | |
| 2 | Read the record: 1 ticket remains | |
| 3 | Write 0 remaining, report a successful purchase | |
| 4 | Write 0 remaining, report a successful purchase |
The record ends at zero. Each request subtracted one from one; neither calculation was wrong. Yet two customers have been promised tickets for a single seat.
In engineering, this is a race condition: the outcome depends on how the steps interleave. Two people looking at the same notebook entry make the problem visible. No machine needs to break, and no customer needs to click the wrong button. Two pieces of work just need to meet in that gap.
Engineers must turn the promise “do not sell more seats than exist” into something the software actually maintains. Asking AI to write “if tickets remain” is insufficient if we have not considered simultaneous purchases. This is the step from understanding a need to understanding how a computer carries it out.
If a trial purchase works, are we ready to open sales?
You buy a ticket successfully. Then you try again and see a sold-out message. If that is the only sequence you test, the simultaneous-purchase problem might stay hidden. Two purchases made in turn differ from two purchases whose steps interleave.
Testing is like rehearsing ticket sales before opening day. We deliberately create situations and compare the outcome with what was agreed. For the last ticket, the requirement is that only one customer receives confirmation, not merely that the remaining count looks right.
If a test only asks “does the record contain a negative number?”, our double-selling example still passes. The record says zero, exactly what the check allows. The test has missed the most important promise.
AI can suggest more scenarios and write programs to run them. But if both the implementation and its tests share an incomplete understanding, they can agree with each other and still be wrong. Expected results must therefore come from the agreed rules, not just repeat what the code currently does.
Other everyday questions remain. Can customers see someone else’s tickets? Who can issue refunds? If a staff member changes an order by mistake, can we reconstruct what happened? These need checking even when the website looks normal.
After sales open, someone also needs to know who gets notified when payments and tickets do not match. Without a resolution process, a software error becomes a customer’s phone call. Working software is a first step; a working service also needs ways to detect and handle problems.
Why learn algorithms if AI can write them?
We have now seen what developers do beyond writing code. Only now do we look further into the code itself: different ways of doing the same task can require different amounts of work. This happens with manual work too, not just computers.
Suppose you have a stack of tickets and want to find duplicate seat numbers. One approach is to compare each ticket with every ticket after it. With four tickets A, B, C, and D, compare A with B, C, and D; then B with C and D; finally C with D. That makes six pairs.
Another approach is to read each ticket and mark its seat number on a separate list. If you encounter a number already marked, you have found a duplicate. You avoid repeating all those pairwise comparisons, but need somewhere extra to keep the marks.
An algorithm is an arrangement of steps for solving a task, like those two ways of checking tickets. On a small list, the difference may not matter much. On a large one, organizing the work can matter more than how quickly each individual step is written.
Comparing every pair takes 499,500 comparisons for 1,000 tickets and 4,999,950,000 for 100,000 tickets. These are pair counts calculated from hypothetical input sizes, not measured computer speeds. The ticket count increases 100-fold, while the number of pairs increases roughly 10,000-fold.
On a computer, a common tool for the marking approach is a hash set. Imagine filing compartments selected by a code, usually letting you check whether that code exists without searching the whole stack. It needs extra memory, and its speed still depends on the data and implementation.
Engineers need to understand the difference to assess AI’s proposals. Is the approach correct? How does the work grow as more tickets arrive? Is there enough storage? It is like using a calculator: the device multiplies for you, but you still need to know whether you are calculating area or perimeter.
The article on binary search and database indexes explains more about organizing information to avoid searching from the beginning. Here, another distinction matters: finding duplicate tickets after a sale detects a problem, but does not prevent two customers from being promised one seat. Prevention requires changing how the parts coordinate.
System design: who keeps records, collects money, and sends tickets?
At a ticket counter, we need to assign who records seats, who collects money, and who hands out tickets. Everyone must work from consistent information. The cashier cannot simply keep collecting payments if the recordkeeper has assigned the seat to someone else.
System design does something similar for software: choosing where information lives, dividing the work, and defining how the parts coordinate. It is not just drawing lots of boxes on a diagram. The aim is for the whole service to keep its promises.
For the last seat, one approach is to make checking and reserving it inseparable. Think of a staff member having to mark the seat before the next person can decide to sell that same seat. Two requests must not both act on information that has become outdated.
The program’s “notebook” is often a database, an organized store of information. PostgreSQL is one piece of software that does this job. It supports updating a seat on the condition “reserve only if it is still available,” and tells the caller whether a reservation actually succeeded[5].
The important point is that the later request must consider the seat’s state after the earlier request’s change. A previously read “seat available” is not a guarantee. Placing a read and a write close together in the code is not enough; the data-handling mechanism must actually protect that rule.
The money is gone, but the website is still waiting
Suppose a seat is reserved, the customer clicks to pay, and the connection drops. Perhaps the request never arrived. Or perhaps the money was taken, but the response never came back. A spinning indicator does not tell us which happened.
If the request is sent again, the service needs to recognize the same payment. Like a customer presenting the same receipt again, this should not be treated as a new purchase requiring another charge. Allowing a retry without producing the same effect again is called idempotency. Stripe, a payment service, provides a way to recognize repeated requests under specific conditions[6].
That addresses retries; it does not guarantee that money and seats match through every failure. Engineers still need ways to reconcile them and handle information that arrives late. The article on retrying a payment without charging twice explains this in more detail.
The ticket email can arrive after payment confirmation. But an email failure should not turn a sold seat back into an available one. Choosing which work must finish first and which can happen later is another design decision. The article on Kafka and RabbitMQ explores handing work to other parts of a system.
You do not need to memorize the tool names to grasp the point: each part doing its own job correctly does not guarantee that the whole service does the right job. Someone needs to understand an order’s journey and decide how those parts connect.
How much faster does AI make the work, and which work is being measured?
A study published in 2023 asked developers to write a JavaScript program that receives and responds to web requests. The group using GitHub Copilot completed the task 55.8% faster than the control group, according to the report[1]. This is evidence of acceleration on a clearly scoped task.
But writing something new differs from changing software already used by many people. Building a new ticket counter differs from renovating one that is still selling tickets, where existing reconciliation procedures and commitments must be preserved. Things not fully written into the task description can require substantial effort.
In a study METR published in 2025, 16 open-source developers worked on projects they knew well. With early-2025 AI tools, completion time increased by 19%[2]. That historical result should not be used to conclude that today’s AI slows developers down.
In February 2026, METR reported that newer data suggested speedups but did not support a reliable estimate. Part of the difficulty was that people unwilling to work without AI might not participate; the tasks submitted could also be selectively chosen. METR itself warned that the old findings no longer reflected the current impact[3].
Those numbers do not tell us how many people will lose their jobs. They remind us to distinguish finishing a piece of code from completing a job. Clarifying needs, agreeing on an approach, checking it, and putting it into use are also part of that time.
What should someone learning programming learn?
You still need to read programs, understand how information changes, and know how to find errors. You do not have to write every line yourself, but need to follow what the computer is doing. If someone keeps the records for you, you still need to read the notebook to see who received which ticket.
You also need to practice asking before building: who will use this, what problem do they need solved, and what must never go wrong? For each option, ask what you gain and what you must accept. That connects technical knowledge with actual work.
AI can brainstorm options, explain code, and create checks with you. One useful approach is to ask it to state its assumptions, then compare them with what you have learned. When an outcome differs from expectations, look for the cause rather than repeatedly asking for rewrites until the screen reports success.
There is no basis for promising that every programming role will remain unchanged. Work may shift as more tasks are automated. But “AI can write code” and “we no longer need people to clarify, decide, and take responsibility for a product” are still two different claims.
Try simulating a ticket sold to two people
The model below enumerates every way to interleave A’s two steps with B’s two steps. Within each request, reading always precedes writing. There are six valid orders; four let both requests read one remaining ticket and both receive it. The code produces Figure 1 exactly.

You only need Python and matplotlib. Run the program from the directory where you want the output saved; it creates a relative image path. There is no randomness, so no seed is needed.
from itertools import combinationsfrom pathlib import Pathimport matplotlibmatplotlib.use('Agg')import matplotlib.pyplot as plt
# Exhaustive enumeration uses no randomness, so no seed is needed.rows = []for a_positions in combinations(range(4), 2): steps, seen, sold, stock, count = [], {}, [], 1, {'A': 0, 'B': 0} for pos in range(4): who = 'A' if pos in a_positions else 'B' count[who] += 1 if count[who] == 1: seen[who] = stock steps.append(f'{who} reads {stock}') else: if seen[who] > 0: stock = seen[who] - 1 sold.append(who) steps.append(f'{who} writes {stock}' if seen[who] > 0 else f'{who} declined') rows.append(steps + [str(len(sold)), 'SOLD TWICE' if len(sold) > 1 else 'Correct'])assert sum(row[-1] == 'SOLD TWICE' for row in rows) == 4assert all(row[-2] == '2' for row in rows if row[-1] == 'SOLD TWICE')
fig, ax = plt.subplots(figsize=(13, 7.6), facecolor='#f6f4ef')ax.set_facecolor('#f6f4ef')ax.axis('off')ax.text(0, 1.02, 'One ticket, two customers: order changes the outcome', transform=ax.transAxes, fontsize=20, weight='bold', color='#20252d')ax.text(0, .94, 'Separate reads and writes: two steps per customer, six valid interleavings.', transform=ax.transAxes, fontsize=12, color='#4c5563')table = ax.table(cellText=rows, colLabels=['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Tickets sold', 'Result'], cellLoc='center', bbox=[0, .37, 1, .51], colWidths=[.17, .17, .17, .17, .13, .19])table.auto_set_font_size(False)table.set_fontsize(11)for (r, c), cell in table.get_celld().items(): cell.set_facecolor('#e6e9ed' if r == 0 else '#f6f4ef') cell.set_edgecolor('#c1c6ce') cell.set_linewidth(.7) cell.get_text().set_color('#20252d') if r == 0 or c == 5: cell.get_text().set_weight('bold')ax.text(0, .27, 'Checking and reserving are one indivisible step:', transform=ax.transAxes, fontsize=13, weight='bold', color='#20252d')ax.text(0, .18, 'A before B → A gets the ticket, B is declined | B before A → B gets the ticket, A is declined', transform=ax.transAxes, fontsize=12, color='#20252d')ax.text(0, .06, 'Sold twice: 4/6 orders with separate steps; 0/2 with a combined step.\n' 'These are not error probabilities or measurements of a real ticketing system.', transform=ax.transAxes, fontsize=11, color='#4c5563', linespacing=1.6)fig.subplots_adjust(left=.04, right=.98, top=.9, bottom=.04)output = Path('images/ai-viet-code-can-lap-trinh-vien')output.mkdir(parents=True, exist_ok=True)fig.savefig(output / 'sau-thu-tu-en.png', dpi=160, facecolor=fig.get_facecolor())plt.close(fig)for row in rows: print(' | '.join(row))print('Sold twice: 4/6 orders with separate steps; 0/2 with a combined step.')When run, all four double-selling rows confirm two tickets despite starting with only one. This is an enumeration within the model, not a measurement of a real database. The orders are not necessarily equally likely, so we cannot say a website has a two-thirds failure probability.
The “combined step” part of the figure is a rule-based comparison: the first customer gets the ticket, and the next finds none remaining. The code only simulates separate reads and writes; it does not verify PostgreSQL, payments, or a real locking mechanism. Testing a product requires additional checks on that product’s actual implementation.
Back to the performance that needs tickets sold
The organizer needs more than a page with a seat-selection button. They need paying customers to receive the right seats, staff to know how to resolve mistakes, and everyone involved to understand what was agreed. The website is part of that work, not all of it.
Software engineers connect those needs with the way computers operate. They investigate context, talk to stakeholders, weigh trade-offs, and decide on an approach with the team. AI helps write code and brainstorm, but generating an option does not mean the right approach has been chosen for this situation.
So the question is not only who types the program. It is also who understands what needs doing and how to keep the promise made to the ticket buyer.
Free geometry illustrations for students and teachers: EyeViz.
Tài liệu tham khảo
- [1]Sida Peng, Eirini Kalliamvakou, Peter Cihon, and Mert Demirer. The Impact of AI on Developer Productivity: Evidence from GitHub Copilot. arXiv, 2023.
- [2]Joel Becker, Nate Rush, Beth Barnes, and David Rein. Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity. METR, 2025.
- [3]Joel Becker, Nate Rush, Tom Cunningham, David Rein, and Khalid Mahamud. We are Changing our Developer Productivity Experiment Design. METR, 2026.
- [4]Responsible use of GitHub Copilot inline suggestions. GitHub Docs.
- [5]Transaction Isolation. PostgreSQL Documentation.
- [6]Idempotent requests. Stripe API Reference.


