 | 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
TechFlirt: Object Oriented Programming in PHP
by Chris Cornutt April 02, 2013 @ 13:05:23
If you've been writing mostly procedural PHP code and are looking to make that "next step" up to working with objects and classes (OOP), you should check out this detailed tutorial introducing you to some of the primary OOP-in-PHP concepts.
Object oriented programming (OOP) was first introduced in php4. Area for oop in php version 4 was not very vast. There were only few features available in php4. Major concept of the object oriented programming in PHP is introduced from version 5(we commonly known as php5). [...] But still in php5 object model is designed nicely. If you have good understanding of OOP then you can create very good architecture of your php application. You only need to know some of the basic principles of object oriented programming and how to implement that concept of oop in php.
While the wording is slightly odd in some spots (English doesn't seem to be the author's first language), it's' a great introduction to the major OOP-related topics including:
Each section also has downloadable code to go along with the examples, making it easier to follow and test out the actual scripts.
voice your opinion now!
object oriented programming tutorial introduction series beginner
Reddit.com: Good guidance for shifting to OO from Procedural coding
by Chris Cornutt March 19, 2013 @ 12:33:29
On Reddit.com there's a conversation kicked off by user swiftpants about making the move from procedural PHP programming to the world of object-oriented programming. They ask for advice from the community for the next steps to take to make the jump.
One thing I always have in the back of my head is that all my code is procedural and I should be making use of classes and ?? more. I have a very basic understanding of OO programming but I rarely implement it. Is there a good book or online guide that can get me on my way to OO programming in php. I am especially looking for feed back from self taught programmers.
There's lots of comments on the post talking about everything from:
- Introductory videos from KillerPHP
- Reading lots of other people's (OOP) code
- That OOP is more about code reusing and simplicity (DRY) than abstraction.
- You can learn a lot by working with one of the MVC/OO frameworks. Download one and build something.
- The suggestion of phptherightway.com
Have any other thoughts on the best ways to learn OOP in PHP? Share them here!
voice your opinion now!
reddit opinion oop procedural programming guide suggestion
PHPMaster.com: Functional Programming and PHP
by Chris Cornutt 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.
voice your opinion now!
functional programming tutorial introduction concepts fundamentals
SitePoint: The 3 Myths of Learning Programming Languages
by Chris Cornutt February 07, 2013 @ 11:43:52
SitePoint.com has a new article sharing three of the things they see as common myths around learning new programming languages.
Are you yet to learn your first programming language? Why is it that you're putting it off? If you think it's going to be too hard, like learning a real, spoken language - you are wrong. In fact, you've fallen victim to what I like to call The Big Programming Language Fallacy - the mistaken belief that programming languages are analogous to real languages.
They go through each of their myths and explain what's wrong about them, each building on the previous ones in the list:
- Myth 1: Programming Languages are the 'Languages of Computers'
- Myth 2: Programming Languages are Foreign and Hard to Read
- Myth 3: Programming Languages Take Years to Learn
They point out that, in the case of most programming languages these days, they've been designed to be "readable" and something that can relate to basic terms (a subset of a completely new language).
voice your opinion now!
myth programming language learn fallacy
Lars Strojny: Functional programming in PHP
by Chris Cornutt January 17, 2013 @ 14:21:38
Lars Strojny has a new post that takes an in-depth look at the current state of functional programming in PHP:
PHP has traditionally been a simple, procedural language that took a lot of inspiration from C and Perl. Both syntax wise and making sure function signatures are as convoluted as possible. PHP 5.0 introduced a proper object model but you know all of that already. PHP 5.3 introduced closures and PHP 5.4 improved closures very much (hint: $this is available per default).
He starts by defining functional programming for those not familiar with the concept. With this understanding, he looks at what PHP has to offer that will help make this definition a reality, things like call_user_func_array and closures. He includes some code examples comparing the PHP structures to other languages and their features (like Haskell and Ruby). The post also gets a bit more practical with a "real world" example of a script that calculates the totals from the set of items in a shopping cart using a helper library to do some of the basic functional handling.
voice your opinion now!
functional programming example tutorial features functionalphp library
James Fuller: 2013 Programming Podcasts for the New Year
by Chris Cornutt January 03, 2013 @ 10:37:34
In a new post James Fuller has shared a list of programming podcasts he suggests you take a listen to as this new year starts off.
I have a long drive to work, and one of the things I do to pass the time regularly is listen to podcasts in the car. I really enjoy programming podcasts and conference talk recordings, and it's a really great way to educate yourself on the go. I wanted to throw a shout out to some podcasts that I haven't previously mentioned on the blog and hopefully turn on a few new listeners.
He's included six different shows in the list, some with a slant towards certain languages, but still valuable for developers in others:
voice your opinion now!
programming podcast suggestion listen
|
Community Events
Don't see your event here? Let us know!
|