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

William Durand:
From STUPID to SOLID Code!
August 01, 2013 @ 12:45:11

William Durand has a new post to his site sharing not only the slides from his recent presentation on SOLID vs STUPID code but the same content written out. It provides a great overview of the two concepts and some examples of what to avoid. There's also a recording of the session you can listen to via the in-page player.

Last week I gave a talk about Object-Oriented Programming at Michelin, the company I am working for. I talked about writing better code, from STUPID to SOLID code! STUPID as well as SOLID are two acronyms, and have been covered quite a lot for a long time. However, these mnemonics are not always well-known, so it is worth spreading the word.

In the following, I will introduce both STUPID and SOLID principles. Keep in mind that these are principles, not laws. However, considering them as laws would be good for those who want to improve themselves.

He starts with the STUPID concepts first - Singleton, Tight Coupling, Untestability, Premature Optimization, Indescriptive Naming and Duplication. He goes through each of these and explains why they're bad things to have in your code. He then gets into the SOLID ideals - Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle. These are a bit more complex to understand but he does a good job (complete with code snippets) of each. The slides for his presentation are also included but they're just a high level look at the same concepts from the article.

0 comments voice your opinion now!
presentation solid stupid code concepts slides recording overview

Link: http://williamdurand.fr/2013/07/30/from-stupid-to-solid-code

Script-Tutorials.com:
Functional Programming - How to Write Functional Code in PHP
May 09, 2013 @ 11:04:26

On the Script-Tutorial.com site today there's a new post looking at functional programming in PHP - some of the concepts involved and example code showing how to make it work.

Functional programming can be defined in simple terms as a programming paradigm that do not change the state of a program instead it uses pure functions. A pure function is a function that has the ability to accept a value and return another value without changing the input supplied to it. It is characterized by its ability to support functions that are of high order. [...] A programming paradigm that is functional has the following attributes: do not alter the states which make parallelism easier, deals mostly with a function which is the smallest unit hence enhances readability of code, has deterministic functions that enable stability of a program.

He talks some about anonymous/lambda functions (closures) and their role in PHP's implementation of functional programming. He also talks some about partial functions, currying, higher order functions and recursion. He finishes off the article with a look at some of the advantages this method of development can bring as well as some of the disadvantages that come with things like recursion and the learning curve of the method.

0 comments voice your opinion now!
functional programming tutorial introduction concepts examples

Link: http://www.script-tutorials.com/functional-programming-php

PHPMaster.com:
Functional Programming and PHP
February 26, 2013 @ 09:43:42

On PHPMaster.com today there's a new tutorial written up by Shameer C looking at functional programming with PHP - some of the basic concepts of it and how much is possible in the language.

Many programmer like to talk about functional programming, but if you ask them if they've ever done it, most of their replies will be "No". The reason is quite simple: we are taught to think in an imperative manner when we first start learning to program, in terms of flow charts and steps to be followed in the program. So in this article I'll explain some important concepts to functional programming and how to write functional code in PHP.

He starts by defining some of the basic fundamental concepts of functional programming including recursion, referential transparency, higher order functions and lambda functions. He includes a bit of code along the way, showing things a bit more practically.

0 comments voice your opinion now!
functional programming tutorial introduction concepts fundamentals


Jeremy Brown's Blog:
A Conversation About REST
April 28, 2011 @ 08:38:11

As mentioned in this new post to his blog Jeremy Brown has put together a presentation he calls "A Conversation about REST", a discussion that centers less around the implementation of REST and more about the concepts needed to fully understand it.

REST is a set of principles and not a specification, so as such you have freedom in how to develop your API. This freedom can lead to confusion though, as it's hard to find concrete examples of its implementation. This presentation explained what REST is and also presented a variety of topics and questions you will certainly come across while implementing your API.

You can watch a video of this great presentation (as taken at a Club Ajax meeting in Dallas) here and can follow along with his slides off of SlideShare. He also links to a great image that gives a flow overview of the possible paths a REST request could take.

0 comments voice your opinion now!
rest presentation clubajax video slides api concepts


Paul Reinheimer's Blog:
Object-Oriented PHP, Concepts, Techniques, and Code
September 08, 2006 @ 07:06:29

Paul Reinheimer has written up a review of one of the latest offerings from No Starch Press - "Object-Oriented PHP, Concepts, Techniques, and Code".

I'll get this out of the way up front; I approached this book with a completely inaccurate perception of what it was going to give me. I would consider myself an intermediate to advanced php developer, and I was hoping this book would teach me awesome ways to use PHP5's OOP power to make my applications better, faster, and more attractive to women.

That wasn't what this book does. This book introduces OOP, explains why it's useful, and goes through to develop several sample applications to demonstrate OOPs power, and more importantly how to use it.

He goes on to talk about the content/size of the book (relatively thin) including what it covers - beginning OOP, OOP in PHP4 and PHP5, a sample application, and a brief look at some of the more advanced features possible.

His overall opinion of the book is good, but there were two complaints that he had, more of a technical nature than just about the content (like the quality checking of the font size in paragraphs, changing in the middle). He'd still recommend it to those looking to get into OOP in PHP, though.

1 comment voice your opinion now!
book review object oriented programming concepts techniques book review object oriented programming concepts techniques


php|architect:
New Object Oriented PHP Book
June 28, 2006 @ 06:37:04

Over on php|architect's site, there's a mention from Marcus about a new book from No Starch Press called "Object-Oriented PHP: Concepts, Techniques, and Code" (by Peter Levin) along with a little review.

"Object-Oriented PHP" is ideal for the developer who wants to learn object-oriented programming in PHP. If you already know how to use objects under PHP 4 this will get you up to speed with PHP 5. If you don't know anything at all about object-oriented programming, what better way to start than with the straightforward approach of PHP?

He has good things to say about the book, noting that it's laid out well, provided ample descriptions about the code and concepts presented, and helps you get the most out of your PHP5 programming.

You can purchase the book directly from the No Starch Press website in either paperback ($39.95 USD), a PDF version ($19.95 USD), or a combination of both ($43.95 USD). There's even a sample chapter if you want to try before you buy.

4 comments voice your opinion now!
object-oriented book review concepts techniques php5 object-oriented book review concepts techniques php5


DevShed:
Iterators in the Simplest Sense - An Accessible Implementation in PHP 4
March 09, 2006 @ 07:12:15

DevShed has published the first in a new series that looks to explain the implementation and core concepts behind using iterators in PHP. This time, they look at creating this environment in PHP4.

Here, I'm not going to offer a full reference for what each design pattern is. You can buy a book to learn that, or even do some "googling" and find other helpful resources that probably will treat the subject much more extensively. Instead, I'll provide you with a concise explanation of what an Iterator is, in conjunction with numerous sample codes, which hopefully will help you understand much more easily how it can applied in PHP object-oriented programming.

They start off by looking at what the Iterator pattern is - the setup of a pseudo-class and an explaination of how it works. They follow this with a functional example and creating a subclass off of the generic base class.

0 comments voice your opinion now!
design pattern iterator core concepts implementation design pattern iterator core concepts implementation


DevShed:
User-defined Interfaces in PHP 5 - Introduction to Core Concepts
December 21, 2005 @ 07:16:28

From DevShed today, there's a new tutorial concerning interfaces in PHP5 and how to define some of your own.

In this tutorial, I'll introduce the use of user-defined interfaces in PHP5, covering the basics of its theory along with the implementation of different examples, aimed specifically at demonstrating its functionality in real applications.

Before we get started, a few items with be required. You should have at least a basic familiarity with the PHP5 syntax, along with an intermediate knowledge of concepts related to object-oriented programming. Therefore, having defined the objectives of the article, let's move on to learning about user-defined interfaces in PHP5.

They still define what the interfaces are before they get started, but shortly there after they jump right in creating some other interfaces: DeSerializer, PostSaver, and MySQLCache. They tie them together in the end to make a functional example...

1 comment voice your opinion now!
user-defined interface php5 core concepts user-defined interface php5 core concepts



Community Events





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


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

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