Vocabulary

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Vocabulary

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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
The Monkey
Forum Contributor
Posts: 168
Joined: Tue Mar 09, 2004 9:05 am
Location: Arkansas, USA

Post by The Monkey »

A "block" of code?
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

i would call it a scriplet
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Call it a snippet.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Snippet.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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 :)
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

+1 Snipplet
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

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