Programming Convention Survey of the day
-
2 of course because I was brought up on K&R and PDP architecture. I'm told being left handed also helps :-D ~A
PIP for the win!
-
True that.
Zakk Of all Trades
I'm believe the name "everynameiwant" is still available.
"Shoes For Industry!" - G. Tirebiter
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
I prefer (1) as it is intuitive. On the other hand, before I even learned C I learned some Assembly - and got rather used to the target, source order. It was kept constant, and thus did not boggle the mind with inconsistencies. Not so fast: However, (2) has the following going for it: The best way would be to handle this by keeping the setup consistant within a given family of functions (methods, or whatever). Often this means putting the target first, and than various arguement sets would follow (called overloading these days). I do tend to like this consistency of form that
target, params
allows."The difference between genius and stupidity is that genius has its limits." - Albert Einstein
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
CopyObjectArrayToRecord( array, record )
-
CopyObjectArrayToRecord( array, record )
in addition, when using COM for IDispatch programming, the last parameter is usually used as the return value... so your convention follows a common practice.
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
-
WEllllll, for a modern language, I would expect CopyObjectArrayToRecord(object[], record) But, if I were in C (and not C++), I would fully expect it to be CopyObjectArrayToRecord(record*, object*), or more likely objrecncpy :) - Phil
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
1 makes the most sense, but the thing is written wrong in the first place. It should be: Array.CopyTo(Record r) and/or: Record.CopyFrom(Array a)
"Quality Software since 1983!"
http://www.smoothjazzy.com/ - see the "Programming" section for freeware tools and articles. -
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
I expect #1. What makes most sense is to never allow a developer to make this decision in the first place. Class Record Copy(array) Parameter lists are evil, period.
Dwayne J. Baldwin
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
#1--What did I when? And are ya ever gonna tell us your point?
____________________________________________________________________________ "Space is big. You just won't believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space." -- Douglas Adams -- Shohom67
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
What about make the whole signature (parameters names too) tell about semantic? CopyTo( Object[] source, Record destination ) This can be lighter to use: array.CopyTo( record ) my fear is that people tend abuse naming, I saw around names like: CopyFirstObjectArrayParameterToSecondRecordParameter :wtf:
pp
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
why isn't 2? I like 2!;P
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
As long as the types are different and the parameter names are sufficiently descriptive, I don't think it matters.
-
I want to know what makes most sense for developers: Before you arm yourself and point it to be a programming question let me say that this is not a programming question. I have a function named
CopyObjectArrayToRecord
, it takes two parameters: an object array and a record. Just based on the name what do you expect the order of parameters to be: 1. array, record 2. record, arrayCo-Author ASP.NET AJAX in Action
1 is more logical ;)
-
True that.
Zakk Of all Trades