by 12907835202 · 3y ago · 0 comments
I told my Dad I wanted to make a website for my favourite computer game so he sat me infront of MS Frontpage and got me started. After I while I got to the point i've made a forum but all the comments where dummy text in static HTML, so my Dad setup PHP on the computer and basically left me to it with a single index.php file and a intro to PHP book. The problem was when I looked things up, I was always asking the wrong questions. So instead of asking, "how can I store comments in a database and then fetch them for displaying?", I asked "how can I append a new comment to my HTML file?". I wound up with some crazy (working!) forum where every time a comment was added it would append to a HTML file. Then I wanted a more complex layout I had to figure out how to use a regex to append it in the right place. Then even more crazy regex to handle editing and deleting comments. Then when the file got too big I wanted to add pagination and this took me ages to get right shifting comments between pages when a comment was deleted so there was still 10 per page.
Eventually I discovered that databases exist and i've been a web developer for 18 years now.
Crazy to think there's now a cool use case for an entire app stored in a single .html file. Maybe I wasn't as dumb as I thought back then.
Hey static sites are a thing that keep coming back no matter how much things change. It doesn't matter how fancy your back-end for rendering/populating a website is when at the end of the day a lot of sites really really have no real need to be that dynamic. They could easily be rendered out to static files and be much more performant. Not to mention that if your backend falls over you still have some simple static files to spit out so people might not even notice downtime.
I remember also starting building a forum and browser games using text files as database :)
Essentially CSV files pretty much, although I didn't think of them as CSV or similar.
Then you go full circle and realize some databases just work with a file in the end and maybe we were on the right path to be db engineers
Remember, if it’s worth doing, it’s worth doing half-assed.