Erika Heidi: The Art of Programming

Erika Heidi has posted an interesting article on Mdeium.com today with a look at the art of programming, relating the work we as developers do back to the same kinds of skills artists use in their work.

One of the most consolidated misconceptions about programming, since the early days, is the idea that such activity is purely technical, completely exact in nature, like Math and Physics. Computation is exact, but programming is not. The first is a result of a machine operation, and the latter is still a human activity.

Programming requires a lot of creativity, on top of the abstract concepts, tools and techniques that we might learn in a classroom; all that theory represents only a tiny portion of what is necessary to build a great developer.

She talks about some of her own past experiences with programming and how, from even simple beginnings, she had a “mind blowing experience” making something from just a few lines of code. She talks about how she sees similarities between programming and art such as the two kinds of artists: the ones that copy other work, recreating things already made and the genuine artists making new and inventive things.

Respect the work of others, even if you think there is something with a similar purpose already out there. It’s their expression. They are not trying to reinvent the wheel. They are trying to create a better wheel, or a wheel that works better for their purposes.

Link: https://medium.com/@erikaheidi/the-creative-programmer-2dde54f83e3a
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , | Hinterlasse einen Kommentar

Remi Collet: PHP-FPM in Docker

Remi Collet has a new post today showing you how to get PHP-FPM up and running with Docker using a few simple lines in the Dockerfile. Docker is a toolset that lets you easily create and provision containers with scripted configurations (and link them together).

[The] use case [for this is] running php 5.3.3 on a Fedora 20 / 21 development workstation, for production deployment on RHEL-6 (as no php 5.3 SCL exists). This example can be easily adapted for all available PHP versions available as RPM (5.3.3 in RHEL-6, 5.4.16 in RHEL-7, 5.4.16 and 5.5.6 in RHSCL 1.2 or using a third party repository).

The contents of the Dockerfile are included, making a call to yum to install all the needed packages, make a few replacements in the www.conf configuration file and create the default “www” directory. Finally, it fires up the PHP-FPM server with the IP given in the startup. The commands to create the container and launch it are also included in the post.

Link: http://blog.famillecollet.com/post/2014/12/11/PHP-FPM-in-Docker
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

Bernhard Schussek: Puli: Powerful Resource Management for PHP

Bernhard Schussek has announced a tool for handling resources in a more Composer-inspired way: Puli. Puli is described as a tool that “manages files, directories and other resources in a filesystem-like repository”.

Unfortunately, sharing your work gets a lot harder when you leave PHP code and enter the land of configuration files, images, CSS files, translation catalogs – in short, any file that is not PHP. For brevity, I’ll call these files resources here. Using resources located in Composer packages is quite tedious: You need to know exactly where the package is installed and where the resource is located in the package. That’s a lot of juggling with absolute and relative file system paths and prone to error.

[…] One and a half years ago I talked about this problem with PHP-FIG. I wrote a blog post about The Power of Uniform Resource Location in PHP. Many people joined the discussion. The understanding of the problem and its solution got riper as we spoke. Today, I am glad to present to you the first (and probably last) alpha version of Puli, a framework-agnostic resource manager for PHP.

He walks through the basics of the tool – how it manages the various resources, what the configuration looks like and how it can directly be integrated with Composer. He also points to a Twig extension that allows for Puli integration via paths in your templates. There’s also a Symfony bridge that lets you use it in your YAML configuration files.

Link: http://webmozarts.com/2014/12/03/puli-powerful-resource-management-for-php/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Community News: Packagist Latest Releases for 11.30.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

NetTuts.com: Laravel, BDD and You: The First Feature

NetTuts.com has posted the second part of their “Laravel, BDD and You” series (part one is here) building on their introduction in part one and building a first feature (what BDD tools call their tests).

In the second part of this series called Laravel, BDD and You, we will start describing and building our first feature using Behat and PhpSpec. In the last article we got everything set up and saw how easily we can interact with Laravel in our Behat scenarios. […] In short, we are going to use the same .feature to design both our core domain and our user interface. I have often felt that I had a lot of duplication in my features in my acceptance/functional and integration suites. When I read everzet’s suggestion about using the same feature for multiple contexts, it all clicked for me and I believe it is the way to go.

He starts in with the creation of the first feature – a simple “welcome” test that evaluates the main Laravel start page. He uses this example to set up a Laravel trait that can be reused in other parts of the testing and how to use it in a Feature Context file. He then starts to create the tests for the sample time tracking application started in part one. He gives an example of the feature file’s contents, the result from its execution and the “small refactors” that it will suggest to add functionality to the feature file. With this skeleton in place, he then fleshes out the test to make it actually work with the requests. He walks through each function and provides the code needed for both the test and other tools/objects they need.

Link: http://code.tutsplus.com/tutorials/laravel-bdd-and-you-the-first-feature–cms-22486
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

Community News: Packagist Latest Releases for 11.22.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Voices of the ElePHPant: Interview with Mike van Riel

The Voices of the ElePHPant podcast has released their latest episode in their community interview series. In this latest episode host Cal Evans talks with Mike van Riel, the project lead on the PHP Documentor project.

Cal and Mike talk about Mike‘s work in a community-focused company, his own experience at the WeCamp conference, his experience speaking and the work he does on the PHP Documentor project.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you enjoy the interview and want to hear more from the PHP community, be sure to subscribe to their feed.

Link: http://voicesoftheelephpant.com/2014/11/18/interview-with-mike-van-riel/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

SitePoint PHP Blog: Practical OOP: Building a Quiz App – Bootstrapping

The SitePoint PHP blog has kicked off a new series of posts today with the first tutorial about building an application with OOP and the Slim framework. In this starting article they focus in on bootstrapping the application and introducing some of the basics behind MVC and OOP.

At a certain point of my development as a PHP programmer, I was building MVC applications by-the-book, without understanding the ins-and-outs. I did what I was told: fat model, thin controller. Don’t put logic in your views. What I didn’t understand was how to create a cohesive application structure that allowed me to express my business ideas as maintainable code, nor did I understand how to really separate my concerns into tight layers without leaking low-level logic into higher layers. I’d heard about SOLID principles, but applying them to a web app was a mystery. In this series, we’ll build a quiz application using these concepts. We’ll separate the application into layers, allowing us to substitute components: for example, it’ll be a breeze to switch from MongoDB to MySQL, or from a web interface to a command-line interface.

They start off with a bit about why “MVC is not enough” and how they’ll be applying domain modeling as a part of the application. There’s also a brief mention of the concept of a service layer and how it will fit into the overall structure. Then it’s on to the code: getting Slim installed (via Composer) and starting in on the interface/service classes for the Quiz. They walk you through entity creation for the Quiz and Question instances and a mapper to tie them together.

Link: http://www.sitepoint.com/practical-oop-building-quiz-app-bootstrapping/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Liip Blog: Functional Programming in PHP

On the Liip blog today there’s a tutorial from Gilles Crettenand giving you an overview of functional programming in PHP. While PHP is not normally used as a functional language, it is possible to simulate the same effect.

Functional programming has gained a lot of traction those 3 to 5 last years. […] Those [frameworks and languages] are all cool and shiny new toys, but we can benefit from some techniques without having to learn a new tool, just by applying some principles to our everyday PHP! But first of all, what exactly is functional programing?

He starts off with some of the basics of functional programming, some of the difficulties that can come with it and, of course, the advantages it can provide. From here he starts in with code examples. He shows how functions become “first-class citizens” and how they can be applied to various elements. He illustrates this with a few array manipulation examples. Next up are “utility functions” for evaluating the data given (like “any” or “all”). He ends the post looking at the idea of “memoization”, or the caching of the results of function calls against data. He shows how to accomplish this with static local variables in PHP and includes a wrapper you can pass any callable function into and have the results cache automatically.

Link: http://blog.liip.ch/archive/2014/11/05/functional-programing-in-php.html
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

PHP.net: New Supported Versions Timeline Page

The PHP.net website has introduced a new feature to help make it a bit clearer which versions of PHP are supported and which have reached their end-of-life mark. This new Supported versions page off the main site provides listings of currently supported versions and graphical timelines of past (and future) support milestones.

Each release branch of PHP is fully supported for two years from its initial stable release. During this period, bugs and security issues that have been reported are fixed and are released in regular point releases. After this two year period of active support, each branch is then supported for an additional year for critical security issues only. Releases during this period are made on an as-needed basis: there may be multiple point releases, or none, depending on the number of reports.

The page includes information on when the initial release in a series was made (like the 5.4.x or 5.5.x series), when active support did/will end and how long the timeline is for security fixes and support. As of the time of this post, PHP 5.3.x is the only series that has reached end-of-life, but the 5.4.x series is coming close being in security fix only mode now and EOL-ing completely in ten months.

Link: http://php.net/supported-versions.php
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , | Hinterlasse einen Kommentar