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

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

SitePoint Programming Blog:
What is the Best Programming Language to Learn in 2014?
February 07, 2014 @ 10:44:59

On the SitePoint Programming blog today Craig Buckler has published a new post with some suggestions as to which programming language is the best to learn in 2014. The results come from a compilation of job postings and popularity, but it's interesting none the less.

It's been a year since I revealed the best languages to learn in 2013. Once again, I've examined the data produced by Jobs Tractor who analyzed more than 45,000 developer jobs advertised on Twitter during the past twelve months. [...] Take this survey with a large pinch of salt. Then add pepper, ketchup and numerous other condiments. I'm not convinced Twitter is a reliable source of job-related data and regional differences can skew results.

The results of surveys from other outside sources are also included, showing slight variations compared to Craig's numbers. Most of the languages are the same but their orders are pretty different depending on who you ask. Of course, he does make one major recommendation about all of these results: "Never use statistics as the sole basis for learning a language."

If you've mastered a language or two, the choice is far simpler: pick something that interests you (intellectually or financially). Programming skills are transferable and the learning curve will be shallower when learning a new language compared to when you first started.
0 comments voice your opinion now!
programming language learn statistics opinion

Link: http://www.sitepoint.com/best-programming-language-learn-2014/

Mashable.com:
10 Programming Languages You Should Learn in 2014
January 23, 2014 @ 12:09:46

According to this new post over on the Mashable site, PHP is one of the "languages to learn" for 2014. Others in the list include Java, C and relatives, Python and Ruby.

The tech sector is booming. If you've used a smartphone or logged on to a computer at least once in the last few years, you've probably noticed this. As a result, coding skills are in high demand, with programming jobs paying significantly more than the average position. Even beyond the tech world, an understanding of at least one programming language makes an impressive addition to any resumé.

They point out that PHP powers more than 200 million websites all around the internet and shares a few links of places to learn more about the language (including Udemy and Codeacademy).

0 comments voice your opinion now!
programming language learn 2014 mashable developer

Link: http://mashable.com/2014/01/21/learn-programming-languages


Community Events





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


laravel opinion framework install api list update zendserver tips interview series podcast package deployment library introduction community release symfony language

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