Jump to content


Photo

Coding your own scripts == Reinventing the wheel?


  • Please log in to reply
9 replies to this topic

#1 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 10 June 2006 - 03:43 PM

Well, the first contact I had with PHP was like 2-3 years ago, when I began using IPB. Back then I also knew some C / JS / HTML.

At first, I had big troubles even to make IPB work, so I kind of thought coding something like that was rocket science, and I'd never understand. Then, the modifications. Installing modifications and acknowledging their existence made me realize it was not rocket science, but something reachable, I just had to learn.

From "then" to "now" I learned a fair amount of PHP and also similar languages. PHP is actually much easier than I first thought; it's a high level language, and whenever you have problems you can ask the community... Although reading the Manual usually helps.

So, I've changed my mind, from "reusing ready-made scripts" to "coding my own". I'm though often criticized for "reinventing the wheel".

Other arguments are "people spend a lot of time coding and improving their scripts. Do you think you can do something better alone"? True, but some scripts are overkill for my needs. Or also "you cannot make a secure script because nobody uses it". Also true, but if I don't publish my scripts, it's harder to find vulnerabilities. That's my opinion.

What is your opinion, concerning this matter?
Thanks in advance [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
~ D Kuang

#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 10 June 2006 - 03:53 PM

Totally agree with you. For one when you write your own scripts implementing changes is much easier, and it gives you a chance to improve weak point in existing scripts.

I don't think you can "reinvent the wheel" in programming. There are always improvements to be made, even on your own code. Hell, I've rewritten every script of mine about 10 times and I don't think it was a waste of time.
z..z..z..z..z..z..z..z..

#3 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 June 2006 - 07:34 PM

well all those people who made those wheels that you are allegedly re-inventing.. they had to start somewhere, too. Perhaps one day you will invent the car that uses the wheel, and then some poor sap will be accused of trying to re-invent the car [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 10 June 2006 - 07:54 PM

Moved to Miscellaneous forum as this is not a PHP problem topic.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 10 June 2006 - 07:59 PM

Many times I like to download scripts then change them.

-The wheel was invented a long time ago. Does the invention of the radial tire constitute 'reinventing the wheel'?
-The wheel was invented once, but wheel improvements are forever. My experience is that people who are always complaining about people reinventing the wheel are people who never invent anything and who only 'Boldy go where many have been before'.

#6 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 10 June 2006 - 08:03 PM

I don't agree with that statement one bit, with regards to reinventing the wheel. I would bet that there were more arguements for writing your own scripts than there are for using one thats already been made by someone else.
Here are a few that come to mind straight away...

- Security. The more people that are using the same script, the more chance of someone finding, and exploiting a vulnerability within that script. Look at phpBB.

- Time. With smaller tasks, I would image that it would be quicker to write your own scripts as opposed to searching through Google for one that fits your requirements.

- Ease of use. I'm not really a fan of working with other peoples code, as I'm quite particular in the way I write my scripts, and with this in mind, I think it would be more difficult to implement someone elses script within one of my projects. Because first I'd have to format it all to match my coding style. Also, depending on the complexity of the script, it might take a bit longer to read through it all a few times to fully understand what the original author has done.

- Feature sets. I think that is is unlikely that you find a script that fits your requirements exacty, writing your own ensures that you have the features you require, along with the knowledge about how your script works, making it easier to add, or ammend features.


There's just a few for you, I'm sure there are more, but you get the point.

#7 Koobi

Koobi
  • Staff Alumni
  • Advanced Member
  • 419 posts
  • LocationColombo, Sri Lanka | South Asia

Posted 10 June 2006 - 08:32 PM

i believe it's best to use a pre-existing class, for example, if it already does what you want to for the sake of meeting deadlines. but if your intent is to build a super optimized system, you should see if those classes are optimized for YOUR needs, if not, i don't see anything wrong with reinventing the wheel in such a case.



[!--quoteo(post=382244:date=Jun 10 2006, 09:43 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 10 2006, 09:43 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Also true, but if I don't publish my scripts, it's harder to find vulnerabilities. That's my opinion.
[/quote]
i have to say i strongly disagree with that. i believe it's better to initially publish the script in question in beta status as widely as possible so that people might notify you of vulnerabilities because different people would have different circumstances or different server setups and they might be able to pick out something you didn't even think of.
besides, i'm not such a big fan of hiding code. i believe that if you can do something unusual with code and people would find it useful and if sharing that code wont prevent you from putting food on the table, then you should share the information as much as possible because that way someone else might learn something new and who knows, that person might be the next Linux Trovaldis.
but that's just my opinion :)

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 10 June 2006 - 08:57 PM

Hands up everybody who has written their own 'version' of phpMyAdmin and which is better than phpMyAdmin.

Hands up everybody who has the time to write a better version of phpMyAdmin.

Hands up everybody who declines to use the phpMailer class because someone else wrote it.

Hands up everybody who has a script package at SourceForge.
Legend has it that reading the manual never killed anyone.
My site

#9 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 10 June 2006 - 09:10 PM

@Bane:

I like the idea of "security by obscurity". More or less:

- Security. The more people that are using the same script, the more chance of someone finding, and exploiting a vulnerability within that script. Look at phpBB.


@AndyB: Indeed, but I don't know what is phpMailer though :P
And most of my scripts are for private use and I don't think they would be very useful to anyone else ;)
~ D Kuang

#10 jeremywesselman

jeremywesselman
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts
  • LocationIndependence, KY

Posted 11 June 2006 - 07:56 AM

I think that if you are on a deadline and come across a script that does what you are looking to do, then use it. But I think it makes a programmer feel good to say that they coded the script on their own. I know it makes me feel a lot better about being me :)

And it also looks nice on your resume. To say you coded the whole thing and all the features.

But that's just me...

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users