SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Abstracting PHP Functions?

    We all know that PHP has a rather verbose function list, and that many of those functions are reptitive, antiqued or unfavourable. I was tossing around the idea of abstracting from most used and best used functions. Would this be a complete waste of time?

    I guess the biggest problem would be dependencies.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you be a little more clear on what you plan to abstract? What would you gain?

  3. #3
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by The New Guy
    We all know that PHP has a rather verbose function list, and that many of those functions are reptitive, antiqued or unfavourable. I was tossing around the idea of abstracting from most used and best used functions. Would this be a complete waste of time?

    I guess the biggest problem would be dependencies.
    "verbose function list", right..

    "I guess the biggest problem would be dependencies."

    You mean in like DI ?

    "abstracting from most used and best used functions", you'll only limit yourself, programming PHP is not about abstracting the PHP itself....

    Use the functions in the way you want, if you "are" building a system your users (the ones who are making use of your software in order to get the result's they want) are gonna use "custom" methods you defined within your software no,.... so why bother, would be a complete waste of time...

    Business as usual is off the menu folks, ...

  4. #4
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think he's speaking of something like an OO wrapper layer on top of the native PHP types.

    Nice as an idea, but by no means worth it in the end, I'm afraid. Just go Ruby.

  5. #5
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This would be useful indeed (and not only native types -- even more of things like timestamp, file...), and I have often thought of making one, but IMO it should better wait until PHP implements namespaces. And an extension with that functionality would be useful as well.


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
  •