Page 1 of 1

Vocabulary

Posted: Mon May 02, 2005 8:49 am
by Roja
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.

Posted: Mon May 02, 2005 9:40 am
by timvw
- 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.

Posted: Mon May 02, 2005 12:52 pm
by shiznatix
id call it a snippet, if its just somthing like

Code: Select all

$string = trim($string);
$string = strip_tags($string);
then i would consider somthing like that to be a snippet. but thats just me

Posted: Mon May 02, 2005 1:07 pm
by The Monkey
A "block" of code?

Posted: Mon May 02, 2005 1:30 pm
by andre_c
i would call it a scriplet

Posted: Mon May 02, 2005 2:28 pm
by neophyte
Call it a snippet.

Posted: Sat May 07, 2005 9:51 pm
by m3mn0n
Snippet.

Posted: Sat May 07, 2005 10:13 pm
by McGruff
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 :)

Posted: Sun May 08, 2005 9:44 am
by shiznatix
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 :)
haha!

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?

Posted: Sun May 08, 2005 10:10 am
by John Cartwright
+1 Snipplet

Posted: Sun May 08, 2005 11:09 am
by phpScott
snippet as well for my vote.
I know I store little bits of code that i reuse outside of a web app and store them in a folder called snippets.

Maybe this post can be edited to incude a poll to see what the general opinion is.