SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: APIs

  1. #1
    SitePoint Wizard mPeror's Avatar
    Join Date
    Mar 2005
    Location
    Saudi Arabia
    Posts
    1,724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    APIs

    I've always been that kind of programmer who keeps re-inventing the wheel, and avoid using APIs (for my own reasons), but now that i decided to start using them (to save time), I have a few questions:

    1) How do you decide whether you should use an API or code something on my own?

    2) Do you study the code behind APIs or just use them right away? and why?

    3) If you don't or don't have time to study the APIs code - how do you determine its performance and security?

    4) If you wanted to make a script that needed something you have never worked with before (say "session management" for example), would you use an API for it or try to learn how it works by coding it yourself the first time?


    Your input is appreciated.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)

    learning tools

    It depends on how often I might use something and how hard it is to learn, (and how interested I am in learning it). If I can do something relatively easy using something I'm familiar with, I don't bother spending lots more time learning something that may have helped me do it a little faster.
    I just installed a phpBB forum on my site. I spent a couple of weeks MOD'ing it, and I've looked at most of the 300+ files. I certainly wouldn't want to write a clone app of it from scratch! But luckily it's open source, so I could use the MODs that were available and do a few things on my own to tweak it a bit.
    I wouldn't recommend using too many apps "off the shelf" without at least checking the support forums for security issues first. And I also think the source should be studied enough to get a feel for things.
    But then again, I enjoy writing code and learning new things (and I prefer to write using notepad as the editor!). Heck, I even like running my Java from the MS-DOS command line.

  3. #3
    PHP Brainiac dg_den_golotyuk's Avatar
    Join Date
    Jul 2006
    Location
    Kiev, Ukraine
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is a matter of finding a golden middle. If you are to crate the soft on your own just for practising - you do not need to lear and implement some difficult API. But when you are to code a complex structured project - the APIs are almost on every step of the way
    DG [Den Golotyuk], Lead Developer
    Chestnut Software
    Avoid web outsourcing scams!
    Click here
    for a free downloadable report

  4. #4
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I try to examine at least how the pieces of the framework are working. But only when I have sufficient time. If deadlines are tight you have no option then to use APIs as they are. For example, examining code behind various Pear packages gave me the real feel of how inheritance can be applied to build robust frameworks. It did improve my OO skills. But then you always donít have time to do that.

  5. #5
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    It depends really. I once integrated a popular forum into my site using it's API but it slowed my pages down 10-fold. So I coded a mini-API myself, and cut the slow down from 1000% to 10%. For another application I integrated the API was so well built and performed so well that I used it without a worry.

  6. #6
    SitePoint Wizard mPeror's Avatar
    Join Date
    Mar 2005
    Location
    Saudi Arabia
    Posts
    1,724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, although i wanted generic answers to my questions.

    Anyone else?


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
  •