Jump to content

Framework Blues


ibuprofen

Recommended Posts

From the videos I watched on the Zend site I understand the MVC concept although I don't think model-view-controller are the most appropriate descriptive terms. Since I've been developing PHP I have unwittingly created my own framework in that respect. I call mine: dbConnectScripts, phpAndHTML and specialScriptsAndFunctions. I see no need to separate the PHP from the HTML, at least not for what I'm doing.

 

Also, it seems like using a framework will create lots more files. That is something I actually strive to avoid. I annotate all my PHP scripts to avoid that. More files is something I DO NOT want. However, if using a framework is really as beneficial as they say, I should probably be willing to learn and use one.

 

The question I can't seem to figure out is exactly how does using Zend or any other framework help me write better or faster code? My experience has been just that, the more I develop, the easier it gets. I created a small library with snippets I constantly copy and paste so I don't have to rewrite them. I also borrow heavily from existing scripts I wrote from scratch. The more I develop, the more resources I create for myself. I have read a book and watched more online videos but they're assuming I'm a formally trained programmer. They get into all this obscure (at least to me) programmer talk and lose me pretty fast.

 

I guess I don't understand how it's implemented and I haven't been able to find a plain English or real world example. I'm beginning to suspect this has been done on purpose.

 

Anyone else feel my pain?

 

Tom

Link to comment
Share on other sites

The idea that you have a small library of code you copy and paste into projects alone should be enough to sound alarm bells. A well designed framework should allow you to develop multiple sites on one code base and therefor make improvements (to the framework) in one place without the need to change your code in multiple places.

 

At the same time, a framework like Zend is designed in such a way that you extend its functionality within your own projects without ever having to hack the framework itself.

 

Initially you will likely write more code, but once start developing projects and a library of your own (built on top of whatever framework) the amount of code you write will decrease.

 

Sure, you may use more files. Why? Because files are easily included into new projects. By splitting your code up into logical segments of responsibility you increase its usefulness and its ability to be reused.

Link to comment
Share on other sites

The nice thing about a MVC framework is that your files are neatly organized, so who really cares if you have more files?  I don't see that as any type of argument against using a framework.  I've been using CakePHP for my last couple projects and the time saved on basic CRUD operations alone was enough to sell me on the idea.  I like to have built in helpers and utilities that come with a good framework.  There is a slight learning curve at the beginning but in the end I'm happy I started using one.

 

The reason I chose Cake over Zend for now is because of the conventions used.  I think strict conventions made it easier to learn and get going pretty quickly.  I think you have to invest some more time in learning Zend because it can be used as a framework or just a nice set of libraries.  It is more up to you to configure your applications. 

Link to comment
Share on other sites

I feel your pain!  :-\

 

Im trying to move over my own project written using php/mysql/jquery into the zend framework.  I grasp the basic concept, but after trawling through many videos, pdf's and tutorials im getting nowhere.

 

But now ive had some coffee and im just going to get on with it.  I was going to use Code Igniter, but the benefits of Zend are dangling in front of me like a carrot.  :P

 

Your not the only one.

 

Has anybody here got links to any gems to share on learning Zend?

 

 

 

 

Link to comment
Share on other sites

There is no tutorial that will make an expert from you once you read it. The tutorials can teach you, how the framework is organized and how to use the particular features, or the theory of building applications using MVC. Unfortunately, to learn the practical part, you have to practise, study other projects and after a while your applications should look better and better. My first Zend Framework application also wasn't a masterpiece, believe me.

 

Maybe you should try a simpler framework, like Kohana?

Link to comment
Share on other sites

The question I can't seem to figure out is exactly how does using Zend or any other framework help me write better or faster code?

At first you're probably gonna be way slower writing a program since you're learning how to work with the framework but once you have gotten the hang of it things will take a lot less time. The benefit of working with these frameworks (as already mentioned) is the separation of the logic, data and view. It makes the code more readable and easier to maintain especially for others that might jump in a project later on.

 

This is going way off topic but anyway.....

Im trying to move over my own project written using php/mysql/jquery into the zend framework.  I grasp the basic concept, but after trawling through many videos, pdf's and tutorials im getting nowhere.

 

Moving your existing project to an MVC framework depends on how big the project is. If it's a big project then you're better off starting from scratch and rewrite it all. It is pretty much the same as trying to convert a procedural written program to an OOP design. If it wasn't designed from ground up to be OO then converting it all might do more harm to the project then improvement.

 

Has anybody here got links to any gems to share on learning Zend?

Learning how to write a basic CRUD app is prob one of the ways to learn how ZF works. Look into tutorials for that.

 

Starting with Zend Framework as first MVC framework well.... for me personally it has a pretty steep learning curve and I am still learning how to work with it and giving me a migraine at times. I started with Jango (python) as MVC framework and it was pretty clear how MVC worked. I was particularity impressed about the ORM (even though I didn't know what it was ORM at that time).

 

I hear from others as well as my own experience is that its easier to pick learn how to work with cakePHP. Because I have learned how to work with these "lighter" MVC frameworks it was easier to learn how to work with ZF. Maybe it could work for you too.

 

 

 

Link to comment
Share on other sites

Learning how to write a basic CRUD app is prob one of the ways to learn how ZF works. Look into tutorials for that.

 

I have followed 2 pdf tutorials and whilst I can do it and understand the MVC, writing the code for my app is so frustrating.  Also I have seen various vid tuts online which all have different ways of doing it!  One website had them in order and in the 2nd video the bootstrap and application.ini were completely different!

 

Starting with Zend Framework as first MVC framework well.... for me personally it has a pretty steep learning curve and I am still learning how to work with it and giving me a migraine at times. I started with Jango (python) as MVC framework and it was pretty clear how MVC worked. I was particularity impressed about the ORM (even though I didn't know what it was ORM at that time).

 

I hear from others as well as my own experience is that its easier to pick learn how to work with cakePHP. Because I have learned how to work with these "lighter" MVC frameworks it was easier to learn how to work with ZF. Maybe it could work for you too.

 

Maybe you should try a simpler framework, like Kohana?

 

This isn't going to come to me overnight so im going to take your advice and start with a more simpler framework,  I can remember a time when css was over my head  :P

 

Link to comment
Share on other sites

Hi guys, I was wondering if I could get some advice.  I had an idea for a baseball MMORPG that I've decided to take a stab at.  I have a smattering of programming background (took high school computer science 7 years ago, got away from it in college, made some .asp websites over 5 months after college, got away from it when I went to law school, now finished law school and learning php).

 

I have just started over the last week to learn OOP.  I'm getting the basics, but haven't yet had that breakthrough where I know how to use it to my advantage (still programming procedurally with objects, as it were).  I'm going to commit more time to getting OOP down.

 

Does it make sense for me to learn a framework at this time?  I plan to only make one website (although I guess plans can always change).  If so, and since people are saying Zend has a high value but steep learning curve, what do you suggest?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.