It's been a while. Once again. Heck, I'm never gonna get consistent.
When we do something we always progress and get better. What was once our best work and pride will at some point, if we continue, be shit. We just need to reach the point where we realize it.
Your song sucks. Your painting sucks. Your site sucks. Your fucking app is a disgrace. That's the truth. Even if it's awesome! There's always so much room for improvement. We just can't see it yet.
As web development is my "field" (and I'm a shitty ass dev), that'll be the topic of this post.
As always, I've been doing a lot of web development recently and realized that I have to move forward. When I first launched the current revision of the site I was super happy. I managed to cram shit that was spread across 20 files into 1 file and I thought it was super neat. I taught myself how to parse query strings and build a nice URL structure and I was content. Heck, the site does work great, but now...hooo boy..let's just say..if you know web dev...you don't wanna see this backend.
I always heard people talking about "modern web development", "PHP sucks and is outdated, get with the times of JS", "you're not using a framework?!?!?!?", etc. I always shook it off. Kinda like Taylor Swift. Except..unlike her, I did sense a bit of truth coming from criticism. I just didn't want to believe it.
I have a principle though, do not criticize before trying or seeing. I just thought "why use frameworks when I can do all that shit myself anyway" and "Why would I use Node when I know PHP so well". So before I could argue I had to get involved in "modern web development" and try some new stuff.
I had a moment where I realized frameworks might be useful. I wanted to set up a new site, and realized what a cluster fuck my current project was, and that it couldn't simply be copy pasted easily, as I'd have to not just update the views, but also the logic, as it was hardcoded. Yeah. Shame on me.
I checked a list of PHP Frameworks. I'd heard good about Laravel, and it seemed like the most complete one when comparing PHP frameworks. So when summer came, I spent a few weeks of my time off work to study Laravel. I read the documentation over and over, trying to grasp the concepts of MVC and separating logic and views, learning the Blade templating engine, and while I was at it, I checked out Sass as well, and I was...ecstatic. This new way of developing brought a huge dose of motivation for me. The first project I built was an image gallery where users could upload and browse images. I had so much fun. Laravel was my new standard, I thought. This is how I'll make sites from now on.
I began rewriting shadowfied.com in Laravel, and most things were done furiously fast in comparison to the time it had taken me before. There was one thing I was unhappy with though..
/sites > cd shadowfied2
/sites/shadowfied2 > du -sh
Yeah. The project was 50 MB. Without assets like pictures, whereas the old one, with even more functionality was only KBs.
This was the point where I again started doubting. Laravel is nice but it's so full of stuff that you will never ever use. However, it is also full of stuff that you WILL use.
In the end, it wasn't really the size of the project per se, as it only runs on the server anyway. But what did bug me, was the structure. A new Laravel project is FULL of files.
So, I tried a framework. I tried MVC. I tried Sass. It was great. The points above about Laravel though had me doubting a bit. At this point I entered a bit of a break, cause I didn't know how I wanted to progress. I realized that keeping up my "old ways" wasn't viable.
The other thing I needed to try was Node. To "shut those people up", I thought.
I'm gonna be honest. I struggled with Node. So many times I've initied a npm and later deleted it. I could never get started properly. Node and JS is SUCH a jungle. I was very happy when a friend linked this, cause that was exactly how I felt.
I landed a job working with WordPress. Mainly just producing sites (yeah, I know, but it's fun, and I wasn't aiming higher in my career, in fact, I was looking for just any average joe job, really) instead of focusing on backend. Being in this state of limbo cause I didn't know how to progress, combined with working full time didn't help me get back into web dev. I wasn't used to being so limited by time, so I'd rather play games and hang out with friends on my free time. If I have a project to work with, it's fun, but finding WHERE to start your project after realizing you were shit, wasn't fun.
I met a proper back end developer through work, and we began discussing a lot. We were both in a bit of the same situation, and we both felt we needed to embrace the new ways, even if just to say that we have, and then go back.
We decided to make a project in completely uncharted waters for us both: Node. Express. MongoDB.
We set up a base for our project using Express with some simples routes. Since I had previously fallen in love with Laravels Blade templating Engine, I wanted to find something similar. After checking a bunch of templating engines, the one that seemed best to me was Handlebars. I like the syntax, I like that it's logicless (cause it really FORCES you to think before you do, so you can almost completely separate your logic). So I studied up on Handlebars and Handlebars Express and once I got that integrated. I was starting to feel at home.
I eventually learnt how to do most things I did with Laravel using Node. So I started rewriting shadowfied.com again, and then..
/sites > cd v2
/sites/v2 > du -sh
It was "only" 12 MB. That's still huge in comparison to my 100% handwritten system. BUT, this is managable. It's pretty. My old custom system was a 500 line index.php spaghetti coded like crazy. Implementing any new structure into that is just about impossible.
I have now decided that I'm sticking with Node for this project. No, I'm not basing that on the folder size. I'm well aware that eventually, my project might actually end up bigger in file size because of the node modules, BUT, because I get my own structure here. I set up everything completely from scratch, then link and route it together. I LOVE that you start with a completely empty folder and you init your project and from there on it's up to you. You don't implement INTO the framework (Express in this case), you implement the framework.
Before I get hate mail (look at me, pretending people read this) telling me that there are equivelent PHP frameworks that work the same, where you pull in what you need with Composer etc, I'M NOT DOUBTING THAT! That's my next point.
What you create, is not about the language. Your book is gonna be just as good if you write it in French as it would be in English, your song is gonna be just as good if you produce it in FL Studio as it would be in Logic, your video is gonna be just as good if you make it in Sony Vegas as it would be if it was made in Premiere. The same applies to programming. Your site is gonna be just as good if you write it in PHP as it would be in (Node)JS. It's all about finding where you are comfortable.
For me, it was finding a point of control of my project, and being able to keep it managable. Laravel would be fine, but since I can have more control this way with Node and Express, that's where I'll stay for now.
So, I would encourage everyone to try as much as you can, and when I say try, I don't mean to get a "Hello World" running in Express which takes 10 seconds. I mean make a project in it. Get your own list of specs for your project and make sure you can satisfy that, then do it for different frameworks and languages and see what fits you best.
Backend is, mostly, for you, and not the user. If you have seen my site previously, you might not even have noticed that I've redesigned it with this new port. But for me, it is day and night. I can easily integrate new stuff, and be proud of my project again........until I find the next step in web development, and at that point, I will be shit again.
We all suck.
Thanks for reading!
<3 ~ Shadowfied