How to minimise CRUD front-end code duplication in Laravel 5.4 / Twig

CRUD (Create/Read/Update/Delete) is something that developers do quite a bit of. Frameworks can help with this, but there’s still a fair amount of code you’ll need to write for every CRUD screen you put together.

One particular area is the difference between Create and Update. For many of the projects I’ve worked on, Create and Update are often very similar. They aren’t identical, but if there’s enough overlap between them, you can minimise duplicate code with the following setup.

Continue reading “How to minimise CRUD front-end code duplication in Laravel 5.4 / Twig”

Why I custom code my personal sites

The static route

When I built my first website, I wrote all of the HTML by hand. At that point, it was just HTML. It was annoying to replicate the navigation bar across every page, even though I only had a few pages to update.

I tried a few different methods, such as using frames, and adding the common code via Javascript. I also tried reducing the number of pages on the site that I needed to update, by adding a dropdown and opening some of the pages in a new window, sans navbar. The Javascript method stayed on the site for quite a while.

Continue reading “Why I custom code my personal sites”

Information overload: how are we supposed to keep up?

I’ve always been hungry for news. I like to know what’s happening – and I like to know when it happens.

The thing is, I feel I’ve reached saturation point.

I jokingly summed this up in a recent tweet:

Throw in Pokemon Go (I’m not ashamed to say I’m still enjoying it) and I’m torn between the buzz of feeling in the loop, and information overload.

Continue reading “Information overload: how are we supposed to keep up?”

Production code and real-world tech

This week I read a tweet that really resonated with me:

I totally agree.

However, this applies beyond coding. I’d like to see more examples of tech being put to use on real projects. It’s cool to look at what’s new in tech – but to me, it’s even cooler to think of real-life examples where a specific piece of tech has added value that would have been a lot tougher – or impossible – with another tech choice.

Rather than talks or blog posts along the lines of “How we built a website in AngularJS”, how about why you used AngularJS? How about whether a framework has been a huge asset in the early stages of building an application, but it’s caused difficulties later on? How about moving between JS frameworks? How about tales from teams who have inherited bad codebases and gradually improved them? Or tips from developers who stay in jobs for a few years and have consolidated tools or reduced technical debt?

I’m sure there are plenty of these talks and blog posts around. I’d just like to see a little less of “here’s a new tool!” and a little more of “here’s how to get more out of your existing setup”.