Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Function value arguements vs struct arguement

$
0
0

That depends really on your requirements.  There's no de facto standard in ColdFusion AFAIK.  Does the data make more sense as a single structure, or are they 4 independent strings that should be on their own?  e.g. if it was something like a customer record, it might make sense as a structure:

doStuff(

  customer = {

    firstname: "Joe",

    lastname: "Bloggs",

    title: "Sir",

    greeting: "Hi "

  }

);

 

Whereas you might have 4 values that aren't really all about one thing, e.g.

doStuff(

  pageTitle= "Hello World",

  cssFile= "/path/to/file.css",

  customerEmail= "info@example.com",

  today= dateFormat(now())

);

 

Which would also be fine (apart from the wisdom of having a function requiring such disparate arguments)


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>