![]() |
when your write perl / php
coders be honest do you constantly go back to stuff you have done before and cut and paste about 50% of it and modify it a bit ?
or do I just suck ? |
a lot do that to save time
|
hmm, nope
|
there is nothing wrong with reusing old code, but it's best to package up stuff into functions/classes and then just drop those into new projects... only a fool would rewrite everything from scratch each time...
|
Yes, it's called code templates and I have 1,000s of them.
|
"why reinvent the wheel"
|
Oh hell yes. Absolutely. All the more reason to write good code the first time.
|
Quote:
|
If you were a teacher and you wrote the best lesson plan in the WORLD for your 8th grade British Literature class one year....would you start over the next year :winkwink:
|
you are better of creating libraries with your most used functions.
|
Quote:
|
I try not to copy and paste... Maybe I might resuse an old function once in a blue moon, but it is so unlikely. Most the shit I write is fresh, even if I had just reinveinted the wheel.
|
Quote:
|
I write everything in assembly, from scratch each time. :)
Remastered, any tips on organizing your code templates? |
first lesson my university prof taught me: "a real programmer is lazy".
so yes, i reuse a lot of code. |
Definitely use classes. Inheritance and shit can save you a ton of time. Why write code to send emails everytime when you can do it in a single class and include, or form checking, database handling etc. Just a waste of time if you don't use classes imho.
|
Quote:
|
All times are GMT -7. The time now is 03:45 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123