SitePoint Sponsor

User Tag List

Page 6 of 6 FirstFirst ... 23456
Results 126 to 136 of 136
  1. #126
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    You don't have seepage... You get leakage, and that is what it is. In my view, prodecural development has little scope for application design, and therefore, little skill is required.
    If there was "little scope for application design", but you wanted to write something with comparable complexity, wouldn't it require more skill to continue to have working software?

    Douglas
    Hello World

  2. #127
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    Even if they still wrote the same procedural scripts that the would have previously written, they would at least have some sound structure and clear depencencies. My goal was not to try to change the way they code, but to wrapper their code in some goodness so that the goodness slowly seeped into their code.

    Again, you input is appreciated. Perhaps a rewind and code review of the "skeleton" code is needed. I have been using my fork of the code on a project to actually see if it works and realize that it needs more work.
    "skeleton"

    I think that's a good place to start, actually. [...]

    Back to PHP, lets assume that our developer writes code, and has a vague understanding of what his code does, even if noone else would want to read it. With a skeleton, he has to have an understaning of the skeleton (most of it anyway) before he can put in his code. But he already understands his own code, and probably won't want to change much of it without good reason. (I find that good programmers are better at deleting their own code when they discover they don't need it anymore, especially when they have version control.) So I say lets not give him something to put his code in, lets give him something he can put in his code.

    So, I'm looking for code that someone can take, copy paste into their script, that will give them value.

    And I've just had a cunning plan. You do remember what site we are on, right? This is SitePoint, articles, tutorials and stuff? Lets write an article which demonstrates a piece of code (which happens to be OO) that an average PHPer can use, learn from, and find useful*.

    So, what piece of code could fit that description?

    Douglas

    * This does assume that we are above-average PHPers, but we've been hanging around in the "Advanced" forum so long we might as well proove it.
    Last edited by DougBTX; Sep 1, 2005 at 15:12.
    Hello World

  3. #128
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    You don't have seepage... You get leakage, and that is what it is. In my view, prodecural development has little scope for application design, and therefore, little skill is required.
    Perhaps you missed my point. I was saying that if you give an new programmer some clean structure (MVC for example) and tell them, "just put your code here and here" that even if what they code are just little procedural scripts, there overall application is better. And eventually as they use the structure and see some of the other classes available and ask questions here, OO will slowly seep into their code like it has yours.
    Quote Originally Posted by Dr Livingston
    That is why when I started out learning PHP I quickly realised that if I wanted more, if I was to be bigger, better, and bolder, I had to move to object oriented programming. You talk about me having views about procedural programming <> object oriented programming.

    And, referring back to the earlier posting about Highlander,... There can only be one, and that my friend is object oriented programming. There is just way too many advantages of it, that it just can't be ignored.

    As for those people who script spagetti code, sure there is a lot of that, and that is one of the short falls of PHP and it's ease of use. Like I said, anyone can use PHP, but alas, and this is a valid point, not everyone can develop.

    Not so long ago I made the statement that some people see OO as a way of life, and others as a religion yes? Well I fall into the later category
    Unfortunately your belief perhaps makes only monologue possible.
    Christopher

  4. #129
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    Back to PHP, lets assume that our developer writes code, and has a vague understanding of what his code does, even if noone else would want to read it. With a skeleton, he has to have an understaning of the skeleton (most of it anyway) before he can put in his code. But he already understands his own code, and probably won't want to change much of it without good reason. (I find that good programmers are better at deleting their own code when they discover they don't need it anymore, especially when they have version control.) So I say lets not give him something to put his code in, lets give him something he can put in his code.

    So, I'm looking for code that someone can take, copy paste into their script, that will give them value.

    And I've just had a cunning plan. You do remember what site we are on, right? This is SitePoint, articles, tutorials and stuff? Lets write an article which demonstrates a piece of code (which happens to be OO) that an average PHPer can use, learn from, and find useful*.

    So, what piece of code could fit that description?
    I think that tack can produce something useful. The "skeleton" started from a different tack because it assumed that the programmer had recognized the limitations of her/his code and was looking for a better way.

    I think a CRUD system might be a good example. But, to build something useful you need to add simple Template, DB, Pager and Form Field classes to a codebase similar to what we have in the "skeleton" to make it happen. That is where the "skeleton" has stalled.

    I could post some of the code that I have been using to try out my fork of the "skeleton" codebase, but it would need to be refactored because I just grabbed some Pager code found on the web.
    Christopher

  5. #130
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dreamscape
    Are you trying to insinuate that phpBB is a security risk because it is largely procedural? That is what it sounds like.
    Well ... yes and no. There is nothing wrong with procedural if done right. I was refering to "the right way of doing things" i.e. Purity vs "getting the job done" i.e. Utility. And I am getting tired of the later.

    Sure, phpBB is a forum, what harm can come from it being hacked, right ? But what if the next time is a shopping cart you used and someone gets all your contact information, you social security number, and your bank account / credit card info. What if it's a paid members only forum and an outsider gets a hold of your world domination scheme ? What then ? Huh ?

  6. #131
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    But, to build something useful you need to add simple Template, DB, Pager and Form Field classes
    Why?
    Hello World

  7. #132
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    Why?
    I have found that if you don't have these utility class separated out, they clutter up the example code and obscure what you are trying to show.

    Most of us have a number of support classes and just take them for granted. But to the new programmer they are "skeleton" because, like Controllers, they exist to support the application specific code.

    But maybe I am thinking of something different than your idea?
    Christopher

  8. #133
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Douglas, I've spent quite some time writing a reply and at the end deleted it completely, I was repeating myself (bottom line: A contract breach and invalid user input just isn't the same thing in my book)

    We simply have different opinions on the matter, I believe you've expressed yours and I've expressed mine, we'll probably never agree, and that's just fine by me. It has been an interesting discussion, at least to me, YMMV
    Per
    Everything
    works on a PowerPoint slide

  9. #134
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Not so long ago I made the statement that some people see OO as a way of life, and others as a religion yes? Well I fall into the later category
    Probably more accurately, some of us see OO as a tool, and other see it as a god. Walk with care if you fall into the later category

  10. #135
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dreamscape
    Probably more accurately, some of us see OO as a tool, and other see it as a god. Walk with care if you fall into the later category
    I see it as a way of living
    (Why, are you going to shoot us ? )

  11. #136
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I have found that if you don't have these utility class separated out, they clutter up the example code and obscure what you are trying to show.
    Re: OOP Articles / Site System

    Yes, I think a CRUD example would be good. Perhaps we could focus almost totally on the R, leaving Pager and Form Field classes till later, and use bare-bones PHP templates for output.

    Douglas
    Hello World


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •