Choosing a stack

I've been in a lot of discussions lately about 'stacks'. Agencies, for good reason, want to limit the stacks they use and for good reason. It means that projects are more predictable to work on and one can develop templates etc to move things in the right direction.

I thought I'd just share some thoughts here.

The programming languages I'm most comfortable with are PHP, Python and Javascript so they're the only stacks that I'd really consider.

For the frontend there are two CSS frameworks that I know and love:

  • Foundation - a fully fledged alternative to Bootstrap. All the bells and whistles and the best one I've found for the job. You can almost achieve 80% of your frontend work just from the settings file.
  • Bulma - if you don't have to worry about legacy browsers. It's almost pure flex-box, and I like that it isn't reliant on any Javascript so you can take care of that yourself.

I generally use SCSS but am liking the look of PostCSS

For JavaScript frameworks, VueJS emerges as a clear favourite for me. It has the lowest barrier to entry by far and takes all the best bits from ReactJS and AngularJS and makes them much simpler without compromising on scalability and functionality. It's truely a delight to use.

Then there's the backend debate.

PHP probably has the biggest pool of developers available to it which is a huge plus. In addition the performance gains that came with PHP7 make it a very attractive option. But let's keep in mind that performance benchmarks are far from everything.

When it comes to PHP, there's no doubt that Laravel is king for a fully fledged MVC framework. By association I assume that Lumen is the go-to micro-framework but I've never actually used it.

Laravel's ORM is a delight and it's a truely 'modern' framework in my mind.

I guess I'm just a bit over PHP. I used it for over 10 years and while it served me well, it can be really inconsistent. I think it suffered from a lack of leadership for a long time (although that is changing). There also aren't any PHP CMSs that I've ever used and liked. Drupal is a nightmare, Wordpress is a blog, Joomla is a hotchpotch of shitty plugins that cost money.

Python is my language of choice. I love it for a heap of reasons. I think it's a much better designed language than PHP, far more consistent and reliable. It's also better as a 'general purpose' language which means one can use it all over the place, and it would be hard to overstate the 'readability' of Python. Yes, PHP7 benchmarks better than Python3 but good code always benchmarks the best and Python does a much better job of encouraging better coding. Plus, if it's benchmark speed you're after then just use NodeJS.

For Python MCV projects, there is only one: Django. The amount of stuff you get out of the box is amazing and it has a huge ecosystem. Another thing Python does better than PHP is how easy it is to integrate third party modules and Django benefits from this greatly.

As I've mentioned previously, I feel like Django is a bit dated, but it still does an amazing job.

The other thing I love about Django is the Wagtail CMS which I've been using more and more. Everyone hates CMSs, but because Wagtail is essentially just an extension of Django one can use it as much or as little as they like. And it has a beautiful admin console and StreamFields which make everyone's life better. A lot of agency work is CMS based and Wagtail is the best on I've used.

And if we're talking about micro frameworks, I don't think you can go past Flask - especially now that it has fully-fledged Python3 support. Plus SQLAlchemy integrates really easily adding a really solid ORM to the framework.

Admittedly, Python web developers are harder to come buy. Python is universally ranked as one of the most popular languages used (in the top 5 - often above PHP even) in surveys, but it doesn't seem to be as popular as a web language and finding developers can be tricky. Although finding developers is generally difficult. Moreover, I'm predicting a surge in Python developers over the next two or three years. Things like the Raspberry Pi, mean that Python is the educator's language of choice so I suspect we'll see a lot of people coming out of Uni with a good grasp of Python and wanting to dive into web development.

Finally there's Javascript, or NodeJS specifically.

Being written in Javascript so that frontend devs can at least understand what's going on in the backend is a huge advantage and, as I mentioned above, it's lightning fast which is very appealing. It is also a really simple language (although that adds it's own layer of complexity in itself). Plus there's no shortage of Javascript developers in the world.

The problem with NodeJS is it's ecosystem. It's new and constantly changing. SailsJS looks like an interesting project but a lot of people are unhappy with it and it seems quite immature at this stage (to be fair though, it's still version 0.12).

Which makes me think that ExpressJS is the answer to all things NodeJS - especially if you're looking for a micro-framwork. And it probably is, but I'm yet to find a JavaScript ORM that people like. The most common response is 'just write you're own SQL queries'. ARE YOU CRAZY! The whole point of an ORM is to do a bunch of sanitising and safety checks so you don't do anything stupid yourself. Yes, of course one should be careful with these sorts of things and write their own little module to handle it all. But these things are complex, mistakes slip through - that's why one outsources something like that to a team of people that think about nothing else and constantly update your packages for you.

Interestingly, this blog is powered by NodeJS and Express. It uses the Ghost blogging platform. And if what you want it a blog, I couldn't recommend it more.

So for me, I keep coming back to Python and Django/Flask.

There are no PHP CMSs that I like and NodeJS's ecosystem isn't mature enough yet. The only draw back is speed - which is easily over rated as an issue and doesn't take into account the speed of development - and possibly recruitment but I feel like that's all going to change.