Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use a premade script or write your own?

    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......

    Anymore comments?
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's a good point....
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #4
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    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.


    Leonard Whistler
    www.stubby.ca

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    De gustibus non est disputandum.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    De gustibus non est disputandum.

  • #8
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #11
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    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.


    PHP Code:
    <?


    ?>

    I am now working on the rest of it.


    Leonard whistler
    www.stubby.ca

  • #12
    New Coder
    Join Date
    May 2003
    Location
    UK
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    They only tell you its a stupid question when they don't know the answer!

  • #13
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,048
    Thanks
    10
    Thanked 93 Times in 91 Posts
    hmmmm , nice code but I suggest using full tags to be a bit more compliant

    PHP Code:
    <?php


    ?>

    ... 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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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