PHP Classes

General discussion

Recommend this page to a friend!

      Top level forums  >  Site  >  Features  >  General discussion  >  (Un) Subscribe thread alerts  
Subject:General discussion
Summary:We may need a forum area to discuss PHP and OOP
Messages:2
Author:Jean-Georges Estiot
Date:2011-05-29 00:14:17
Update:2011-06-05 23:10:10
 

  1. General discussion   Reply   Report abuse  
Picture of Jean-Georges Estiot Jean-Georges Estiot - 2011-05-29 00:21:26
Apart from project-specific forum discussion areas, there does not seem to be a lot of scope for a general discussion of PHP, OOP, coding styles, class design and so on. MY apologies if I miss something.

I have looked at a lot of classes in the last few days and it seems that a lot of programmers forget what good programming is about. A forum discussion on this could help the younger people who submit very good ideas but need help with class design. Perhaps it is about what I call "project blindness" when the programmer is so eager to complete a project, the class design is compromised and it ends up not being reusable for other projects.

A forum discussion would hopefully lead to collaboration. How many classes here store the host, user, password and database for a MySql connection? How hard would it be for the community to use just the one DB connection class? That class can be used within other classes and simply be substituted to connect to SQLlite or other DB systems. Same with all the generic calls to databases to produce inserts, updates, deletions, last id, and the rest of it.

I have followed PHPclasses for years now and I think it is a fantastic site. It started as a collection of classes but perhaps now it is time to start isolating the code that everyone keeps rewriting and reuse it. Isn't that what classes are all about?

How many classes do we need to validate fields? How many classes do we need to output fields to Html? How many times do people rewrite the code for making a combo box?

We could have a voting system to vote on the class we want for DB connection, another class for DB functions. The naming convention would be the same so people who want to work with MySQL would use one class with the MySQL functionality. Others would use other classes with the same design, the same functions but interfacing with other DB systems.

Just an idea. We could move from the "everyone puts their class on this site" to "everyone collaborates".

Happy coding everyone.

JG

  2. Re: General discussion   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-06-05 23:10:10 - In reply to message 1 from Jean-Georges Estiot
As for the general purpose forum, there is the PHP specialists forum:

phpclasses.org/discuss/topic/specia ...

As for choosing a single class that performs a certain purpose, that is practically impossible because there are many similar solutions but there is not a single one that is consensually the best.

What is there is the top rated classes for each category or also by keywords. That gathers classes for similar purposes but list them according to user ratings.