GraphQL: an offspring with good genes

GraphQL, as most new programming techniques (or styles or libraries), is trying for the last couple of years to find its place into the world of software development. The problem arises when people try to evaluate new techniques without taking into account the past of the relevant technological sector. Even when a new technique really…

MySQL and the UTF-8 disharmony

The problem: In case you may not know this, MySQL’s “utf8” is not the same as UTF-8 ! And, to my knowledge, this is happening in all MySQL flavors (MySQL, MariaDB, PerconaDB, etc). The “utf8” (also known as “utf8mb3”) encoding supports up to three bytes per character. The real UTF-8 encoding uses up to four…

Design patterns in action: Builder and Symfony Finder

The Symfony Finder ( Symfony\Component\Finder ) is a component that, according to its documentation, can be used to “build rules to find files and directories”. This functionality includes a numder of optional parameters that can be used to construct the Finder object based on what files or directories we are looking for. The Finder uses…

Thoughts on static properties and methods

Static properties The implications: Static properties got a bad reputations because, as many other things in software development, people were using them without fully understanding their potential implications. Let’s see some of these implications in PHP, (trying to widen our view in other languages when required) so that we understand what are we talking about….

Handling enumerated values

From time to time we come across the need to define class properties that take values from a limited set of values. A set of values that rarely (or never) changes and when it changes it changes only manually (by the developer) and not as a result of the running application. Usually, these values are…

PHP sessions under the microscope: Part 2

Security Considerations Sessions can be attacked. That’s a fact. And there are many ways to attack them. Three of the most common ways to do this are “session fixation” , “session hijacking” and “session flooding”. In simple words, session fixation is about tricking someone to use a session ID that does not belong to him/her….

A smooth introduction to the Redux world

Introduction: Let me start by saying that I am mainly a back-end developer. My front-end skills were a bit outdated and limited to building some decent UIs with Javascript/jQuery and Bootstrap. At least, until one month ago. The last month I had to go through a crash course involving the following front-end technologies: ES6, React.js,…

The not-so-thin line between DI, DIP and IoC

Precision is a basic requirements for effective communication. Software engineering is not an exception. That’s why establishing clear terminology is vital. When each party uses the same term to describe a different concept, chaos will rise. One common example in the domain of software engineering where such confusion often exists is the distinction between Dependency…

Reasoning…Memcached

If you are a newcomer to the caching world, you may probable thing:  “Why should I use Memcached? MySQL cache is faster.” This is true. But real life problems are quite different than theory. So, before I answer, let me set the stage using a simple scenario. I have a demo database table named “snames”…