RE: better way to code?

2005-02-03 Thread S . Isaac Dealey
is assembled allowing you to decide what portions are shown before they are rendered. Just my 2pence Kola -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 31 January 2005 13:50 To: CF-Talk Subject: RE: better way to code? In light of this discussion, how about lots

Re: better way to code?

2005-02-01 Thread Keith Gaughan
Johnny Le wrote: There is a discussion right now in CF-Jobs-Talk called Indian Code. It says I mentioned to the client that the code looked like it was done by a first month CF programmer. You know the type, pound signs everywhere, lots of CFIFs, etc. Didn't say the code sucked or

RE: better way to code?

2005-01-31 Thread kola.oyedeji
..is that what you meant? Kola -Original Message- From: Michael T. Tangorre [mailto:[EMAIL PROTECTED] Sent: 29 January 2005 03:42 To: CF-Talk Subject: RE: better way to code? From: Johnny Le [mailto:[EMAIL PROTECTED] I shouldn't have given that specific example. My reason for bringing

RE: better way to code?

2005-01-31 Thread Calvin Ward
In light of this discussion, how about lots of cfif statements buried in html...? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 8:46 AM To: CF-Talk Subject: RE: better way to code? Johnny Just to clarify, are you referring to lots

RE: better way to code?

2005-01-31 Thread kola.oyedeji
] Sent: 31 January 2005 13:50 To: CF-Talk Subject: RE: better way to code? In light of this discussion, how about lots of cfif statements buried in html...? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 8:46 AM To: CF-Talk

Re: better way to code?

2005-01-30 Thread Chris Jensen
Claude Schneegans wrote: It seems to use the power of CF more. It may be, but is it really what makes good code? The first code is more intuitive , logical and it corresponds to the real situation. It explains more clearly the two situations that can be encountered. The second code

Re: better way to code?

2005-01-29 Thread Claude Schneegans
Who says beginners code has a lot of cfif statements? Probabily beginners ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks.

Re: better way to code?

2005-01-29 Thread Claude Schneegans
but I still feel that I have too many CFIF in my code. The quantity of IF statements has nothing to do with the quality of code. Replacing them with CASE just for the sake of reducing the number of IF is completely idle. As someone pointed out, IF... ELSEIF reevaluates a conditional expression

Re: better way to code?

2005-01-29 Thread Claude Schneegans
lots of CFIFs If one mean CFIF used when something simpler could be used, then this is true, but it is not particular to CFIF, one could say that any piece of code that could be simpler and/or more efficient makes the code look amateurish. Too many CFSET could mean exactly the same thing if

Re: better way to code?

2005-01-29 Thread Adam Haskell
I think the place I see too many if statements is for some matchmatical figures. I can't honestly come up with one on a saturday morning/afternoon after a long night of wedding planning but I have seen code like if today is monday add 6 if today is tuesday add 5 ect... When they could have used

RE: better way to code?

2005-01-29 Thread Joe Eugene
extensible. Joe Eugene -Original Message- From: Johnny Le [mailto:[EMAIL PROTECTED] Sent: Friday, January 28, 2005 9:19 PM To: CF-Talk Subject: Re: better way to code? I shouldn't have given that specific example. My reason for bringing this whole issue up is that people say beginners' code

RE: better way to code?

2005-01-29 Thread Michael T. Tangorre
From: Joe Eugene [mailto:[EMAIL PROTECTED] This is true to a certain extent, most logical conditions can be related to a data structure without conditions (If conditions) and in most situation the data structure make the code/application extensible. Joe... I don't follow you here??

Re: better way to code?

2005-01-29 Thread Adam Haskell
I think I do and nicely put joei think like puting this.a=namea snd this.b = nameb you have direct access to this.a to get the name instead of loopoing through a result and going if current value eq b output name. Am I following ya Joe? Adam H On Sat, 29 Jan 2005 13:43:52 -0500, Michael T.

Re: better way to code?

2005-01-28 Thread Claude Schneegans
It seems to use the power of CF more. It may be, but is it really what makes good code? The first code is more intuitive , logical and it corresponds to the real situation. It explains more clearly the two situations that can be encountered. The second code leads to think that the second case

Re: better way to code?

2005-01-28 Thread Claude Schneegans
wouldnt using cfcase cfswitch be more correct? More correct, not really. CFCASE, as any case construct in any language, is not any better than a simple IF ... ELSE IMHO, CASE constructs can be better for three cases or more. -- ___ REUSE CODE! Use custom

Re: better way to code?

2005-01-28 Thread Adam Haskell
On of java's pitfalls is file access, when compared to things like PERL, so anything you can do to cut down on file acessing the better so I would tend to say the first code with the IF would be better. Adam H On Fri, 28 Jan 2005 10:43:07 -0500, Claude Schneegans [EMAIL PROTECTED] wrote: It

Re: better way to code?

2005-01-28 Thread Will Tomlinson
More correct, not really. CFCASE, as any case construct in any language, is not any better than a simple IF ... ELSE IMHO, CASE constructs can be better for three cases or more. It's good to keep in mind that CFSWITCH/CFCASE tests for multiple values of the same expression, CFIF/CFELSEIF

Re: better way to code?

2005-01-28 Thread Claude Schneegans
It's good to keep in mind that CFSWITCH/CFCASE tests for multiple values of the same expression, CFIF/CFELSEIF tests for multiple conditions. Abolutely, this is why CFCASE may be more efficient than CFIF/CFELSEIF if the expression is the same. But a CFIF/CFELSE also evaluates only one

Re: better way to code?

2005-01-28 Thread Barney Boisvert
Actually, I did some reasonably comprehensive tests on CFMX 6.1 sometime last year, and found that this was NOT the case with CFMX's implementation of CFML. Using CFSWITCH was noticably slower. I don't remember the specifics for sure, but around 30% slower seems familiar for some reason. Note

Re: better way to code?

2005-01-28 Thread dave
@houseoffusion.com Subject: Re: better way to code? Actually, I did some reasonably comprehensive tests on CFMX 6.1 sometime last year, and found that this was NOT the case with CFMX's implementation of CFML. Using CFSWITCH was noticably slower. I don't remember the specifics for sure, but around 30

Re: better way to code?

2005-01-28 Thread Johnny Le
I shouldn't have given that specific example. My reason for bringing this whole issue up is that people say beginners' code has a lot of CFIF statements. I am using Fusebox now. So it elimates a lot of CFIF statement already, but I still feel that I have too many CFIF in my code. I am just

RE: better way to code?

2005-01-28 Thread Michael T. Tangorre
From: Johnny Le [mailto:[EMAIL PROTECTED] I shouldn't have given that specific example. My reason for bringing this whole issue up is that people say beginners' code has a lot of CFIF statements. I am using Fusebox now. So it elimates a lot of CFIF statement already, but I still feel

Re: better way to code?

2005-01-28 Thread Johnny Le
There is a discussion right now in CF-Jobs-Talk called Indian Code. It says I mentioned to the client that the code looked like it was done by a first month CF programmer. You know the type, pound signs everywhere, lots of CFIFs, etc. Didn't say the code sucked or anything, just that it looked

Re: better way to code?

2005-01-28 Thread Barney Boisvert
Here's a link to the thread from last February about the relative speed of the two constructs, including results of the test that I did. http://www.houseoffusion.com/cf_lists/messages.cfm/Threadid=30474forumid=4 The results were pretty conclusive, even moreso than I remembered. The tests

RE: better way to code?

2005-01-28 Thread Michael T. Tangorre
From: Johnny Le [mailto:[EMAIL PROTECTED] There is a discussion right now in CF-Jobs-Talk called Indian Code. It says I mentioned to the client that the code looked like it was done by a first month CF programmer. You know the type, pound signs everywhere, lots of CFIFs, etc. Didn't

RE: better way to code?

2005-01-28 Thread Dave Watts
I shouldn't have given that specific example. My reason for bringing this whole issue up is that people say beginners' code has a lot of CFIF statements. I am using Fusebox now. So it elimates a lot of CFIF statement already, but I still feel that I have too many CFIF in my code. I am

RE: better way to code?

2005-01-27 Thread Taco Fleur
First one, second one should throw an error. And I would make it cfif left( url.dir, 2 ) IS E: cfset variables.myPath = url.dir / url.inputfile / cfelse cfset variables.myPath = ExpandPath(url.dir) / url.inputfile / /cfif cffile action=write file=#variables.myPath# output=

re: better way to code?

2005-01-27 Thread dave
wouldnt using cfcase cfswitch be more correct? From: Johnny Le [EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:42 PM To: CF-Talk cf-talk@houseoffusion.com Subject: better way to code? Which method of programming do you consider is better? This

Re: better way to code?

2005-01-27 Thread Barney Boisvert
I'd say that any application that allows file paths to come from the URL is wrong, no matter the code. Second, any application that allows mixed relative and absolute paths for the same file is asking for trouble. And third, make sure you check for a leading / as well, or you code will puke on