Vocabulary
Moderator: General Moderators
Vocabulary
I'm puzzled, and I hope people have some ideas.
For a PHP program, there are classes, objects, functions, and so on.
Its common to reuse classes, and sometimes even functions.
However, what do you call a small amount of code that is purely procedural (ie, not a function, and not a class), but that can be useful?
A script?
A snippet?
A program?
Avoid the obvious jokes (Spaghetti, crap-code, etc), as I'm honestly trying to find a common phrase/name for this type of code.
Thanks.
For a PHP program, there are classes, objects, functions, and so on.
Its common to reuse classes, and sometimes even functions.
However, what do you call a small amount of code that is purely procedural (ie, not a function, and not a class), but that can be useful?
A script?
A snippet?
A program?
Avoid the obvious jokes (Spaghetti, crap-code, etc), as I'm honestly trying to find a common phrase/name for this type of code.
Thanks.
- I would define a program as a list of instructions that a computer follows to perform a task.
- I would define a snippet as an extract (only a part) of a program.
- After having seen way to many discussions about the difference between a script and a program i'm pretty sure i can conclude there is no good definition for a script.
Therefore, i would call it a program.
- I would define a snippet as an extract (only a part) of a program.
- After having seen way to many discussions about the difference between a script and a program i'm pretty sure i can conclude there is no good definition for a script.
Therefore, i would call it a program.
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
id call it a snippet, if its just somthing like
then i would consider somthing like that to be a snippet. but thats just me
Code: Select all
$string = trim($string);
$string = strip_tags($string);-
The Monkey
- Forum Contributor
- Posts: 168
- Joined: Tue Mar 09, 2004 9:05 am
- Location: Arkansas, USA
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
haha!McGruff wrote:An orphan? On the grounds that it's a poor, orphaned piece of code all alone in the global scope, searching with big, begging eyes for a nice object to adopt it
but in reality how many votes we got for what
program - 1
snippet - 3
scriplet - 1
block - 1
orphan - 1
its probebly important that we come up with a standard to use on the forums so everyone can understand so what say ye? snippet?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: