News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Liip Blog:
Functional Programming in PHP
November 06, 2014 @ 12:20:35

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.

0 comments voice your opinion now!
functional programming introduction language function cache

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

NetTuts.com:
Programming with Yii2 Getting Started
October 31, 2014 @ 10:51:23

On the NetTuts.com site today Jeff Reifman has kicked off a new series of posts introducing you to the Yii2 framework and what it has to offer. In this first post he starts with the basics - installation, setup and configuration of a Yii2 application.

This tutorial will walk you through installing Yii 2.0, setting up your local development environment, building a simple Hello World application, setting up your remote production environment for hosting and deploying your code from a GitHub repository.

He walks you through the install process, via Composer, and creating a new project, the "Hello World". The tutorial also helps you set up a local development environment with MAMP and what the resulting page should look like when loaded. He then gets into some of the architecture of a Yii-based application and starts in on the "Hello World" controllers and views. He finishes the post with a look at setting up a remote server (not localhost) and pushing the application out, complete with commands for server setup and software configuration (like Apache).

0 comments voice your opinion now!
yii2 introduction tutorial programming series part1

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-getting-started--cms-22440

Mathias Verraes:
Objects as Contracts for Behaviour
September 29, 2014 @ 11:10:33

Mathias Verraes has a new post to his site today with an interesting idea when it comes to handling the architecture of an application: using objects as the contracts for behavior. He suggests that the objects themselves define how other pieces of code should interact with them, not necessarily external services. He illustrates with an invoice and appointment example.

Of course invoices do not pay themselves, but that's not what an object model is trying to do. An invoice exposes the behaviour of being able to be paid. That ability is in fact essential to what it means to be an invoice. The behaviour is an inherent property of an invoice. If an invoice doesn't have the ability of being paid, there's no point in issuing invoices at all. In other words, the contract of an invoice object declares that its interface includes payment as a feature. Its promise to the outside world is that it allows an outsider to pay for it. Encapsulation of state and behaviour is the core idea behind objects.

He wonders why, if this is more true to the "object-oriented programming" ideals, the idea of encapsulating procedural code as objects is so widespread. He suggests a lack of education on the subject or maybe even confusion from spoken languages themselves.

0 comments voice your opinion now!
objectoriented programming oop contract expose behavior property

Link: http://verraes.net/2014/09/objects-as-contracts-for-behaviour/

php[architect]:
Functional Programming in PHP Release
September 08, 2014 @ 11:14:22

While not a mainstream practice in the PHP world, functional programming has been a topic that's popped up again and again over the years. If you've ever wondered what it's all about and how to get started with it in your applications, take a look at php[architect].

This book is for anyone that has an interest in functional programming or PHP as an advanced programming language. If you are curious or have never even heard of functional programming before then this is the gentle introductory text you have been looking for. Equally it serves those seeking to exploit the advanced functional concepts such as monads in a PHP context.

This book comes from some of the experience Simon has had with functional programming in the past (and taught about in presentations). It provides examples showing the techniques of functional programming applied in PHP including: map/reduce, currying and composition. The book can be purchased either directly from php[architect] or from Amazon (or Amazon.co.uk).

0 comments voice your opinion now!
functional programming release book phparchitect simonholywell

Link: http://www.functionalphp.com

Tobias Hermann:
Programming language subreddits and their choice of words
August 21, 2014 @ 12:14:13

Tobias Hermann has put together some interesting statistics pulled from the various programming subreddits on the Reddit.com site. He measures the choice of words for each community based on how own they're used.

While reading about various programming languages, I developed a hunch about how often different languages are mentioned by other communities and about the average conversational tones used by relative members. To examine if it was just selective perception on my site, an unconscious confirmation of stereotypes, or a valid observation I collected and analysed some data, i.e. all comments (about 300k) written to submissions (about 40k) in respective programming language subreddits from 2013-08 to 2014-07 using PRAW and SQLite. In this article I will present some selected results.

He first covers the "mutual mentions" for each of the groups with the largest connection from the PHP subreddit being to Python. He also compares the results to the TIOBE index for each (average popularity). He gets into more details about the words used (abstract, category, pure, etc) with PHP placing somewhere roughly in the middle for most data sets. The most interesting result, however, came with the set of curse words and the frequency of their use. In the PHP Reddit community the usage of these terms is, by far, the most of any group. Unfortunately, PHP also ranks lower on the "happiness" scale.

If you're interested in seeing how he came up with these results, you can get the raw results and the code he used.

0 comments voice your opinion now!
programming community language word choice subreddit

Link: https://github.com/Dobiasd/programming-language-subreddits-and-their-choice-of-words/blob/master/README.md

Qandidate.com Blog:
Asynchronous fault tolerant programming with PHP
August 12, 2014 @ 12:17:20

On the Qandidate.com blog there's a new post looking at fault tolerant programming in PHP, a follow up to their previous post introducing the topic and creating a "circuit breaker" to prevent major issues when a problem pops up.

Now we will show you a running demo of the application where the circuit breaker library Phystrix is combined with asynchronous programming. The advantage of this approach is that it allows the querying of multiple backend services asynchronously. A timeout can be set for each of the calls and the circuit breaker will deal with failing services.

A screencast included in the post shows a script in action and how it reacts when the various services it needs fail. They've posted the code for the demo can be found over on GitHub and full instructions to run it are included in the post. Also included is some of the output from the test and a peek inside the logs showing where things were broken and if they were able to recover.

0 comments voice your opinion now!
asynchronous fault tolerant programming demo github screencast

Link: http://labs.qandidate.com/blog/2014/08/11/asynchronous-fault-tolerant-programming-in-php/

Ramon Kleiss:
Introduction to Aspect-Oriented Programming
August 07, 2014 @ 11:09:10

Ramon Kleiss has posted a tutorial to his site recently introducing you to the concept of AOP in PHP (Aspect Oriented Programming). In it he provides an overview of some of be basic AOP concepts and code examples showing them in action.

For my first blog post, I'm going to take you on a little trip into a really cool programming paradigm: aspect-oriented programming, which is a little known style of programming while it can come in really useful. It is common knowledge that in software development you should have a Separation of Concerns (the first letter in SOLID). Although it is accepted that the Single Responsibility Principle is hard to design, it is still valued as one of the top best practices one can use.

He starts with a base class (ArticleManager) and how it's easy for it to grow when more dependencies are needed. He then evolves this example to use a more AOP approach, resolving the scope creep in the main class using cross-cutting concerns, advice, pointcut and aspects. He moves away from his basic example and uses a Symfony-based example to show how to implement a LoggingPointcut, inject it into the class and set up an "intercept" method to handle the notification of which method was called.

You will have to be careful to remember that you are using AOP as the application development continues, since it is very easy to forget about if you're happily developing away. Just take this rule of thumb: does the class I'm modifying care about the extra functionality? If it doesn't see if you can use inheritance or see if you can use AOP.
0 comments voice your opinion now!
aspect oriented programming aop introduction example

Link: http://ramonkleiss.nl/intro-to-aop/

Matt Frost:
Avoiding Burnout
July 28, 2014 @ 09:59:32

Matt Frost (one of the two hosts on the Loosely Coupled podcast) has a new post to his site about some of his own experiences and advice around avoiding burnout.

Writing software is an incredibly gratifying profession; the idea that you can take a problem and find creative solutions through the use of technology is what drives a lot of us forward. What happens though when the drive is gone? What happens when that nifty little side project, training course, blog post or book goes from being nifty to being a drudgery? I came to this point a number of months ago and stayed there for a while, having now come out of this funk there are some things I learned that I'd like to share.

He talks about some of his own trouble with burnout, the project he was involved in and what it taught him about dealing with it (and life in general). He gives some sensible advice including "don't sit at your desk all day" and "prioritize things". The advice is simple and to the point - avoiding burnout is something only you can do for yourself. Waiting for things to "just get better" isn't going to work.

0 comments voice your opinion now!
burnout experience personal programming advice

Link: http://shortwhitebaldguy.com/blog/2014/07/avoiding-burnout

Freek Lijten:
Consistency vs. "The itch"
February 20, 2014 @ 09:11:31

In this latest post to his site Freek Lijten talks about "the itch" of having or working on something outside the normal project standards.

I assume everybody has certain rules, regulations, guidelines or conventions at their jobs/open source projects. I like structure and consistency so, as long as they are sensible, these things make me happy. Still, every once in a while, something itches. What wins, itch or convention?

He gives an example from some of his current work with an "itch" around using only a call to a registry to save information where business logic isn't needed. He recommends not scratching the itch though, as consistency should win out over other solutions. As he points out, "one day, you will have the need for business logic" and you want to have that structure there to fit it into.

0 comments voice your opinion now!
consistency programming development methodology itch

Link: http://www.freeklijten.nl/home/2014/02/18/Consistency-vs.-The-itch

KillerPHP.com:
Why PHP should be the first language you learn
February 13, 2014 @ 10:43:46

On the KillerPHP.com site there's a new post from Stefan Mischook where he suggests that PHP is the first language you should learn if you're new to development.

Anyone who reads my stuff knows that if I am anything, I am practical. So when it comes to learning (and teaching) programming to someone new to the whole programming game, for several pragmatic reasons, I think PHP by far is the best language to begin with. Here are some of the reasons: it is easy to learn, it is the most popular web scripting language and it is fast to program with.

He shares these thoughts and a few more in a short video (or here on YouTube).

0 comments voice your opinion now!
first language video opinion programming learn

Link: http://www.killerphp.com/articles/why-php-should-be-the-first-language-you-learn


Community Events





Don't see your event here?
Let us know!


update interview language symfony package introduction tool install composer library laravel version release podcast series community security voicesoftheelephpant framework opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework