Page 2 of 2

Re: What's your take on using frameworks?

Posted: Wed Apr 30, 2008 2:15 pm
by RobertGonzalez
One of our sister sites, PHP Classes, has some pretty decent class compilations. HotScripts.com is another site of code bases and links to code bases.

Re: What's your take on using frameworks?

Posted: Thu May 01, 2008 7:23 am
by deejay
http://sourceforge.net/?testing=1 is along the same lines as hotscripts

Re: What's your take on using frameworks?

Posted: Mon May 12, 2008 6:55 pm
by LSJason
To be completely honest, I find frameworks to be useless. Why have the bulk and overhead of the unused functions just to facilitate the one, two or three that you actually use?

Re: What's your take on using frameworks?

Posted: Mon May 12, 2008 7:10 pm
by Christopher
LSJason wrote:To be completely honest, I find frameworks to be useless. Why have the bulk and overhead of the unused functions just to facilitate the one, two or three that you actually use?
With most modern frameworks you only load the code you need. The combination of a Front Controller and loading Models/Views/Helpers/etc. on demand is one of the most effective and organized ways to minimize the amount of code loaded -- especially for larger applications.

Re: What's your take on using frameworks?

Posted: Wed May 14, 2008 12:45 pm
by JacobT
I personally haven't used this combination (yet) but CodeIgniter combined with Matchbox seems like a very good solution for me. I'm not a heavy developer so I prefer the lightweight of CodeIgniter compared to Zend or Symphony. Plus the documentation is great and easy to follow. I was REALLY excited about using Kohana (CodeIgniter branch before EllisLab started fixing the bugs people were getting frustrated with) but it's PHP5 only and the majority of client work I do is on servers that barely support PHP4...

Here's a link for Matchbox though, http://code.google.com/p/matchbox/

Re: What's your take on using frameworks?

Posted: Wed May 14, 2008 2:04 pm
by volomike
LSJason wrote:To be completely honest, I find frameworks to be useless. Why have the bulk and overhead of the unused functions just to facilitate the one, two or three that you actually use?
Frameworks give you the following advantages:

* Optimize development time. As a freelancer with competition being very brutal, a lightweight framework (and that's key that I said lightweight) is just the ticket to meeting deadlines.

* Can work in teams and isolate code to some degree.

* Separates XHTML from programming logic.

* Is better than, say, Smarty, because it gives you much more than separation of XHTML and programming logic.


Some disadvantages are:

* Learning curve to learn a framework.

* Everyone seems to have their favorite framework. Let's say you spend 15 hours teaching yourself CodeIgniter and knocked out two client projects with that. Then along comes a client and he only wants someone who knows Zend Framework. It's frustrating to have to keep switching gears. Right now I see a huge uptick in CodeIgniter on a lot of PHP dev blogs, and my closest associates use it, so I'm wondering if, gee, I should plop down the time to use it.

* Some slowness, like you mention, because stuff runs through an architecture in order to achieve an effect instead of just zipping through one function and on the screen it goes. That's the tradeoff -- faster pages with somewhat messy and disorganized logic, or slightly slower pages with clear, organized logic.

Re: What's your take on using frameworks?

Posted: Wed May 14, 2008 5:34 pm
by Eran
I didn't use frameworks back when I was building simple CMS sites. When I started moving to more complicated stuff I realized I needed more organization and mostly separation between logic and presentation. That's when I found out about MVC and design-patterns in general, and decided to start the framework path (about 18 months ago).

Personally, I have to say that using a framework (in this case, the ZF) was the single biggest boost for my development as a programmer and (*gasp*) software architect.
Through learning how the framework works (usually happens when I need it to do something and encounter resistance) I improved my coding standards, improved my understanding of OOP principles and how design-patterns work in real-world (and relevant) scenarios and much more.

I would say that for small-time PHP'ing, using a framework is probably too much as the time investment is significant at first. However for anyone serious about web-development, using a framework is practically a must in my opinion. Trying to invent the wheel for each possible scenario is very-unproductive. Using a framework you get:
* A comprehensive code-base of (hopefully) consistent and high-quality (usually backed by tests)
* Backed by a community - More people mean more bugs are tracked and fixed. Definitely more than one person can get (you)
* A structure for developing web-application (bootstrapping, MVC, directory structure)

For the dude who wanted high-quality independent scripts, check out http://ez.no/ezcomponents

Re: What's your take on using frameworks?

Posted: Wed May 14, 2008 10:49 pm
by volomike
I think it also comes down to the question of, "At what size of a project do I need to have before I introduce a framework?" That's something I haven't been able to answer yet. I do know that if I have a client need for something that sounds like a CMS, then I definitely want to use a CMS framework without hesitation. And if it sounds like a forum, then, again, use a forum framework. But for a generic framework like Zend or CodeIgniter, that's the question that sits in my mind on whether I need to introduce one or not.

For instance, I recently did a project for a client that was a classified listings directory with searching and browsing, and paid-sponsored listings to promote some items to the top of relevant searches. I did it in a very structured way, using Smarty to help handle the layout, using a common strategy for how I handle every aspect of the application. If I had known jQuery at the time, I would have used that. If I had known Blueprint CSS, I would have also used that as well. But as for a framework like Zend or CodeIgniter, I think it would have slowed the application down and would have yielded little benefit because I didn't really need nearly 1/3 of all the features available in ZF or CodeIgniter.

Re: What's your take on using frameworks?

Posted: Sat Jun 07, 2008 1:45 am
by workingbeijing
who can send me a demo of solarphp?

Re: What's your take on using frameworks?

Posted: Sat Jun 07, 2008 8:49 am
by RobertGonzalez
You can download it from http://www.solarphp.com

Re: What's your take on using frameworks?

Posted: Mon Jun 09, 2008 3:28 pm
by blueyon
I like code igniter! Its simpicity is like nothing else available in other frameworks.

The only flaws I think it has is that it can only have one instance of a class loaded in the registry. I have been thinking about how to get round this and it probably a good idea to have some factories in the helper directory.

Re: What's your take on using frameworks?

Posted: Mon Jun 09, 2008 5:45 pm
by alex.barylski
The only flaws I think it has is that it can only have one instance of a class loaded in the registry. I have been thinking about how to get round this and it probably a good idea to have some factories in the helper directory.
Just curious, but can you give me an example as to when you might have more than one instance of a class??

Re: What's your take on using frameworks?

Posted: Mon Jun 09, 2008 6:30 pm
by blueyon
Hockey wrote:Just curious, but can you give me an example as to when you might have more than one instance of a class??
There are lots of reasons for multiple instances of objects.

On some pages you might want 2 pager classes on the same page.

You might require another config instance for storing values.

If you want to stay true to OOP when creating a shopping cart system you would turn each product into a object.

$product1->getName();
$product1->getPrice();

$product2->getName();
$product2->getPrice();

This is the only problem with code igniter.

Do you think 3d game creators use one class per bad guy or player?

Checkout how Zend loader or Joomla loader works. They register classes in a static singleton class then use autoload when the objects are called through the script.

Re: What's your take on using frameworks?

Posted: Wed Jun 11, 2008 5:20 pm
by alex.barylski
Ok, I see what your saying. Only I wouldn't store the products in the registry so I wouldn't have to worry about singletons. The shopping cart would be a model object with methods like

Code: Select all

selectAllProducts(p1, p2, p3)

Re: What's your take on using frameworks?

Posted: Wed Jun 11, 2008 5:55 pm
by blueyon
It depends how you set your classes up.

The only problem that I have found using to many singletons is that half way though a project a client might ask for something that requires more than one instance.