Thoughts, notes, etc.
by Florian
I recently built Job Board Job Board (now defunct) in PHP. I don’t have a ton of takeaways to be honest, but I’ll put down my thoughts anyway.
This was far and away my biggest takeaway. PHP is incredibly easy to start using. Not only did it come pre-installed on my Mac, but so did Apache. I pretty much just pointed Apache to a new folder I made and then ran apachectl start
. Done!
I can really see the appeal of the language:
The things I didn’t like are fairly pedantic:
private String someVariable = "someValue";
doesn’t require me to use Shift. $someVariable = "someValue";
does and that bothered me. Super silly but I could see this getting really annoying with large codebases.echo
html. At least the basic PHP tutorials encouraged this. I wish the convention to write to the file used a more descriptive keyword like write
or something. echo
reminds me too much of println
in Java.Maybe? I wasn’t really sold on it the way I was with Node. I honestly don’t mind the seperation of the front-end and the back-end that seems to plague so many people. Maybe because I’m already using that convention at work and it’s what’s familiar?
My hot take/controversial opinion is that a good basic web app implementation would simply dump all the data you need into JSON in a <script>
tag at the top of an HTML file using a templating engine. Then, an associated JavaScript file would parse and display the data in the page. Assuming the templating engine knows that there’s only a single injection point (read: it doesn’t have to scan the whole file), you’d wind up with a really fast web app that still pretty clearly seperates the frontend and the backend.
PHP is a really strong language, but I’d honestly only use it again if I had a compelling reason. Node, SpringMVC, and Django/Flask are all easier to use and more familiar from my point of view.
On to the next project!
tags: programming - posts