 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
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
Slawek Lukasiewicz's Blog: Working with date and time in object oriented way
by Chris Cornutt June 10, 2011 @ 08:13:14
Slawek Lukasiewicz has a new post today about working with dates and times in PHP on a more object-oriented fashion than in the more traditionally procedural way of just calling PHP date/time functions on the string values.
Date and time manipulation in PHP is mostly connected with functions like: date, time or strtotime. They can be sufficient, but if we want to deal with dates like with objects - we can use DateTime class. DateTime class is not only straightforward wrapper for standard functions, it has a lot of additional features - for example timezones.
He shows how to use the DateTime functionality to return an object you can call several different methods on. He gives examples of the formatting call, comparing one DateTime object to another, how to update the date after the object's created, calculating the difference between two dates and iterating through a certain time period.
voice your opinion now!
time date datetime objectoriented procedural tutorial
Web Builder Zone: The PHP paradigms poll results OOP wins
by Chris Cornutt October 05, 2010 @ 11:21:17
According to this new post on the Web Builder Zone, the results of a poll taken about the best programming method for PHP these days is - by far - object-oriented programming.
After two weeks of gathering votes, the PHP paradigms poll is now closed. With 216 votes (73%), the winner paradigm in popularity is Object-Oriented Programming. The old procedural approach to PHP, which has given fame to Wordpress and Drupal, is coming to an end. Even Drupal 7 has an object-oriented database layer as a primary component, and this paradigm is by far the most diffused in the world for web sites and applications written in high level languages (different from C).
While the overwhelming amount of votes went to OOP, there were still a few for some of the other options including the second place winner - procedural programming. He also talks a bit about OOP's current place in the PHP ecosystem and how it has allowed for certain great tools to be developed, but how it also has a good ways to go in functionality.
voice your opinion now!
poll paradigm results oop objectoriented procedural
NETTUTS.com: Object-Oriented PHP for Beginners
by Chris Cornutt July 09, 2010 @ 08:56:25
If you're just making the move from procedural PHP development into the next level - object oriented programming - and are having a bit of trouble getting the hang of it, you might want to read this new tutorial from NETTUS.com introducing the topic.
For many PHP programmers, object-oriented programming is a frightening concept, full of complicated syntax and other roadblocks. As detailed in my book, Pro PHP and jQuery, you'll learn the concepts behind object-oriented programming (OOP), a style of coding in which related actions are grouped into classes to aid in creating more-compact, effective code.
He introduces the concepts behind objects and working with them in your code first then moves into how they relate to classes (with a housing metaphor). He talks about class structure, properties, methods (both magic and user-defined) as well as using __toString, visibility and using DocBlock comments in your code. They also have a comparison between procedural code and object-oriented code in the form of a few reasons to lean towards OOP.
voice your opinion now!
procedural development oop objectoriented tutorial introduction
Giorgio Sironi's Blog: The dangers of Late Static Bindings
by Chris Cornutt April 14, 2010 @ 07:06:41
Giorgio Sironi has a new post that warns you of the dangers that could come from the use of a technology just recently introduced to PHP - late static binding.
There's a lot of (justified) excitement about PHP 5.3 new features, such as the support of namespaces and anonymous functions. Though, some glittering capabilities of the language are definitely not gold: the goto statement is probably the most debated example, but also the long-awaited Late Static Bindings support is an hammer which may hurt your fingers...
He talks about how two of the characteristics of late static binding - the fact that it involves something being static and that there's a sort of hierarchy involved. He gives a code example of how it could be used and notes that static functions should be used sparingly since they are a more procedural way of doing things.
The post also includes a good example - an abstract Factory method - and a bad example - Active Record that doesn't evolve towards a Repository pattern being used.
voice your opinion now!
latestaticbinding danger procedural static hierarchy
Doug Brown's Blog: Do You Really Need a Framework for Writing PHP?
by Chris Cornutt December 16, 2008 @ 08:42:44
Doug Brown asks a question on his blog today that is coming up more and more, especially on those programmers new to the language that don't quite get what frameworks really have to offer. Do you really need a framework for writing PHP?
The simplicity in using PHP sometimes acts against it. Since there are very few coding restrictions, developers tend to write a bad code. The answer to this is definitely to use a framework. There are various PHP Frameworks available today like Zend Framework, CakePHP Framework and CodeIgniter. They provide a strong organization for your application and follow the commonly used MVC pattern.
To help out those new to frameworks, offers a few things they have to offer that normal procedural/library-based development may not. These include maintaining code standards, attractive URLs and getting help when you need it from other developers using the same system.
voice your opinion now!
framework advantages simplicity list procedural library
|
Community Events
Don't see your event here? Let us know!
|