DEV Community

Discussion on: "Is PHP Dead?" Discussion

Collapse
 
ben profile image
Ben Halpern

I made this thread...

And someone wrote this...

I agree about keeping dependencies low in small projects! When I hop between multiple projects, I can feel the context switching cost if there are setups involved.

By the way, this looks like a great use-case for…

<html lang="en">
  <head>
    <?php include 'workspace/meta.partial.html'; ?>
    <style>
      <?php include 'workspace/style.partial.css'; ?>
    </style>
  </head>
  <body>
    <?php include 'workspace/body.partial.html'; ?>
    <script>
      // Data
      var data = <?php include 'workspace/data.json'; ?>;

      // Code
      <?php include 'workspace/scaffold.partial.js'; ?>;
      <?php include 'workspace/dynamic.partial.js'; ?>;
    </script>
    <?php include 'workspace/analytics.partial.html'; ?>
    <?php if (isset($_GET['test'])) include 'workspace/test.dev.html'; ?>
  </body>
</html>
# Launch a development web server
$ php -S 0.0.0.0:1234

# View production build
$ open http://localhost:1234

# View test build
$ open http://localhost:1234/?test

# Build static site
$ php index.php > index.html

And it kind of blew my mind because I'd kind of forgotten all about php in a way. It doesn't scross my mind how damn useful it can be if used for the right purpose.

Collapse
 
actuallymab profile image
Mehmet Aydin Bahadir • Edited

I am more than happy to hear this from you! Maybe a bit out of context, but this reminded me a conversation between Adam Wathan and Pieter Levels here

Collapse
 
ziizium profile image
Habdul Hazeez

It was joy when I read your post about building an SSG then I was like: What would people say about @ben building an SSG when there are "solutions" out there?.

I scrolled down to read the comments and the first comment I read was the one included in your comment, and I was like this is simple and interesting as it gets.

I did not bother to read the remaining comments. With Backspace or Ctrl + W, I was off.