News Feed
Jobs Feed
Sections




News Archive
feed this:

Reddit.com:
Good guidance for shifting to OO from Procedural coding
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!

0 comments voice your opinion now!
reddit opinion oop procedural programming guide suggestion


Anthony Ferrara:
Programming With Anthony - Paradigm Soup
November 22, 2012 @ 09:50:23

Anthony Ferrara has posted about his first video in a series he's creating about programming and related topics. In this first one he talks about "Paradigm Soup".

So, for the past few days I've been talking about a secret project that I've been working on. Well, today I'm pleased to announce the project. I've been working on starting a series of YouTube videos about programming. The first of these videos is about Paradigms (Procedural, OOP, Functional). Plenty of future ones are planned, but the topics, order and even if they happen is completely up to you!

He goes through some common practices in things like OOP, functional and procedural programming as well as how they relate to each other. You can view the video in the post or you can watch it over on Youtube. If you want to keep up with the series, you can follow this playlist.

0 comments voice your opinion now!
video tutorial series paradigm oop functional programming procedural


Slawek Lukasiewicz's Blog:
Working with date and time in object oriented way
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.

1 comment voice your opinion now!
time date datetime objectoriented procedural tutorial


Aleksey Martynov's Blog:
Getting started with lexa-tools Blog in 15 Minutes
May 25, 2011 @ 11:10:58

Aleksey Martynov has submitted a new tutorial showing you how to (create a) "blog in 15 minutes" with the help of the lexa-tools framework, a set of utilities that gives you a procedural API to some handy tools.

The tutorial walks you through all the steps you'll need:

  • setting up the environment
  • creating a site skeleton
  • making the blog posts model (with the CRUD generator)
  • make the main page to display the latest posts
  • adding comments
  • creating a page for each posts's detail
  • and the comments view

If you'd like to just skip to the end, you can download the source here.

0 comments voice your opinion now!
lexatools blog tutorial framework procedural


James Cohen's Blog:
Working with Date and Time in PHP
May 04, 2011 @ 08:59:23

James Cohen has a new post to his blog today looking at some of the built-in functionality that PHP has to work with dates and times including simple things like strtotime and the DateTime feature.

A lot of people ask questions relating to date and time in PHP. Here are some answers to the most commonly asked questions and common mistakes.

He covers the differences between working with dates in strtotime, worrying about timezone settings and compares the strtotime/DateTime methods for formatting and returning dates, modifying dates, converting between timezones as well as finding the difference between two timezones.

0 comments voice your opinion now!
date time datetime strtotime timezone tutorial procedural oop


Web Builder Zone:
The PHP paradigms poll results OOP wins
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.

0 comments voice your opinion now!
poll paradigm results oop objectoriented procedural


NETTUTS.com:
Object-Oriented PHP for Beginners
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.

0 comments voice your opinion now!
procedural development oop objectoriented tutorial introduction


Giorgio Sironi's Blog:
The dangers of Late Static Bindings
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.

0 comments voice your opinion now!
latestaticbinding danger procedural static hierarchy


Doug Brown's Blog:
Do You Really Need a Framework for Writing PHP?
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.

1 comment voice your opinion now!
framework advantages simplicity list procedural library


Eran Galperin's Blog:
Common misconceptions in web application development
July 21, 2008 @ 09:37:07

Eran Galperin has a few misconceptions in web development posted to his blog today (for both front and back-end development).

Here's his list:

  • OO code is less performant than procedural code
  • The backend is the most important part of development
  • Graphical designers are good at user interface design
  • The existence of a superior programming language
  • XML is more economic than a DB

While the others touch on some topics that could be PHP related, he focuses on it in #1. He points out that sometimes making classes and objects and interfaces and...well, you get the idea...is just too much and that procedural code can be the quick hit you need.

0 comments voice your opinion now!
misconception development common procedural object oriented



Community Events











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


framework example testing interview conference phpunit code opinion functional series language tool community unittest introduction application zendframework2 development podcast release

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