Welcome to Dream.In.Code
Become an Expert!

Join 150,002 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,329 people online right now. Registration is fast and FREE... Join Now!




Duck Typing Poll

 
Reply to this topicStart new topic

Duck Typing Poll

Duck Typing
I Type My ColdFusion Variables/Functions...
Never, I'll manage the error checking my self. [ 0 ] ** [0.00%]
Always, It's just safer [ 3 ] ** [50.00%]
Sometimes, some things yes, some things no [ 2 ] ** [33.33%]
Who cares? [ 1 ] ** [16.67%]
Total Votes: 6
Guests cannot vote 
Skinnyarms
27 Nov, 2006 - 07:59 AM
Post #1

New D.I.C Head
*

Joined: 18 Nov, 2006
Posts: 32


My Contributions
I'm putting together a kind of ColdFusion Tips website and I'm currently working on an article about Duck Typing. I tend to "type" most of my variables because it seems safer to me, and also perhaps because I come from a strong C/Database background. I just wanted to know how you guys felt about it.

This post has been edited by Skinnyarms: 27 Nov, 2006 - 08:00 AM
User is offlineProfile CardPM
+Quote Post

Dark_Nexus
RE: Duck Typing Poll
27 Nov, 2006 - 12:39 PM
Post #2

or something bad...real bad.
Group Icon

Joined: 2 May, 2004
Posts: 1,309



Thanked: 3 times
Dream Kudos: 625
My Contributions
considering most programming languages require types, it's lazy not too.
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Duck Typing Poll
27 Nov, 2006 - 12:46 PM
Post #3

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,277



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
I voted "sometimes" because there are instances where I may be using both a form AND url variable. I know, it's a bad practice, but sometimes it's just easier.

I never scoped by variables in PHP either though sad.gif
User is online!Profile CardPM
+Quote Post

William_Wilson
RE: Duck Typing Poll
27 Nov, 2006 - 02:03 PM
Post #4

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
Every language should include types... unless you are defining a general type for the use of inheritence and instances.
User is offlineProfile CardPM
+Quote Post

Skinnyarms
RE: Duck Typing Poll
27 Nov, 2006 - 02:16 PM
Post #5

New D.I.C Head
*

Joined: 18 Nov, 2006
Posts: 32


My Contributions
QUOTE(William_Wilson @ 27 Nov, 2006 - 03:03 PM) *

Every language should include types... unless you are defining a general type for the use of inheritence and instances.


ColdFusion has types, but you're not required to specify them. You can easily do something like this:

CODE


<cfset myTest = 4>
<cfset myTest = myTest * myTest>
<cfoutput>My Answer : #Replace(myTest,6,1)#</cfoutput>

My Answer : 11


QUOTE(skyhawk133 @ 27 Nov, 2006 - 01:46 PM) *

I voted "sometimes" because there are instances where I may be using both a form AND url variable. I know, it's a bad practice, but sometimes it's just easier.

I never scoped by variables in PHP either though sad.gif


I never even thought of how this applied to scoping, I'll be adding something about that to my article. Thanks!!
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Duck Typing Poll
27 Nov, 2006 - 02:23 PM
Post #6

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
no, i realize they are not required, php does not require them either, they are implied by the data placed into them.

My point was unless you have reason to leave it out (besides laziness) it is good practise to include them. It is much easier to remove them afterwards, than to find the places to put them in, i've found.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 08:33PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month