|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2005
Location: Saudi Arabia
Posts: 1,756
|
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 |
|
Google search user
![]() ![]() ![]() Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 9,421
|
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 |
|
PHP Brainiac
![]() ![]() ![]() Join Date: Jul 2006
Location: Kiev, Ukraine
Posts: 335
|
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
|
|
|
|
|
|
#4 |
|
SitePoint Mentor
![]() ![]() Join Date: Nov 2005
Posts: 2,505
|
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 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: Netherlands
Posts: 476
|
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 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2005
Location: Saudi Arabia
Posts: 1,756
|
Thanks guys, although i wanted generic answers to my questions.
![]() Anyone else? |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:49.













Linear Mode
