View Full Version : Use a premade script or write your own?
10-13-2003, 03:52 PM
I have debated this alot inside of myself. Write a script? or use someone elses? Like for instance, I'd like to write a poll script, but it's much too complicated for me, but It would be easier to use a premade one. While writing your own you would have more control of the features, it would be easier to use someone elses......
10-13-2003, 04:23 PM
It depends on what you want to do. You wouldn't create another phpmyadmin, when you can just download it within a minute or so. You wouldn't make your own photo gallery if there was one to do your needs already created for you.
If you wanna reinvent the wheel, make your own stuff, if you wanna get stuff done fast, use someone elses scripts
10-13-2003, 04:48 PM
That's a good point....
10-13-2003, 05:00 PM
I find that a lot of the downloaded php programs, such as php photo galleries, are over coded with too much features on them. Plus when I open them up in notepad I don't have a clue what most of the code is for.
I am in the process of making my own php photo gallery instead of downloading one because its a good way to learn php. I also find this forum to be very heplfull.
10-13-2003, 05:02 PM
If it's just for learning, make your own. The scripts will come in handy in the future, but if it's for clients and you're on a tight timescale, use a premade script.
10-13-2003, 09:45 PM
Another point to consider is the quality of the premade script. Let's face it, there is some great PHP code out there, but a lot of the scripts you find via hotscripts.com or sourceforge.net are... well, to put it gently, not of the best quality. In many of them the separation between different application layers is munched together into one. Most of them have no proper error handling. And many don't state their requirements correctly. Almost every second phpBB mod I tried to install went by a requirement description like "needs PHP4 (duh!)", when in fact much more was needed - register_globals on, magic_quotes on, error_reporting disabled etc.
If you happen to find a lot of scripts, but not the right one to integrate in your application, it's time to write your own, and try to do it better.
10-13-2003, 09:50 PM
To add: Rewriting a script to learn PHP is a good idea, as Nightfire said. Especially because you always have that premade script which you can use as a blue print, and get some inspiration from it on how to solve a tricky part. Or use the forums.
My guidelines are:
- don't let your ego get in the way : you don't need to proove to yourself or others that you can write it all yourself completely from scratch in Notepad --> If there is good code available, use it.
- don't use code you don't understand : if you find some code, read and understand it before you use it and get yourself into problems
- coding is erasing and rewriting : cut the crap. Only take out the codesnippets you need and fit it into your own code
- security, errohandling, layout etc should be seperated from 'features-code' : if you borrow some code, only take out the functional part
- if you borrow code, make sure you put some references in your script to where you got the code from : if you've cut to much ae later run into problems, it's always handy to get the original (updated) stuff or the coders email.
10-13-2003, 11:49 PM
:thumbsup: I agree with your guidelines. Especially the giving credit/references part. No end of my scripts have been altered to show that the llama has created them, despite my days or weeks creating the scripts/programs.(not including the ones I give away for free)
10-14-2003, 07:48 AM
I favour writing my own code for most things. Mainly because I want to get better at PHP but also, becuase you can include the features that you want.
However, I dont to that for large scale stuff unless I need to, or really want to.
But i dont usually like using premade because its so hard to find what you want.
Eg: I was searching for a webmail about a month ago, on hotscripts. There was 2 (free) out of 100+ that would be any good. My requirements were: Send/Recieve e-mail, folders and editable template. I spent all day pretty much looking through the code and finding out if it had wat i needed
10-14-2003, 11:19 PM
Ok.....I thought it would be time to share with all of you the php photo gallery that I am coding myself in notepad. Below is what I have so far after about 5 hours at the computer.
I am now working on the rest of it.
10-14-2003, 11:34 PM
I like the way you set out the code. I found it easy to follow. usually i struggle with other peoples coding!
However when i cut and paste into my site it did nothing. Let me know when its finished as I am looking for a well coded photo gallery too!
10-15-2003, 04:36 AM
hmmmm , nice code but I suggest using full tags to be a bit more compliant ;)
... as for the issue , with pre-written scripts you always have the security issue.
with small snippets you can check the code is safe quite quickly , with stuff like phpBB you just need to google (or `security` related sites) for $script exploits / vunerabilities
but when you have a whole heap of code that you don't really understand then you can never be sure what security issues it brings with it .. some scripts will always be harmless , others potentially dangerous , & I think you need to weigh these issues on an indvidual basis.
My biggest gripe with pre-made scripts is that they mostly expect you to use thier login or authorisation scripts or other components that you probably have already , my biggest grip is scripts that use database abstraction which is not really abstracted very well ;) eg you can't just plug-into your own routines which 99% of the time already exist.
thats my 2.5c anyway
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.