# Dang, forgot how to write php code

**URL:** <https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323>\
**Category:** Miscellaneous and Personal Stuff I Must Share\
**Created:** [May 30, 2022, 12:05am UTC](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323 "2022-05-30T00:05:44Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![tofor](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tofor/32/13727_2.png) [@tofor](https://boards.straightdope.com/u/tofor)\
**Post date:** [May 31, 2022, 1:02pm UTC](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323/21 "2022-05-31T13:02:46Z")

</div>

> [@engineer\_comp\_geek](#):
>
> I was going through a section of code a couple of months ago. Nothing was commented, and I was like what was this idiot thinking? And who wrote this crap anyway?
> 
> Then I looked at the modification log. It was me. I wrote it.

I recently had a similar experience. “What idiot wrote this?”

I just _knew_ it was going to turn out to be me. So I checked the log and…it wasn’t me! I was so happy.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [May 31, 2022, 8:32pm UTC](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323/22 "2022-05-31T20:32:47Z")

</div>

> [@LSLGuy](#):
>
> But rest assured a couple generations of devs have already fought that battle and moved beyond the [POST it all back, process it on the server, and return a complete fresh browser page] approach. As you quite correctly say, that approach is a right pain in the ass.

I’m only superficially knowledgeable about web programming, so permit me a dumb question please:

Do web pages really no longer play the game of passing data back and forth so it won’t get lost? Or is all that hassle still present, but buried these days under several layers of (hopefully low-leakage) abstractions?

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [May 31, 2022, 8:37pm UTC](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323/23 "2022-05-31T20:37:07Z")

</div>

> [@Senegoid](#):
>
> Do web pages really no longer play the game of passing data back and forth so it won’t get lost?

If you mean having zillions of hidden form fields used solely to pass data from one page to another, I think that’s pretty much dead. You store a session token as a cookie locally and that’s used to retrieve persistent data from the server via XMLHttpRequest. Though all of _that_ is abstracted away via various frameworks.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 31, 2022, 8:49pm UTC](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323/24 "2022-05-31T20:49:01Z")

</div>

> [@Senegoid](#):
>
> Pascal programmers, on the other hand, have never acknowledged to this day that any Pascal compiler has ever been written, or ever needed to be written, in any language other than Pascal.

Well, they sort of can be. The usual process for writing the first compiler on any system is to start by writing an absolute bare-minimum, bare-bones compiler, that’s missing most of the language’s features, in Assembly or machine code or whatever you’ve got. Then you use that to compile a more sophisticated compiler, until eventually you get a full-featured compiler that implements all the language details. And then you compile that one last time, using itself.

As for the first assembler, of course the answer is that you assemble it by hand, on pencil and paper, to get the machine code, and then input that machine code through whatever interface you have available to you.

[Previous page](https://boards.straightdope.com/t/dang-forgot-how-to-write-php-code/965323.md?page=1)
