انتقل إلى المحتوى
أمين أبوزيد
منشورBEG-004-L01

المطوّر مقابل مهندس البرمجيات

  • الدرس 1 من 5
  • 17 دقيقة قراءة
  • مبتدئ
في هذا الدرس 11 موضوعات

هذا الدرس متاح حاليًا باللغة الإنجليزية فقط، ولم تُنشر نسخته العربية بعد.

Lesson Overview

Ask people what a programmer does and most will say: "writes code". That is true, and it is also only a small part of the picture. Someone who builds software for a living also works out what problem needs solving, plans how the pieces will fit, checks that the result really works, helps teammates understand their changes, and gets called when something breaks. This wider job is what people usually mean by software engineering.

In this lesson you will learn the difference between writing code and engineering software, and why the second one is the career this course is preparing you for. You will meet five kinds of work besides typing code: understanding the problem, design, testing, review, and operation. You will also learn why readable code is worth more than clever code, and why real software is built by teams over years, not by one person in a weekend.

A picture to keep in mind for the whole module is building a house. Laying bricks is a real and necessary skill. But a house also needs someone to decide what the family needs, someone to draw the plans, inspectors to check the work, and caretakers to keep it standing for decades. The bricklayer matters, and the house is more than the bricks. Software is the same: code is the bricks.

Where this fits: in the previous module you learned the software lifecycle (requirements, design, build, test, release, operate, retire). This lesson shows that an engineer takes part in all of those stages, not only "build". The lessons after this one name the roles in a team (lesson 2) and follow one feature from idea to production (lesson 3).

A note on words. "Developer", "programmer", and "software engineer" are used loosely, and job titles differ between companies. In this lesson we use them as two ends of a habit: a developer (here) is someone focused on writing code that works, and a software engineer is someone who also takes responsibility for the whole life of the software. A real person is usually somewhere between the two, and a good developer grows into an engineer.

Learning Objectives

By the end of this lesson you will be able to:

  • Explain, in your own words, how software engineering is wider than writing code.
  • List at least five activities of an engineer's week besides writing code, and say why each matters.
  • Explain why code is read much more often than it is written, and why that makes readable code more valuable than clever code.
  • Explain why software built by teams over years needs different habits from a one-person weekend project.
  • Describe the habit of asking "what problem are we solving?" before "what should I type?".
  • Recognize that an engineer takes some responsibility for the software after it is released.

Written Explanation

Writing code is one slice of the work

Think back to the lifecycle from the previous module. A piece of software passes through requirements, design, build, test, release, operate, and retire. Only the build stage is mostly about typing code. A person who only ever writes code covers one stage out of seven.

Here is a plausible week for an engineer on a backend team. The proportions are made up for illustration, and they differ a lot between teams and weeks, but the kinds of work are real:

ActivityWhat it looks likeExample
Understanding the problemReading a task, asking questions, talking to the person who needs it"When you say 'recent orders', do you mean the last 7 days or the last 10 orders?"
DesignDeciding how the change will work before building itSketching on a whiteboard which part of the service will hold the new rule
Writing codeTurning the design into instructionsAdding the new rule to the order service
TestingProving the change works, including the unusual casesWriting a check that an empty order is rejected
ReviewingReading a teammate's change and giving feedbackSpotting that a teammate's change would show another customer's data
OperatingWatching the running software and fixing problemsInvestigating why orders were slow at lunchtime
CommunicatingExplaining decisions, writing short notes, asking for helpWriting three clear sentences describing what changed and why

Some weeks, writing code is the largest slice. Many weeks it is not. The point is not a particular percentage. The point is that a person who can only write code is missing most of the toolbox.

What "engineering" adds

The word engineering comes from fields such as civil or electrical engineering, where people build things that must work reliably and last. Engineers in those fields do not just build; they plan, check, document, and take responsibility for what they build. Software engineering borrows that spirit.

A well-known description from the book Software Engineering at Google says that software engineering is different from programming along three lines: time, scale, and trade-offs. Paraphrased:

  • Time. Programming is about producing code. Engineering is also about keeping that code useful and maintainable for as long as it is needed, which can be many years. Over that time the tools, the people, and the needs all change.
  • Scale. Programming can be done alone. Engineering means many people working on the same software together, over a long period. Habits that work for one person (keeping everything in your head) stop working.
  • Trade-offs. Engineers constantly choose between options that each cost something: time, money, effort, complexity, risk. Good decisions can be explained, not just defended with "I prefer it this way".

Notice that none of these three is "more difficult programming". They are about the world around the code: how long it lives, how many people touch it, and what decisions surround it.

Real software is built by teams, over years

A typical beginner project is small: one person, one weekend, one computer, no users. Real software is the opposite. A shopping service might be worked on by dozens of engineers over many years. Some of them join after the first version was written and have never met its authors. Some of the people who write a change today will have left the company by the time someone needs to fix it.

That changes what "good work" means:

  • Your code will be read and changed by people who are not you, including the future you who has forgotten the details.
  • Decisions need to be written down briefly, because memory does not survive team changes.
  • You cannot test everything alone by hand, so you need checks that run automatically and keep running as the code changes.
  • Working software must keep working while it changes. Nobody can switch off the shop for a month to rebuild it.

Think of the house again. A house built for one owner who never changes anything can be built in a personal style. A building that will be repaired by strangers for fifty years needs clear plans and standard parts.

Readable code beats clever code

Imagine two ways to write the same rule: "a customer gets free delivery when the order is at least 50".

java
// Version 1: clear
boolean qualifiesForFreeDelivery(double orderTotal) {
    double freeDeliveryThreshold = 50.0;
    return orderTotal >= freeDeliveryThreshold;
}

// Version 2: shorter, but harder to read
boolean f(double t) {
    return t >= 50;
}

Both do the same thing, and you do not need to know Java syntax yet to feel the difference. In version 1 the names say what is going on, and a new teammate can read it in a few seconds. In version 2, you have to guess what f and t mean and what 50 stands for. This tiny example is easy either way. With several hundred lines, the difference becomes the difference between a change taking ten minutes and taking a day.

Clever code is code written to be short, tricky, or impressive. Readable code is code written so that the next person understands it quickly. Why prefer the second? Because software is read far more often than it is written. Every time someone wants to fix a bug, add a feature, or check that a change is safe, they first read. A commonly repeated rule of thumb is that developers spend much more time reading code than writing it. I am stating this as a widely shared experience; I did not find a measurement in the sources I checked, so do not quote a ratio. The logic holds even without a number: code is written once, and then read every time anyone needs to change it.

So the habit to build is: write for the reader. Choose clear names, keep pieces small, and explain the why in a short comment when the reason is not obvious.

Ask "what problem are we solving?" first

Beginners often start by asking "what should I type?". Engineers start earlier: "what problem are we solving, and for whom?".

Suppose a ticket says: "Add a button to export all orders." A pure code-writer might immediately build it. An engineer asks a few questions first:

  • Who needs the export, and what will they do with it?
  • How many orders is "all"? Ten thousand? Ten million?
  • Does the export contain personal data, and who is allowed to see it?
  • Is there already a simpler way to give them what they need?

Those questions may change the whole solution, or prevent the work completely. Time spent on the wrong solution is wasted even if the code is perfect. Asking early is cheap; fixing a wrong build is expensive. This echoes a point from the lifecycle lesson: problems found late generally cost more to fix than problems found early.

Responsibility continues after release

In the house picture, the builders leave, but the house still needs caretakers. In many teams the people who built a backend service also help look after it. They watch for errors, answer when it breaks, and learn from what real users do. This is the operate stage of the lifecycle.

You do not have to love 3 a.m. phone calls to be an engineer. Many companies have specialist roles for operations (lesson 2 names them). But even then, an engineer cares what happens to their code in production, and designs it so that it is easy to watch and to fix.

Is this "developer" bad and "engineer" good?

No. Developers are valuable, and everyone starts by learning to write code. The point of the contrast is to tell you where to grow. In the early part of this course you will mostly write small programs, because you cannot design, test, or review what you cannot yet read. Over the course, the other activities in the table above come in one by one. By the time you are job-ready, you should be able to write code and take part in the rest.

Examples

Example 1: a tiny change that needed a question (simple)

A ticket says: "Show the customer's name on the receipt."

A pure code-writer finds the receipt code and adds the name. An engineer first asks: "What if the customer has not given a name?" The answer is: "Some customers order as guests." Now there is a decision to make (show "Guest", or leave the line out?), and a test to add for a guest order.

Result: the code change is about the same size, but the feature works for guests as well. Engineering here cost one question and prevented a bug.

Example 2: two reviewers, one change (practical)

A teammate sends you a change to review, in which a loop does something with a variable called x2. You cannot tell what it means. A good review comment is not "this is wrong". It could be: "I could not tell what x2 stands for. Could we name it remainingStock?" The teammate renames it, and in doing so notices that the loop forgot the case where stock is zero.

Result: the review improved readability and caught a defect. Reading is an engineering skill, and reviewing is part of the job.

Example 3: a "quick" export that was not quick (realistic)

A manager asks for a nightly export of all orders to a file. A developer writes a simple loop that loads every order into memory and writes it to a file. It works on the test data of a few hundred orders.

After release, the shop grows to millions of orders. One night the export uses so much memory that the service slows down for customers. The team is paged (alerted) and has to stop the export and investigate.

What would an engineer have done differently?

  1. Understand: asked how many orders exist now and how many are expected in two years.
  2. Design: chose to process the orders in small batches instead of loading all at once.
  3. Test: tried it with a large amount of test data, not only a few hundred rows.
  4. Operate: added a message in the logs and a way to see how long the export takes, so that a slowdown would be noticed early.

The code of the better version is not much harder to write. The extra work is thinking about time, scale, and operation, which are exactly the three lines from the explanation above. (You do not need the technical details yet; batches and memory come later in the course.)

Backend Insight

A backend is a service that keeps running, mostly used by other programs, and it holds the data that the business depends on. That makes the engineering habits in this lesson more important for backend work, not less:

  • It runs continuously. As you saw in the module on software, a backend never "finishes". A careless change affects every user at once, so testing and review are part of the normal path, not optional extras.
  • It is used by other programs. Another team's code may depend on exactly how your service behaves. Changing it casually can break someone you have never met. Clear names, clear documentation, and careful changes protect them.
  • It holds important data. A mistake in code for a button on a page is annoying. A mistake in code that handles orders, money, or personal data can be costly and hard to undo. Engineers think about "what if this goes wrong?" before writing.
  • It is visible only through its behavior. Nobody can see a backend, so it must be designed to explain itself when something is wrong: with messages (logs) and measurements (you will learn these later).

When you read a backend job description, you will often see words such as "design", "test", "code review", "on-call", and "collaborate" next to "write code". Those are the other slices of the week.

Common Mistakes

Mistake 1: Thinking engineering means only deeper technical knowledge

  • Incorrect: "To become a better engineer, I just need to learn more languages and tools."
  • Correct: "Technical knowledge is necessary. I also need to learn to ask good questions, design, test, review, explain, and look after the software."

Learning more tools helps, but a person with perfect knowledge of syntax and no habits of testing or communication produces fragile software.

Mistake 2: Writing code that only you can understand

If you must explain every line aloud for someone to follow it, the code is not finished. Single-letter names, mysterious numbers, and "clever" one-liners save a minute today and cost hours to everyone later, including you in six months.

Mistake 3: Starting to type before understanding the problem

  • Incorrect: "The ticket says add a button, so I'll add a button."
  • Correct: "I'll first make sure I understand who needs it and why, then choose the simplest solution that solves that problem."

Mistake 4: Considering the job done when the code compiles or "works on my computer"

Working on one computer with a little test data is the beginning. Engineers also ask: does it work with real amounts of data, for unusual inputs, and for the people who will operate it?

Mistake 5: Ignoring what happens after release

If you treat release as the end, you will not design your code to be watched, fixed, or changed. Operating and collaborating are part of the job, not extras that belong to someone else.

Exercises

Try each exercise yourself before opening the solutions. Write your answers in your own words.

Level A: Foundation

A1. In one or two sentences, explain the difference between a developer (as used in this lesson) and a software engineer.

أظهر الحل A1

A1. A developer, here, is someone focused on writing code that works. A software engineer also designs, tests, reviews, and looks after the software over its whole life, usually as part of a team.

A2. Name five activities an engineer does besides writing code, and say in a few words what each one is for.

أظهر الحل A2

A2. Any five of these (or similar): understanding the problem (so you build the right thing); design (to find big mistakes while they are cheap); testing (to prove the change works, including unusual cases); code review (to catch mistakes early and share knowledge); operating (to keep the running software healthy and fix problems); communicating (so teammates know what changed and why).

A3. Finish the sentence: "Readable code is more valuable than clever code because code is ..."

أظهر الحل A3

A3. ... read far more often than it is written (or: read by many people, many times, while it is written once).

Level B: Application

B1. Here are two versions of the same rule: "a user is an adult if they are 18 or older".

java
boolean a(int x) { return x >= 18; }
boolean isAdult(int ageInYears) { return ageInYears >= 18; }

Which one would you prefer in a team project, and why? Give two specific reasons.

أظهر الحل B1

B1. The second one, isAdult. Reasons: the names say what the function and the input mean, so a reader understands it without guessing; the name isAdult makes the places where it is used read like a sentence; if the rule changes (for example the age differs by country), it is clear what to change. Any two reasons of this kind are fine.

B2. A ticket says: "Send customers an email when their order ships." Write four questions you would ask before building it. For each question, say what could go wrong if you did not ask.

أظهر الحل B2

B2. Example questions: (1) Which email address do we use, and what if it is missing? Without asking, the system may try to send to nothing and fail silently. (2) What should happen if the email cannot be delivered? Without asking, the failure may be ignored and customers never told. (3) Should the email be sent once per order or once per package? Without asking, customers may receive duplicate emails. (4) Do customers have a way to opt out of emails? Without asking, the team may break the rules about contacting customers. Any four sensible questions with a consequence are fine.

B3. Match each activity with its lifecycle stage (requirements, design, build, test, release, operate): (a) deciding which parts of the service will store data, (b) a teammate reports orders are failing at night and you investigate, (c) writing a check that proves a discount is never negative, (d) listing what the support team needs from the app, (e) putting the new version onto the servers.

أظهر الحل B3

B3. (a) Design. (b) Operate. (c) Test. (d) Requirements. (e) Release.

Level C: Challenge

C1. A friend says: "I finished the project. It works on my laptop, so my job is done." Write a short reply (four to six sentences) that explains what is still missing from an engineering point of view, using at least three of these words: team, time, test, review, operate.

أظهر الحل C1

C1. Example: "A project that works on your laptop is a good start, but real software is used by other people over a long time. Has anyone besides you tested it, including with unusual inputs? Has a teammate reviewed it so the code is understandable to someone else? What happens if it fails after release, and who will notice? Engineering work includes making sure the software keeps working for the team and for time to come, not only that it runs once." Any answer covering at least three of the listed words sensibly is correct.

C2. Think of a small program you could imagine writing for yourself (a to-do list, a budget tracker). Describe two things that would change if the same program were used by 50,000 people and maintained by ten engineers for five years. For each change, say which of the three lines (time, scale, trade-offs) it comes from.

أظهر الحل C2

C2. Example: (1) For 50,000 users, the data would no longer fit in a single simple file and would need a more careful way to store and look it up; this comes from scale. (2) With ten engineers over five years, the code would need clear names, short notes, and automatic checks so that new people can change it safely; this comes from time (and also scale). A third option: choosing between a quick fix and a cleaner rewrite is a trade-off. Any two reasonable changes, correctly tagged, are fine.

Mini Challenge

Take a task you did earlier in this course, or a small everyday job such as "plan a trip budget with a spreadsheet". Write a short "engineer's checklist" for it with five lines, one for each of these: Problem (who needs it and why), Design (the pieces and the order), Check (how you will know it works, including one unusual case), Review (who could read it and what you would ask them to look for), and Afterwards (what you will watch or maintain once it is in use).

Check your work: each line is one or two sentences, you included at least one unusual case, and you could hand the checklist to a friend who would understand what you plan to do.

Summary & Next Lesson

Key takeaways

  • A developer writes code. A software engineer also designs, tests, reviews, operates, and communicates, and takes responsibility for the software over its life.
  • Software Engineering at Google describes the difference through time, scale, and trade-offs, not through harder programming.
  • Code is written once and read many times, so readable code is worth more than clever code.
  • Real software is built by teams over years, so habits such as clear names, short written decisions, and automatic checks matter.
  • Ask "what problem are we solving?" before "what should I type?". Questions are cheap; wrong builds are expensive.
  • Release is not the end: an engineer cares what happens to the software in production.

Next lesson

You have seen that engineering is team work with many kinds of tasks. The next lesson, "Roles in an engineering team", names the main roles (frontend, backend, full-stack, QA, DevOps, SRE, and architect) and shows how they hand work to each other.

Self-check

  1. Name three engineering activities that are not writing code.
  2. Why is readable code more valuable than clever code?
  3. Which three lines does Software Engineering at Google use to separate engineering from programming?
  4. A ticket says "add an export button". What is the first thing an engineer does?
  5. After a feature is released, who is responsible for how it behaves in production?
أظهر الإجابات
  1. For example: design, testing, code review, fixing production issues, talking to teammates.
  2. Because code is read far more often than it is written, so the people who read it later (including you) must be able to understand it quickly.
  3. Time, scale, and trade-offs.
  4. Make sure they understand the problem: who needs the export, why, and how much data is involved, before building anything.
  5. The team that built it shares responsibility. Some companies also have specialist roles for operation (next lesson), but engineers still care about how their code behaves in production.

References

  • Titus Winters, Tom Manshreck, and Hyrum Wright (eds.), Software Engineering at Google, chapter 1 "What Is Software Engineering?". I read it to verify the description of software engineering as programming integrated over time, and the three differences (time, scale, trade-offs) paraphrased above. The page does not state the claim that code is read more than it is written.
  • Microsoft Learn, What is DevOps?. Supports the point that development, delivery, and operations phases rely on one another and that developers are accountable for the performance and stability their changes bring in operation (in teams that follow DevOps culture).
  • The claim that developers spend much more time reading code than writing it is a widely repeated rule of thumb. I could not verify a measured ratio, so the lesson gives none. The weekly activity table and the export story are invented illustrations, not statistics. The house analogy is this module's own teaching picture.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.