Sooner or later in your programming career you will be faced with the dilemma of validation and exception handling. This was the case with Patkos Csaba and his team also. A couple or so years ago we reached a point when we had to take architectural actions to accommodate all the exceptional cases our quite large software project needed to handle. Below is a list of practices we came to value and apply when it comes to validation and exception handling.
The Repository Design Pattern, defined by Eric Evens in his Domain Driven Design book, is one of the most useful and most widely applicable design patterns ever invented. Any application has to work with persistence and with some kind of list of items. These can be users, products, networks, disks, or whatever your application is about. If you have a blog for example, you have to deal with lists of blog posts and lists of comments. The problem that all of these list management logics have in common is how to connect business logic, factories and persistence.
The Date/Time PHP extension is a set of classes that allow you to work with almost all of the date and time related tasks. It’s been available since the release of PHP 5.2 and the extension introduced several new classes, all of which are mapped to real life scenarios.
The new hype in programming is all about functional programming
paradigms. Functional languages are used more and more in greater and
better applications. Scala, Haskel, etc. are thriving and other, more
conservative languages like Java started to adopt some of the functional
programming paradigms (see closures in Java7 and lazy eval for lists in
Frameworks are hot topics in the web-industry and have been for some time. In this vast sea of flavors is Symfony – an extensive PHP framework that follows the ever popular MVC paradigm. Its learning curve is probably a little steeper than its fellow competitors, like CodeIgniter. Don’t worry, once it grows on you, you’ll feel more powerful than ever and you’ll be able to develop fantastic applications.
This tutorial was inspired by a speech given by Robert C. Martin that Patkos Csaba watched a year or so ago. The main subject of his talk is about the possibility of picking The Last Programming Language. He addresses topics such as why should such a language exist? And what it should look like? However, if you read between the lines, there was another interesting idea that caught my attention: the limitations that each programming paradigm imposes upon on us programmers. So before we get into how we could go about converting a procedural based PHP app into an object oriented one, he wants to cover a little bit of theory beforehand.
PHPUnit has hinted at parallelism since 2007, but, in the meantime, our tests continue to run slowly. Time is money, right? ParaTest is a tool that sits on top of PHPUnit and allows you to run tests in parallel without the use of extensions. This is an ideal candidate for functional (i.e Selenium) tests and other long-running processes.
Whoops is a small library, available as a Composer package, that helps you handle errors and exceptions across your PHP projects. Out of the box, you get a sleek, intuitive and informative error page each time something goes pants-up in your application. Even better, under all that is a very straight-forward, but flexible, toolset for dealing with errors in a way that makes sense for whatever it is that you’re doing.
Like most content management systems, PyroCMS uses front-end themes. Though PyroCMS themes are built a bit differently than what you might be used to from other systems, they’re still quite easy to create. They’re so easy, in fact, that very little PHP experience is required to assemble them!