[{"data":1,"prerenderedAt":306},["ShallowReactive",2],{"tag-labels":3,"site-header":4,"article-pascal-units-en":72},{},{"featuredPost":5,"navigations":29},{"id":6,"title":7,"title_id":8,"slug":9,"excerpt":10,"excerpt_id":11,"has_translation":12,"published_at":13,"reading_time":14,"hidden_from_listing":15,"tags":16,"thumbnail_image":21,"og_image":22,"series":23,"authors":28},110,"When You Pick a Framework Just to Look Different","Ketika Pilih Framework Cuma Biar Kelihatan Beda","ketika-pilih-framework-cuma-biar-kelihatan-beda","The last time you chose a new framework or library, was it because your problem needed that tool, or because it sounded cool and few people around you were using it? That question is uncomfortable. Technology decisions are often made for reasons that never appear in any technical document.","Terakhir kali kamu milih framework atau library baru, itu karena masalahmu butuh alat itu, atau karena alatnya kedengaran keren dan belum banyak yang pakai? Pertanyaan ini nggak enak dijawab. Soalnya keputusan teknologi sering diambil dengan alasan yang nggak pernah ditulis di dokumen teknis mana pun.",true,"2026-10-06T15:25:21.000Z",5,false,[17,18,19,20],"karier","framework","opini","pengalaman",null,"\u002Fog\u002Fketika-pilih-framework-cuma-biar-kelihatan-beda.png",{"id":24,"title":25,"title_id":26,"slug":27},9,"Articles","Artikel","all",[],[30,46,67],{"collection":31,"item":32},"series",{"__typename":31,"title":25,"title_id":26,"slug":27,"children_series":33},[34,38,42],{"title":35,"title_id":36,"slug":37},"Artificial Intelligence","Kecerdasan Artifisial","kecerdasan-artifisial",{"title":39,"title_id":40,"slug":41},"Programming Fundamentals","Konsep Dasar Pemrograman","konsep-dasar-pemrograman",{"title":43,"title_id":44,"slug":45},"Algorithms and Data Structures","Algoritma dan Struktur Data","algoritma-struktur-data",{"collection":31,"item":47},{"__typename":31,"title":48,"title_id":48,"slug":49,"children_series":50},"Tutorial","tutorial",[51,55,59,63],{"title":52,"title_id":53,"slug":54},"Learning Python","Belajar Python","belajar-python",{"title":56,"title_id":57,"slug":58},"Learning Go","Belajar Golang","belajar-golang",{"title":60,"title_id":61,"slug":62},"Learning Java","Belajar Java","belajar-java",{"title":64,"title_id":65,"slug":66},"Learning Pascal","Belajar Pascal","belajar-pascal",{"collection":31,"item":68},{"__typename":31,"title":69,"title_id":69,"slug":70,"children_series":71},"Lab","lab",[],{"article":73,"renderedBody":179,"renderedTakeaway":180,"latestArticles":181,"toc":289},{"id":74,"title":75,"title_id":76,"slug":77,"excerpt":78,"excerpt_id":79,"has_translation":12,"published_at":80,"reading_time":81,"hidden_from_listing":15,"tags":82,"thumbnail_image":21,"og_image":85,"series":86,"authors":171,"seoTitle":21,"seoDescription":21,"body_locale":174,"available_locales":175,"body":177,"takeway":178,"prerequisite":21},146,"Pascal Units: One Average, Two Answers","Unit Pascal: Satu Rata-rata, Dua Jawaban","pascal-units","The same two scores print 7 in one program and 7.50 in another, because each copy of the function divides differently. A unit gives it one body, and the interface decides who may call it.","Dua skor yang sama tercetak 7 di satu program dan 7.50 di program lain, karena tiap salinan fungsinya membagi dengan cara berbeda. Unit memberinya satu badan, dan interface memutuskan siapa yang boleh memanggilnya.","2026-11-10T01:00:00.000Z",7,[83,84],"pascal","sub-program","\u002Fog\u002Fpascal-units.png",{"id":87,"title":88,"title_id":89,"slug":90,"description":91,"description_id":92,"articles":93,"children_series":150,"parent_series":151},26,"Procedural Programming","Pemrograman Prosedural","pascal-pemrograman-prosedural","Break a big program into small procedures and functions you can call again and again.","Pecah program besar jadi prosedur dan fungsi kecil yang bisa dipakai berulang kali.",[94,116,130,145],{"id":95,"title":96,"title_id":97,"slug":98,"excerpt":99,"excerpt_id":100,"has_translation":12,"published_at":101,"reading_time":102,"hidden_from_listing":15,"tags":103,"thumbnail_image":21,"og_image":107,"series":108,"authors":109},77,"About Procedural Programming in Pascal","Tentang Pemrograman Prosedural pada Pascal","tentang-pemrograman-prosedural-pada-pascal","Procedural programming is one of the programming paradigms, where several statements are combined into one procedure.","Pemrograman peosedural merupakan salah satu paradigma pemrograman dimana beberapa perintah digabungkan menjadi satu dalam sebuah prosedur.","2021-04-13T12:44:49.000Z",3,[83,104,105,106],"pemrograman","prosedur","konsep","\u002Fog\u002Ftentang-pemrograman-prosedural-pada-pascal.png",{"id":87,"title":88,"title_id":89,"slug":90},[110],{"authors_id":111},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},1,"Daffa Izzuddin","izzudd","Writer",{"id":117,"title":118,"title_id":119,"slug":120,"excerpt":121,"excerpt_id":122,"has_translation":12,"published_at":123,"reading_time":102,"hidden_from_listing":15,"tags":124,"thumbnail_image":21,"og_image":125,"series":126,"authors":127},78,"Using and Writing a PROCEDURE in Pascal","Penggunaan dan Penulisan PROCEDURE pada Pascal","penggunaan-dan-penulisan-procedure-pada-pascal","The main parts of a PROCEDURE are its name and its body, with parameters and local declarations as the optional parts.","Bagian utama dari sebuah PROCEDURE adalah nama dan tubuh PROCEDURE. Ada juga bagian opsional yaitu parameter dan deklarasi lokal.","2021-04-15T12:54:14.000Z",[83,105,84],"\u002Fog\u002Fpenggunaan-dan-penulisan-procedure-pada-pascal.png",{"id":87,"title":88,"title_id":89,"slug":90},[128],{"authors_id":129},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":131,"title":132,"title_id":133,"slug":134,"excerpt":135,"excerpt_id":136,"has_translation":12,"published_at":137,"reading_time":102,"hidden_from_listing":15,"tags":138,"thumbnail_image":21,"og_image":140,"series":141,"authors":142},79,"Using and Writing a FUNCTION in Pascal","Penggunaan dan Penulisan FUNCTION pada Pascal","penggunaan-dan-penulisan-function-pada-pascal","A sub program that does not return a value is called a PROCEDURE, while one that returns a value is called a FUNCTION.","Sub program yang tidak mengembalikan nilai dinamakan PROCEDURE, sedangkan yang mengembalikan nilai dinamakan FUNCTION.","2021-04-21T13:01:16.000Z",[83,139,84],"fungsi","\u002Fog\u002Fpenggunaan-dan-penulisan-function-pada-pascal.png",{"id":87,"title":88,"title_id":89,"slug":90},[143],{"authors_id":144},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":74,"title":75,"title_id":76,"slug":77,"excerpt":78,"excerpt_id":79,"has_translation":12,"published_at":80,"reading_time":81,"hidden_from_listing":15,"tags":82,"thumbnail_image":21,"og_image":85,"series":146,"authors":147},{"id":87,"title":88,"title_id":89,"slug":90},[148],{"authors_id":149},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},[],{"id":152,"title":64,"title_id":65,"slug":66,"parent_series":153,"children_series":154},14,{"id":112,"title":48,"title_id":48,"slug":49},[155,160,165,170],{"id":156,"title":157,"title_id":158,"slug":159,"cover_image":21},23,"Getting Started with Pascal","Berkenalan dengan Bahasa Pascal","pascal-intro",{"id":161,"title":162,"title_id":163,"slug":164,"cover_image":21},24,"Control Structures","Struktur Kontrol","pascal-struktur-kontrol",{"id":166,"title":167,"title_id":168,"slug":169,"cover_image":21},25,"Composite Types","Tipe Data Bentukan","pascal-tipe-data-bentukan",{"id":87,"title":88,"title_id":89,"slug":90,"cover_image":21},[172],{"authors_id":173},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},"en",[174,176],"id","\nTwo Pascal programs read the same two scores, 7 and 8, and compute the average. One prints `mean: 7`. The other prints `mean: 7.50`. Both compile without a complaint, both run without a crash, and neither one is lying about what you wrote. Each program carries its own copy of the average function, and the copies do not match. Fixing one copy leaves the other broken, and nothing warns you that they have drifted apart. A unit fixes this by giving the function exactly one body.\n\n## The remainder that disappeared\n\nStart with the arithmetic, because the bug lives there. Pascal has two division operators, and they answer different questions.\n\n```pascal\nprogram divide;\n\nvar\n  a, b: integer;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('(a + b) div 2 = ', (a + b) div 2);\n  writeln('(a + b) \u002F 2   = ', (a + b) \u002F 2:0:1);\n  writeln('unformatted   = ', (a + b) \u002F 2);\nend.\n```\n\n```plain\n$ fpc divide.pas && .\u002Fdivide\n(a + b) div 2 = 7\n(a + b) \u002F 2   = 7.5\nunformatted   =  7.5000000000000000E+000\n```\n\n`div` is integer division, so it throws the remainder away and `(7 + 8) div 2` is 7. `\u002F` always produces a real number, so the same sum gives 7.5. The last line shows how Pascal prints a raw real: scientific notation, with a leading space. Remember that for later.\n\nHere is the program that printed the short answer. `Mean` takes integers and uses `div`, so the 7.5 never exists.\n\n```pascal\nprogram average;\n\nvar\n  a, b: integer;\n\nfunction Mean(x, y: integer): integer;\nbegin\n  Mean := (x + y) div 2;\nend;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('scores: ', a, ' and ', b);\n  writeln('mean: ', Mean(a, b));\nend.\n```\n\n```plain\n$ fpc average.pas && .\u002Faverage\nscores: 7 and 8\nmean: 7\n```\n\nThis is the first copy. Any program that pastes in this function inherits the truncation, and any program that pastes in a `\u002F` version gets the other answer.\n\n## A unit has two halves\n\nA unit is a file split by two keywords. Everything under `interface` is a contract: the names, parameters and return types that other programs may call. Everything under `implementation` is the body, the code that does the work, visible only inside the unit. Here is `stats.pas`, which takes over the function.\n\n```pascal\nunit stats;\n\ninterface\n\nfunction Mean(x, y: real): real;\nfunction Format2(n: real): string;\n\nimplementation\n\nfunction Mean(x, y: real): real;\nbegin\n  Mean := (x + y) \u002F 2;\nend;\n\nfunction Format2(n: real): string;\nbegin\n  Str(n:0:2, Format2);\nend;\n\nend.\n```\n\n`Mean` now takes and returns `real` and uses `\u002F`. Each signature appears twice, once per half: the interface line promises, the implementation line delivers. `Format2` wraps `Str(n:0:2, ...)`, which writes a real with two decimals into a string, so callers get `7.50` instead of scientific notation. A program opts in with one line, `uses stats;`, placed right after the `program` line.\n\n## The compiler builds it for you\n\n```pascal\nprogram average;\n\nuses stats;\n\nvar\n  a, b: integer;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('scores: ', a, ' and ', b);\n  writeln('mean: ', Format2(Mean(a, b)));\nend.\n```\n\n```plain\n$ fpc average.pas && .\u002Faverage\nscores: 7 and 8\nmean: 7.50\n```\n\nThere was no separate command for the unit. When the compiler reaches `uses stats;`, it looks for `stats.pas` next to the program and compiles it on the way. Afterward, `stats.o` and `stats.ppu` sit beside the program. The `.ppu` file is the compiled form of the unit that Free Pascal leaves behind.\n\nWithout a flag, the compiler finds the unit only when it sits next to the program. Move `stats.pas` into a folder named `lib`, and the build stops:\n\n```plain\n$ fpc main.pas\nmain.pas(3,6) Fatal: Can't find unit stats used by main\nFatal: Compilation aborted\n```\n\nAdding the flag with a space changes nothing: `fpc -Fu lib main.pas` prints the same two lines. The flag must be attached to its path, so `fpc -Fulib main.pas` compiles, and the program prints `scores: 7 and 8` and `mean: 7.50`.\n\nThe name matters too. The compiler turns `uses stats;` into a file name. Save `unit stats;` as `stat2.pas`, and a program that uses it cannot find it:\n\n```plain\n$ fpc prog2.pas\nprog2.pas(3,6) Fatal: Can't find unit stats used by prog2\nFatal: Compilation aborted\n```\n\nSo `unit stats;` must live in `stats.pas`. The fix is the file name, not the code.\n\n## What the interface gates\n\nThe two halves are not decoration. Suppose a unit `hidden.pas` declares nothing in `interface` and implements `Mean` under `implementation`. The unit compiles. A program `uses_hidden.pas` that says `uses hidden;` and calls `Mean` does not:\n\n```plain\n$ fpc uses_hidden.pas\nuses_hidden.pas(6,21) Error: Identifier not found \"Mean\"\nuses_hidden.pas(8) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\n```\n\n`Mean` exists in the file, and the caller still cannot see it, because `implementation` is private to the unit. To share a function, put its header in `interface`. To keep a helper to yourself, leave it out.\n\n## Two files, one command\n\nEyeballing output gets old, so let a second program do the comparing. `check_average.pas` reads lines from standard input and compares the first two against the expected text.\n\n```pascal\nprogram check_average;\n\nvar\n  expected: array[1..2] of string;\n  line: string;\n  i, passed, failed: integer;\n\nbegin\n  expected[1] := 'scores: 7 and 8';\n  expected[2] := 'mean: 7.50';\n\n  passed := 0;\n  failed := 0;\n  i := 0;\n\n  while not eof do\n  begin\n    readln(line);\n    i := i + 1;\n    if i \u003C= 2 then\n    begin\n      if line = expected[i] then\n      begin\n        writeln('PASS  line ', i, ': ', expected[i]);\n        passed := passed + 1;\n      end\n      else\n      begin\n        writeln('FAIL  line ', i, ': expected \"', expected[i], '\", got \"', line, '\"');\n        failed := failed + 1;\n      end;\n    end;\n  end;\n\n  if i \u003C 2 then\n  begin\n    writeln('FAIL  the program printed ', i, ' lines, expected 2');\n    failed := failed + 1;\n  end;\n\n  writeln;\n  writeln(passed, ' of 2 checks passed');\n\n  if failed > 0 then\n    ExitCode := 1;\nend.\n```\n\nBuild it once with `fpc check_average.pas`. After that the whole check is one command, `.\u002Faverage | .\u002Fcheck_average`, where the pipe feeds what `average` prints into the checker. Build the starter `average.pas` from the first section and run it:\n\n```plain\n$ .\u002Faverage | .\u002Fcheck_average\nPASS  line 1: scores: 7 and 8\nFAIL  line 2: expected \"mean: 7.50\", got \"mean: 7\"\n\n1 of 2 checks passed\n```\n\nThe checker names the line and shows both strings. Now switch `average.pas` to the version that uses `stats`, rebuild, and run the same command:\n\n```plain\n$ .\u002Faverage | .\u002Fcheck_average\nPASS  line 1: scores: 7 and 8\nPASS  line 2: mean: 7.50\n\n2 of 2 checks passed\n```\n\nSame checker, same command, new answer.\n\n**Exercise.** In the unit version of `average.pas`, change the last `writeln` to `writeln('mean: ', Mean(a, b));` and drop `Format2`. Predict what the line prints, then run the checker. The line becomes `mean:  7.5000000000000000E+000`, with two spaces after the colon, and it fails line 2. That is why `Format2` exists.\n\nWhen two programs need the same calculation, write it once in a unit and let both of them `uses` it, because a pasted copy is a bug waiting for the first edit.\n","- `div` drops the remainder, so `(7 + 8) div 2` is 7 while `(7 + 8) \u002F 2` is 7.5.\n- A unit has two halves: `interface` is what other programs may call, `implementation` is the body only the unit itself sees.\n- A function that lives only in `implementation` compiles inside the unit and fails at the caller with `Error: Identifier not found`.\n- Free Pascal compiles a unit it finds next to the program and leaves a `.ppu` behind; from a subfolder the flag is `-Fulib`, attached, because `-Fu lib` with a space does not find it.\n- The unit name is looked up as a file name, so `unit stats;` must live in `stats.pas`.","\u003Cp>Two Pascal programs read the same two scores, 7 and 8, and compute the average. One prints \u003Ccode>mean: 7\u003C\u002Fcode>. The other prints \u003Ccode>mean: 7.50\u003C\u002Fcode>. Both compile without a complaint, both run without a crash, and neither one is lying about what you wrote. Each program carries its own copy of the average function, and the copies do not match. Fixing one copy leaves the other broken, and nothing warns you that they have drifted apart. A unit fixes this by giving the function exactly one body.\u003C\u002Fp>\n\u003Ch2 id=\"the-remainder-that-disappeared\">The remainder that disappeared\u003C\u002Fh2>\n\u003Cp>Start with the arithmetic, because the bug lives there. Pascal has two division operators, and they answer different questions.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20divide%3B%0A%0Avar%0A%20%20a%2C%20b%3A%20integer%3B%0A%0Abegin%0A%20%20a%20%3A%3D%207%3B%0A%20%20b%20%3A%3D%208%3B%0A%20%20writeln('(a%20%2B%20b)%20div%202%20%3D%20'%2C%20(a%20%2B%20b)%20div%202)%3B%0A%20%20writeln('(a%20%2B%20b)%20%2F%202%20%20%20%3D%20'%2C%20(a%20%2B%20b)%20%2F%202%3A0%3A1)%3B%0A%20%20writeln('unformatted%20%20%20%3D%20'%2C%20(a%20%2B%20b)%20%2F%202)%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program divide;\n\nvar\n  a, b: integer;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('(a + b) div 2 = ', (a + b) div 2);\n  writeln('(a + b) \u002F 2   = ', (a + b) \u002F 2:0:1);\n  writeln('unformatted   = ', (a + b) \u002F 2);\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20divide.pas%20%26%26%20.%2Fdivide%0A(a%20%2B%20b)%20div%202%20%3D%207%0A(a%20%2B%20b)%20%2F%202%20%20%20%3D%207.5%0Aunformatted%20%20%20%3D%20%207.5000000000000000E%2B000\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc divide.pas &amp;&amp; .\u002Fdivide\u003C\u002Fspan>\n(a + b) div 2 = 7\n(a + b) \u002F 2   = 7.5\nunformatted   =  7.5000000000000000E+000\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>\u003Ccode>div\u003C\u002Fcode> is integer division, so it throws the remainder away and \u003Ccode>(7 + 8) div 2\u003C\u002Fcode> is 7. \u003Ccode>\u002F\u003C\u002Fcode> always produces a real number, so the same sum gives 7.5. The last line shows how Pascal prints a raw real: scientific notation, with a leading space. Remember that for later.\u003C\u002Fp>\n\u003Cp>Here is the program that printed the short answer. \u003Ccode>Mean\u003C\u002Fcode> takes integers and uses \u003Ccode>div\u003C\u002Fcode>, so the 7.5 never exists.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20average%3B%0A%0Avar%0A%20%20a%2C%20b%3A%20integer%3B%0A%0Afunction%20Mean(x%2C%20y%3A%20integer)%3A%20integer%3B%0Abegin%0A%20%20Mean%20%3A%3D%20(x%20%2B%20y)%20div%202%3B%0Aend%3B%0A%0Abegin%0A%20%20a%20%3A%3D%207%3B%0A%20%20b%20%3A%3D%208%3B%0A%20%20writeln('scores%3A%20'%2C%20a%2C%20'%20and%20'%2C%20b)%3B%0A%20%20writeln('mean%3A%20'%2C%20Mean(a%2C%20b))%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program average;\n\nvar\n  a, b: integer;\n\nfunction Mean(x, y: integer): integer;\nbegin\n  Mean := (x + y) div 2;\nend;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('scores: ', a, ' and ', b);\n  writeln('mean: ', Mean(a, b));\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20average.pas%20%26%26%20.%2Faverage%0Ascores%3A%207%20and%208%0Amean%3A%207\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc average.pas &amp;&amp; .\u002Faverage\u003C\u002Fspan>\nscores: 7 and 8\nmean: 7\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>This is the first copy. Any program that pastes in this function inherits the truncation, and any program that pastes in a \u003Ccode>\u002F\u003C\u002Fcode> version gets the other answer.\u003C\u002Fp>\n\u003Ch2 id=\"a-unit-has-two-halves\">A unit has two halves\u003C\u002Fh2>\n\u003Cp>A unit is a file split by two keywords. Everything under \u003Ccode>interface\u003C\u002Fcode> is a contract: the names, parameters and return types that other programs may call. Everything under \u003Ccode>implementation\u003C\u002Fcode> is the body, the code that does the work, visible only inside the unit. Here is \u003Ccode>stats.pas\u003C\u002Fcode>, which takes over the function.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"unit%20stats%3B%0A%0Ainterface%0A%0Afunction%20Mean(x%2C%20y%3A%20real)%3A%20real%3B%0Afunction%20Format2(n%3A%20real)%3A%20string%3B%0A%0Aimplementation%0A%0Afunction%20Mean(x%2C%20y%3A%20real)%3A%20real%3B%0Abegin%0A%20%20Mean%20%3A%3D%20(x%20%2B%20y)%20%2F%202%3B%0Aend%3B%0A%0Afunction%20Format2(n%3A%20real)%3A%20string%3B%0Abegin%0A%20%20Str(n%3A0%3A2%2C%20Format2)%3B%0Aend%3B%0A%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>unit stats;\n\ninterface\n\nfunction Mean(x, y: real): real;\nfunction Format2(n: real): string;\n\nimplementation\n\nfunction Mean(x, y: real): real;\nbegin\n  Mean := (x + y) \u002F 2;\nend;\n\nfunction Format2(n: real): string;\nbegin\n  Str(n:0:2, Format2);\nend;\n\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>\u003Ccode>Mean\u003C\u002Fcode> now takes and returns \u003Ccode>real\u003C\u002Fcode> and uses \u003Ccode>\u002F\u003C\u002Fcode>. Each signature appears twice, once per half: the interface line promises, the implementation line delivers. \u003Ccode>Format2\u003C\u002Fcode> wraps \u003Ccode>Str(n:0:2, ...)\u003C\u002Fcode>, which writes a real with two decimals into a string, so callers get \u003Ccode>7.50\u003C\u002Fcode> instead of scientific notation. A program opts in with one line, \u003Ccode>uses stats;\u003C\u002Fcode>, placed right after the \u003Ccode>program\u003C\u002Fcode> line.\u003C\u002Fp>\n\u003Ch2 id=\"the-compiler-builds-it-for-you\">The compiler builds it for you\u003C\u002Fh2>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20average%3B%0A%0Auses%20stats%3B%0A%0Avar%0A%20%20a%2C%20b%3A%20integer%3B%0A%0Abegin%0A%20%20a%20%3A%3D%207%3B%0A%20%20b%20%3A%3D%208%3B%0A%20%20writeln('scores%3A%20'%2C%20a%2C%20'%20and%20'%2C%20b)%3B%0A%20%20writeln('mean%3A%20'%2C%20Format2(Mean(a%2C%20b)))%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program average;\n\nuses stats;\n\nvar\n  a, b: integer;\n\nbegin\n  a := 7;\n  b := 8;\n  writeln('scores: ', a, ' and ', b);\n  writeln('mean: ', Format2(Mean(a, b)));\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20average.pas%20%26%26%20.%2Faverage%0Ascores%3A%207%20and%208%0Amean%3A%207.50\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc average.pas &amp;&amp; .\u002Faverage\u003C\u002Fspan>\nscores: 7 and 8\nmean: 7.50\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>There was no separate command for the unit. When the compiler reaches \u003Ccode>uses stats;\u003C\u002Fcode>, it looks for \u003Ccode>stats.pas\u003C\u002Fcode> next to the program and compiles it on the way. Afterward, \u003Ccode>stats.o\u003C\u002Fcode> and \u003Ccode>stats.ppu\u003C\u002Fcode> sit beside the program. The \u003Ccode>.ppu\u003C\u002Fcode> file is the compiled form of the unit that Free Pascal leaves behind.\u003C\u002Fp>\n\u003Cp>Without a flag, the compiler finds the unit only when it sits next to the program. Move \u003Ccode>stats.pas\u003C\u002Fcode> into a folder named \u003Ccode>lib\u003C\u002Fcode>, and the build stops:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20main.pas%0Amain.pas(3%2C6)%20Fatal%3A%20Can't%20find%20unit%20stats%20used%20by%20main%0AFatal%3A%20Compilation%20aborted\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc main.pas\u003C\u002Fspan>\nmain.pas(3,6) Fatal: Can't find unit stats used by main\nFatal: Compilation aborted\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Adding the flag with a space changes nothing: \u003Ccode>fpc -Fu lib main.pas\u003C\u002Fcode> prints the same two lines. The flag must be attached to its path, so \u003Ccode>fpc -Fulib main.pas\u003C\u002Fcode> compiles, and the program prints \u003Ccode>scores: 7 and 8\u003C\u002Fcode> and \u003Ccode>mean: 7.50\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>The name matters too. The compiler turns \u003Ccode>uses stats;\u003C\u002Fcode> into a file name. Save \u003Ccode>unit stats;\u003C\u002Fcode> as \u003Ccode>stat2.pas\u003C\u002Fcode>, and a program that uses it cannot find it:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20prog2.pas%0Aprog2.pas(3%2C6)%20Fatal%3A%20Can't%20find%20unit%20stats%20used%20by%20prog2%0AFatal%3A%20Compilation%20aborted\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc prog2.pas\u003C\u002Fspan>\nprog2.pas(3,6) Fatal: Can't find unit stats used by prog2\nFatal: Compilation aborted\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>So \u003Ccode>unit stats;\u003C\u002Fcode> must live in \u003Ccode>stats.pas\u003C\u002Fcode>. The fix is the file name, not the code.\u003C\u002Fp>\n\u003Ch2 id=\"what-the-interface-gates\">What the interface gates\u003C\u002Fh2>\n\u003Cp>The two halves are not decoration. Suppose a unit \u003Ccode>hidden.pas\u003C\u002Fcode> declares nothing in \u003Ccode>interface\u003C\u002Fcode> and implements \u003Ccode>Mean\u003C\u002Fcode> under \u003Ccode>implementation\u003C\u002Fcode>. The unit compiles. A program \u003Ccode>uses_hidden.pas\u003C\u002Fcode> that says \u003Ccode>uses hidden;\u003C\u002Fcode> and calls \u003Ccode>Mean\u003C\u002Fcode> does not:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20uses_hidden.pas%0Auses_hidden.pas(6%2C21)%20Error%3A%20Identifier%20not%20found%20%22Mean%22%0Auses_hidden.pas(8)%20Fatal%3A%20There%20were%201%20errors%20compiling%20module%2C%20stopping%0AFatal%3A%20Compilation%20aborted\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc uses_hidden.pas\u003C\u002Fspan>\nuses_hidden.pas(6,21) Error: Identifier not found \"Mean\"\nuses_hidden.pas(8) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>\u003Ccode>Mean\u003C\u002Fcode> exists in the file, and the caller still cannot see it, because \u003Ccode>implementation\u003C\u002Fcode> is private to the unit. To share a function, put its header in \u003Ccode>interface\u003C\u002Fcode>. To keep a helper to yourself, leave it out.\u003C\u002Fp>\n\u003Ch2 id=\"two-files-one-command\">Two files, one command\u003C\u002Fh2>\n\u003Cp>Eyeballing output gets old, so let a second program do the comparing. \u003Ccode>check_average.pas\u003C\u002Fcode> reads lines from standard input and compares the first two against the expected text.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20check_average%3B%0A%0Avar%0A%20%20expected%3A%20array%5B1..2%5D%20of%20string%3B%0A%20%20line%3A%20string%3B%0A%20%20i%2C%20passed%2C%20failed%3A%20integer%3B%0A%0Abegin%0A%20%20expected%5B1%5D%20%3A%3D%20'scores%3A%207%20and%208'%3B%0A%20%20expected%5B2%5D%20%3A%3D%20'mean%3A%207.50'%3B%0A%0A%20%20passed%20%3A%3D%200%3B%0A%20%20failed%20%3A%3D%200%3B%0A%20%20i%20%3A%3D%200%3B%0A%0A%20%20while%20not%20eof%20do%0A%20%20begin%0A%20%20%20%20readln(line)%3B%0A%20%20%20%20i%20%3A%3D%20i%20%2B%201%3B%0A%20%20%20%20if%20i%20%3C%3D%202%20then%0A%20%20%20%20begin%0A%20%20%20%20%20%20if%20line%20%3D%20expected%5Bi%5D%20then%0A%20%20%20%20%20%20begin%0A%20%20%20%20%20%20%20%20writeln('PASS%20%20line%20'%2C%20i%2C%20'%3A%20'%2C%20expected%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20passed%20%3A%3D%20passed%20%2B%201%3B%0A%20%20%20%20%20%20end%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20begin%0A%20%20%20%20%20%20%20%20writeln('FAIL%20%20line%20'%2C%20i%2C%20'%3A%20expected%20%22'%2C%20expected%5Bi%5D%2C%20'%22%2C%20got%20%22'%2C%20line%2C%20'%22')%3B%0A%20%20%20%20%20%20%20%20failed%20%3A%3D%20failed%20%2B%201%3B%0A%20%20%20%20%20%20end%3B%0A%20%20%20%20end%3B%0A%20%20end%3B%0A%0A%20%20if%20i%20%3C%202%20then%0A%20%20begin%0A%20%20%20%20writeln('FAIL%20%20the%20program%20printed%20'%2C%20i%2C%20'%20lines%2C%20expected%202')%3B%0A%20%20%20%20failed%20%3A%3D%20failed%20%2B%201%3B%0A%20%20end%3B%0A%0A%20%20writeln%3B%0A%20%20writeln(passed%2C%20'%20of%202%20checks%20passed')%3B%0A%0A%20%20if%20failed%20%3E%200%20then%0A%20%20%20%20ExitCode%20%3A%3D%201%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program check_average;\n\nvar\n  expected: array[1..2] of string;\n  line: string;\n  i, passed, failed: integer;\n\nbegin\n  expected[1] := 'scores: 7 and 8';\n  expected[2] := 'mean: 7.50';\n\n  passed := 0;\n  failed := 0;\n  i := 0;\n\n  while not eof do\n  begin\n    readln(line);\n    i := i + 1;\n    if i &lt;= 2 then\n    begin\n      if line = expected[i] then\n      begin\n        writeln('PASS  line ', i, ': ', expected[i]);\n        passed := passed + 1;\n      end\n      else\n      begin\n        writeln('FAIL  line ', i, ': expected \"', expected[i], '\", got \"', line, '\"');\n        failed := failed + 1;\n      end;\n    end;\n  end;\n\n  if i &lt; 2 then\n  begin\n    writeln('FAIL  the program printed ', i, ' lines, expected 2');\n    failed := failed + 1;\n  end;\n\n  writeln;\n  writeln(passed, ' of 2 checks passed');\n\n  if failed &gt; 0 then\n    ExitCode := 1;\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Build it once with \u003Ccode>fpc check_average.pas\u003C\u002Fcode>. After that the whole check is one command, \u003Ccode>.\u002Faverage | .\u002Fcheck_average\u003C\u002Fcode>, where the pipe feeds what \u003Ccode>average\u003C\u002Fcode> prints into the checker. Build the starter \u003Ccode>average.pas\u003C\u002Fcode> from the first section and run it:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20.%2Faverage%20%7C%20.%2Fcheck_average%0APASS%20%20line%201%3A%20scores%3A%207%20and%208%0AFAIL%20%20line%202%3A%20expected%20%22mean%3A%207.50%22%2C%20got%20%22mean%3A%207%22%0A%0A1%20of%202%20checks%20passed\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ .\u002Faverage | .\u002Fcheck_average\u003C\u002Fspan>\nPASS  line 1: scores: 7 and 8\nFAIL  line 2: expected \"mean: 7.50\", got \"mean: 7\"\n\n1 of 2 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>The checker names the line and shows both strings. Now switch \u003Ccode>average.pas\u003C\u002Fcode> to the version that uses \u003Ccode>stats\u003C\u002Fcode>, rebuild, and run the same command:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20.%2Faverage%20%7C%20.%2Fcheck_average%0APASS%20%20line%201%3A%20scores%3A%207%20and%208%0APASS%20%20line%202%3A%20mean%3A%207.50%0A%0A2%20of%202%20checks%20passed\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ .\u002Faverage | .\u002Fcheck_average\u003C\u002Fspan>\nPASS  line 1: scores: 7 and 8\nPASS  line 2: mean: 7.50\n\n2 of 2 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Same checker, same command, new answer.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Exercise.\u003C\u002Fstrong> In the unit version of \u003Ccode>average.pas\u003C\u002Fcode>, change the last \u003Ccode>writeln\u003C\u002Fcode> to \u003Ccode>writeln(&#39;mean: &#39;, Mean(a, b));\u003C\u002Fcode> and drop \u003Ccode>Format2\u003C\u002Fcode>. Predict what the line prints, then run the checker. The line becomes \u003Ccode>mean:  7.5000000000000000E+000\u003C\u002Fcode>, with two spaces after the colon, and it fails line 2. That is why \u003Ccode>Format2\u003C\u002Fcode> exists.\u003C\u002Fp>\n\u003Cp>When two programs need the same calculation, write it once in a unit and let both of them \u003Ccode>uses\u003C\u002Fcode> it, because a pasted copy is a bug waiting for the first edit.\u003C\u002Fp>\n","\u003Cul>\n\u003Cli>\u003Ccode>div\u003C\u002Fcode> drops the remainder, so \u003Ccode>(7 + 8) div 2\u003C\u002Fcode> is 7 while \u003Ccode>(7 + 8) \u002F 2\u003C\u002Fcode> is 7.5.\u003C\u002Fli>\n\u003Cli>A unit has two halves: \u003Ccode>interface\u003C\u002Fcode> is what other programs may call, \u003Ccode>implementation\u003C\u002Fcode> is the body only the unit itself sees.\u003C\u002Fli>\n\u003Cli>A function that lives only in \u003Ccode>implementation\u003C\u002Fcode> compiles inside the unit and fails at the caller with \u003Ccode>Error: Identifier not found\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Free Pascal compiles a unit it finds next to the program and leaves a \u003Ccode>.ppu\u003C\u002Fcode> behind; from a subfolder the flag is \u003Ccode>-Fulib\u003C\u002Fcode>, attached, because \u003Ccode>-Fu lib\u003C\u002Fcode> with a space does not find it.\u003C\u002Fli>\n\u003Cli>The unit name is looked up as a file name, so \u003Ccode>unit stats;\u003C\u002Fcode> must live in \u003Ccode>stats.pas\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n",[182,204,224,242,257,274],{"id":183,"title":184,"title_id":185,"slug":186,"excerpt":187,"excerpt_id":188,"has_translation":12,"published_at":189,"reading_time":190,"hidden_from_listing":15,"tags":191,"thumbnail_image":21,"og_image":195,"series":196,"authors":201},48,"What a Linked List Actually Is","Tentang Struktur Data LinkedList","tentang-struktur-data-linked-list","A linked list is a linear chain of nodes, each holding data and a pointer to the next node. Here is what that chain looks like, what it costs next to an array, and the same minimal implementation in Java, Python, and JavaScript.","Linked list adalah rantai linear berisi node, dan setiap node menyimpan data plus pointer ke node berikutnya. Ini bentuk rantainya, ongkosnya dibanding array, dan implementasi paling sederhana dalam Java, Python, serta JavaScript.","2026-11-21T01:00:00.000Z",4,[192,193,194,106],"struktur-data","linked-list","pointer","\u002Fog\u002Ftentang-struktur-data-linked-list.png",{"id":197,"title":198,"title_id":199,"slug":200},28,"Linear Data Structures","Struktur Data Linear","asd-struktur-linear",[202],{"authors_id":203},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":205,"title":206,"title_id":207,"slug":208,"excerpt":209,"excerpt_id":210,"has_translation":12,"published_at":211,"reading_time":81,"hidden_from_listing":15,"tags":212,"thumbnail_image":21,"og_image":215,"series":216,"authors":221},47,"Why Understanding Algorithms and Data Structures Actually Matters","Pentingnya Memahami Algoritma dan Struktur Data","pentingnya-memahami-algoritma-dan-struktur-data","An algorithm is an ordered list of steps, and that order decides how expensive a problem is. The examples are on the back of an instant noodle packet, in a factorial, and behind ctrl+z.","Sebagai konsep fundamental, algoritma menentukan seberapa mahal sebuah masalah diselesaikan. Contohnya ada di bungkus mie instan, di bilangan faktorial, dan di tombol undo.","2026-11-19T01:00:00.000Z",[213,192,106,214],"algoritma","dasar","\u002Fog\u002Fpentingnya-memahami-algoritma-dan-struktur-data.png",{"id":217,"title":218,"title_id":219,"slug":220},27,"About Algorithms and Data Structures","Tentang Algoritma dan Struktur Data","asd-intro",[222],{"authors_id":223},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":225,"title":226,"title_id":227,"slug":228,"excerpt":229,"excerpt_id":230,"has_translation":12,"published_at":231,"reading_time":232,"hidden_from_listing":15,"tags":233,"thumbnail_image":21,"og_image":236,"series":237,"authors":239},150,"Java Loops: the Last Price That Never Reached the Sum","Loop Java: Harga Terakhir yang Tidak Pernah Masuk ke Total","java-loops","Four prices add up to 47000, and the cart program prints 36500. The bound is `prices.length - 1`, so the last item is never read while the average is still divided by four.","Empat harga berjumlah 47000, tapi program keranjang mencetak 36500. Batasnya `prices.length - 1`, jadi item terakhir tidak pernah dibaca sementara rata-ratanya tetap dibagi empat.","2026-11-13T01:00:00.000Z",6,[234,235],"java","loop","\u002Fog\u002Fjava-loops.png",{"id":238,"title":60,"title_id":61,"slug":62},13,[240],{"authors_id":241},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":243,"title":244,"title_id":245,"slug":246,"excerpt":247,"excerpt_id":248,"has_translation":12,"published_at":249,"reading_time":232,"hidden_from_listing":15,"tags":250,"thumbnail_image":21,"og_image":252,"series":253,"authors":254},149,"Java switch: the 78 That Came Out as a C","Java switch: 78 yang Keluar sebagai C","java-switch","A grading program marks a paper 78 and prints `grade: C`. `case 7` assigns `B` and then runs into `case 6` because the `break` is missing, and the compiler says nothing about it.","Sebuah program penilaian memberi nilai 78 pada satu lembar ujian lalu mencetak `grade: C`. `case 7` memberi `B` lalu jatuh ke `case 6` karena `break`-nya hilang, dan kompilator tidak mengatakan apa pun soal itu.","2026-11-12T01:00:00.000Z",[234,251],"percabangan","\u002Fog\u002Fjava-switch.png",{"id":238,"title":60,"title_id":61,"slug":62},[255],{"authors_id":256},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":258,"title":259,"title_id":260,"slug":261,"excerpt":262,"excerpt_id":263,"has_translation":12,"published_at":249,"reading_time":14,"hidden_from_listing":15,"tags":264,"thumbnail_image":21,"og_image":269,"series":270,"authors":271},108,"At 11 a.m. the AI Quota Runs Out, and the Work Stops There","Jam 11 siang kuota AI-nya habis, dan kerjaan berhenti di situ","jam-11-kuota-ai-habis-kerjaan-berhenti","The panel says the usage limit is reached and the work stops, not because it is finished. Three guesses explain it, and all three are wrong: the limit is shaped like a cliff, and the day is built on top of one tool.","Panel di layar bilang batas pemakaian tercapai, dan kerja berhenti di situ. Bukan karena selesai. Ada tiga tebakan kenapa ini terjadi, dan ketiganya salah: batasnya berbentuk tebing, dan harinya dibangun di atas satu alat.",[265,266,267,268],"ai","tooling","rate-limit","produktivitas","\u002Fog\u002Fjam-11-kuota-ai-habis-kerjaan-berhenti.png",{"id":24,"title":25,"title_id":26,"slug":27},[272],{"authors_id":273},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":275,"title":276,"title_id":21,"slug":277,"excerpt":278,"excerpt_id":21,"has_translation":15,"published_at":279,"reading_time":232,"hidden_from_listing":15,"tags":280,"thumbnail_image":21,"og_image":283,"series":284,"authors":286},148,"Go Variables: the Mean That Printed 0.0","go-program-structure-and-variables","Six scores arrive, all six are added up, and Go prints a mean of 0.0. A second `total := 0` inside the `if` block is the whole bug, and the compiler that refuses unused variables has nothing to say about it.","2026-11-11T01:00:00.000Z",[281,214,282],"go","variabel","\u002Fog\u002Fgo-program-structure-and-variables.png",{"id":285,"title":56,"title_id":57,"slug":58},11,[287],{"authors_id":288},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},[290,294,297,300,303],{"text":291,"depth":292,"id":293},"The remainder that disappeared",2,"the-remainder-that-disappeared",{"text":295,"depth":292,"id":296},"A unit has two halves","a-unit-has-two-halves",{"text":298,"depth":292,"id":299},"The compiler builds it for you","the-compiler-builds-it-for-you",{"text":301,"depth":292,"id":302},"What the interface gates","what-the-interface-gates",{"text":304,"depth":292,"id":305},"Two files, one command","two-files-one-command",1794557077991]