![]() |
|
|
+ Search |
![]()
|
Jun 20th, 2000 07:12
unknown unknown, Brian Matthews, Jason K. Monroe
Question continued: Is it when a number is used instead of a name? For example, magic numbers are when you use rs.open sql, conn, 2, 3 Instead of using rs.open sql, conn, adOpenDynamic , adLockOptimistic Am I understanding this correctly? Answer: Yes, you are exactly right.. Magic numbers got the name due to the fact that you can put a number as a param to a piece of code and no one will really know what they mean. It always helps to be as descriptive as possible.. Even when I write server components, I will take parameterized inputs to my functions and routines and wrap them around an Enum to make it easier not only for myself to utilize the functions (6 months to a year down the road) but for other people to know what they mean as well.. It's all a readability/maintainability issue. It's a heck of a lot easier to know that adOpenDynamic means that you are going to open up a recordset in dynamic mode.. then to say "2"
© 1999-2004 Synop Pty Ltd