 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Script-Tutorials.com: Functional Programming - How to Write Functional Code in PHP
by Chris Cornutt 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.
voice your opinion now!
functional programming tutorial introduction concepts examples
Francois Zaninotto: Node.js for PHP Developers Series
by Chris Cornutt January 23, 2013 @ 09:21:48
If you're a PHP developer and have ever wanted to branch out into learning another language, Node.js is a popular choice right now. To help you ease into some of the concepts that Node development involves, Francois Zaninotto has come up with his "Node.js for PHP Developers" series of posts (4 of them now, one previously mentioned here):
in each article he provides code examples showing "the Node way" versus "the PHP way" to do various things. It's a great little series and can definitely kickstart your Node.js knowledge.
voice your opinion now!
nodejs developer tutorial series examples code
NetTuts.com: Namespacing in PHP
by Chris Cornutt October 02, 2012 @ 13:48:00
On NetTuts.com today there's a new tutorial introducing you to namespaces in PHP and a complete guide to the features that come with them.
It's been a bumpy ride, in regards to namespace support in PHP. Thankfully, it was added to the language in PHP 5.3, and the applicable structure of PHP code has improved greatly since then. But how exactly do we use them?
They start with a definition of a namespace (for those unfamiliar with the term) and get right into the code showing their use in PHP:
- Defining a Namespace (and Sub-namespaces)
- Calling Code from a Namespace (using Unqualified/Qualified/Fully Qualified names)
- Dynamic calls
- The namespace Keyword
- Aliasing or Importing
voice your opinion now!
namespace tutorial introduction features examples
JellyandCustard.com: Regular Expressions in PHP
by Chris Cornutt June 22, 2006 @ 07:03:06
In a post from JellyandCustard.com, there's an inside look at regular expressions in PHP - how to use them and what they are.
Regular Expressions (regex for short) appear to a lot of people as the 'black art' of coding. Most languages, be it PHP, Java, C, .NET, VB etc have a way of using regular expressions - and they can certainly make your job easier. So lets start on our journey into regular expressions. I am by no means an expert, but hopefully I'll be able to clear the fog that surrounds regular expressions!
He mentions the functions to use and provides a simple example of matching a phone number (US format). They take the regular expression string and break it down into its pieces, explaining how each one works (and relates to the other parts of the expression). They also provide a brief "cheat sheet" of some of the other special characters (including common uses on some).
voice your opinion now!
regular expression introduction tutorial functions examples regular expression introduction tutorial functions examples
SnippetCollection.com: PHP Snippets & Examples
by Chris Cornutt February 14, 2006 @ 07:09:05
Welcome to SnippetCollection.com. Here you can find a large collection of snippets and examples in ActionScript, Php, Java, Java Script, VB, VB.NET, C, C++, ASP, ASP.NET, Perl , SQL and Python.
SnippetCollection.com is just like it sounds - a resource for sharing those little handy pieces of code that we all use over and over again. There are various other categories, but the PHP section has its fair share of items in the list. Various topics and skill levels are represented here, everything from "calling a function" to advanced array operations. So, if you have a bit of code to share with the world, head over, sign up, and get started...
voice your opinion now!
snippets examples share snippets examples share
|
Community Events
Don't see your event here? Let us know!
|