Frameworks and more..

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Frameworks and more..

Post by nathanr »

I'm not 100% sure if this is the correct place to be asking this, however I'll post it here anyways and assume it'll get moved to the correct place if I am indeed wrong :)

Frameworks - Am I the only person here who doesn't use one, and wouldn't use one? And by framework I mean a commerical framework like symphony, Interakt etc.

Infact I think I can expand this a little further, as I won't even use PEAR, CURL, smarty or anything similar, if I can make it myself I will, unless ofcourse it's something big like gdimage. How about the rest of you? or am I alone in my belief that it's best practise to not be as independent from external packages as possible?

Here a bit of what's prompted me to ask this:
2 weeks ago I just completed writing my own httprequest objects, after reading every line of the HTTP1.1 rfc's, and was mighty proud of it, and pleased with the minimal filesize.
I've been working on various projects as part of a contract for an agency, where again they use a framework (interakt). Every site I've worked on has been over 10mb of php scripts, even though they are only 5-10 page functional sites. I've had to use dreamweaver, frameworks, phpmyadmin and all the extra "make life easier" gubbins you can think of, couldn't get into servers as the VPN's where locked down from there side, and it's been hours of hitches like that. To make things more of a turn off for me, I've literally been fixing bugs in TNG that they've had outstanding for a few months, and all because the "developers" could only develop using frameworks.. surely that's not PHP??? To be completely honest, I can't wait to get back to textpad, putty and a command line.

*looks for the rants forum*
ev0l
Forum Commoner
Posts: 56
Joined: Thu Jun 21, 2007 1:50 pm

Re: Frameworks and more..

Post by ev0l »

nathanr wrote:To be completely honest, I can't wait to get back to textpad, putty and a command line.
Real men use ed.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

and you think you can deliver quickly a better product without using frameworks compared to someone using a framework - I'd bet 90% of the time you cannot.

Think of textpad, putty and a command line as frameworks themselves :wink: just another layer of abstraction that makes things easy,well known hence, reliable enough for everybody to use.
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

I think I'd prefer to role my own framework and then use that to deliver a better product quicker :D

realistically though, no I don't think I could develop somethings quicker than somebody who was used to using frameworks, however that said I also know that if I was using frameworks on a daily basis, I'd only last a few weeks before my brain ground to a boredom induced halt and swicth to gardeneing or something. Personally I won't do the same kind of project again unless I can see a better way of doing it or want to try something new, it's all about the challenge.

This said, it means I pretty much rule myself out of the quick agency type projects, however I do get landed with all the debugging jobs and the larger commercial projects, which I find more enjoyable, challenging and better paid.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

Well you can always challenge yourself at another level - design or whatever...even with frameworks.
I would use frameworks to just not do boring stuff that there is no much challenge in.
What you're saying is practically never reused your code in more than one project. If you have, which I am sure is true, you are actually building a framework just in smaller scale :)
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

exactly jmut, I do often re-use my own collection of objects, and regularly beef them up, mainly just value validation/db interfaces/http request objects to be honest. I always make all my code re-usable, however find that by the time I get back to re-using them it's the next version of PHP, so I just re-write them again! [ps: just replied to your upload problem in the toher thread]
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Hey nathanr, it sounds great so post the code somewhere so we can download it and use it. You will get feedback that you can accept or ignore, and maybe provide some helpful code to others. I agree that keeping you own lightweight codebase can for some projects balance against using the big codebases of that frameworks provide.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Frameworks make sense - when their done right.

C++ for instance has some excellent frameworks which make Windowed style development waaaaaaay easier. PHP has some "interesting" frameworks as well. The problem with PHP frameworks IMHO is they are to new and haven't been tested and used and studied properly.

Zend comes damn close to what I would consider a usable framework, but they use some techniques/practices which I disagree with so unfortunately I won't use it.

That said, I use my own in house framework, which is essentially an extremely simplified front controller, helper classes, etc. Only about 6 classes in total but they've evolved is highly reusable modules that suit every need I have ever encountered. Occasionally I will use third party libraries which are really specialized, such as SwiftMailer.

I truely believe in the kiss principle. I like minimal everything not overly abstracted/bloated frameworks. I start with something basic and abstract when the need actually arises.

"Do only what is nessecary to get the job done and nothing more" is the Agile/XP mantra and it makes sense. :)

Just my two cents :)
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

agreed, I too find that a few lightweight classes work for me - speeds up the repetitive things, especially where validation is required, so many regex strings it's unreal!
SwizzCodes
Forum Newbie
Posts: 20
Joined: Tue Dec 19, 2006 3:23 pm

Post by SwizzCodes »

nathanr wrote:exactly jmut, I do often re-use my own collection of objects, and regularly beef them up, mainly just value validation/db interfaces/http request objects to be honest. I always make all my code re-usable, however find that by the time I get back to re-using them it's the next version of PHP, so I just re-write them again! [ps: just replied to your upload problem in the toher thread]
reminds me of someone .. oh, that's me! :)
Today, I have a nice set of classes for validation, templating, database/model stuff, some helpers (mostly wrappers for utf-8 use) and a frontcontroller with filters that I use in my projects. I also refactor them a little bit most of the time I use them.

Basicly I just don't like to use foreign code. I like to write it myself if I can, because I don't have to deal with bugs I didn't cause myself and which I cannot fix quickly and I also don't have to force myself into a structure though out by someone else :)
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

I have a nice set of classes too.. all of which need about 5 minutes work to make them comemrical release, you know tidy up a var I no longer need here, add in a couple of comemtns (if not just to explain to msyelf!) 've actually got a protx integration here I may post up for people to use, for the v2.22 protocol including the new authenticate etc
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Frameworks and libraries are very useful. But I use very few because I have a couple of quality standards to which all 3rd party code bases I use must adhere to:
  • Created using test driven development, the presence of unit tests isn't usually enough, the library has created with testability in mind
  • Good OO design (unless it's simple enough that I can quickly make my own proxy to it)
  • Near complete high quality documentation
  • Active development, or developer is contactable
these criteria (in fact just the first two) wipe out literally 99% of all PHP code. There are literally hundreds of framework out there and I don't know one that caters for my requirements. By all means point me to one. The exception to this is non-PHP code so I use PECL for instance. The result is I write my own framework. I have found additional advantages to doing it this way:
  • No code bloat. I only have what I need
  • Ability to make decisions. Over time you find yourself making decisions that lots of code comes to depend on, knowing the reasoning behind those decisions and when you can break them is very useful. Also the decisions I make can be highly contextualized to my servers and development environment.
  • My code is more flexible and scalable than most released code because I don't have to cater for inexperienced programmers.
  • I learn lots
  • I can fix bugs myself in a timely fashion. I can fix bugs in other people's libraries too, if they meet my criteria
Last edited by Ollie Saunders on Wed Aug 01, 2007 6:47 pm, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

nathanr wrote:I have a nice set of classes too.. all of which need about 5 minutes work to make them comemrical release, you know tidy up a var I no longer need here, add in a couple of comemtns (if not just to explain to msyelf!) 've actually got a protx integration here I may post up for people to use, for the v2.22 protocol including the new authenticate etc
Great. It sounds interesting. I look forward to trying the code out.
(#10850)
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

arborint wrote:
nathanr wrote:I have a nice set of classes too.. all of which need about 5 minutes work to make them comemrical release, you know tidy up a var I no longer need here, add in a couple of comemtns (if not just to explain to msyelf!) 've actually got a protx integration here I may post up for people to use, for the v2.22 protocol including the new authenticate etc
Great. It sounds interesting. I look forward to trying the code out.
somebody really wants to see my code! 8O
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

nathanr wrote:somebody really wants to see my code! 8O
If it's unit tested I'm interested too, but it's not is it? You should post some of it in Constructive Criticism.
Post Reply