Have you ever had a situation where there was a bug in some deployed application, but the simple act of running that application locally made the bug impossible to find? It could’ve been that there was no local infrastructure (e.g. databases) to back the running services. Or port-configuration was...
A couple of months ago, someone asked on the JavaScript subreddit how functional programmers handle dealing with unavoidably immutable actions, like DOM manipulation. I gave my $0.02, saying that imposing functional programming constraints on your DOM-specific code is more trouble than it’s worth,...
When designing RESTful services where data is queried, we tend to map this querying functionality to an endpoint that uses a HTTP GET method. This is good because GET is specifically designed for data retrieval.
However, there are scenarios where this isn’t a sufficient solution. For example, if ...
Herberto Graça recently wrote a great summary on Value Objects, and I commented on it on Reddit, saying:
…something that could flesh out the case for value objects [is] the fact that it allows you to model complex rule interactions by representing the concepts of the core domain and letting the...
In the rise of RESTful, microservice-based architectures in our web applications, HATEOAS seems to have fallen out of favour. This is curious, given that the creator of REST specifically advocates for HATEOAS, going so far to say that REST isn’t truly REST without it. There have also been articles...
Persisting application state is not an easy job, to say the very least. We have an entire cottage industry of vendors who promise to simplify these issues for us. But there is a long-existing design pattern that which provides a logical separation in your application to help tackle this problem, wit...
An old, prolific convention of software development has been to prefix or suffix interfaces with something that specifically designates them as such. So if I have an interface for a clock, rather than calling it Clock, many would call it IClock or ClockInterface. In PHP, the convention is so ingrain...
So you need to do some time-specific calculations in your application. It’s related to the current time, so you do the usual thing, and new up a DateTime object:
$now = new DateTime();
Seems innocuous, right? But you quickly run into some pretty nasty problems:
Your code is now very difficult...