magic-numbers
Should I use an enum or multiple const for non-sequential constants in c++?
I\'m writing porting file-io set of functions from c into a c++ class.\"Magic numbers\" (unnamed constants) abound.[详细]
2023-01-16 20:23 分类:问答How do I avoid both global variables and magic numbers?
I know and understand that global variables and magic numbers are things to avoid when programming, particularly as the amount of code in your project grows. I however can\'t think of a good way to go[详细]
2023-01-15 07:07 分类:问答Is there a way to remove magic numbers from a XML Schema?
I have a WSDL with some types defined. Some elements accept lists of elements and on the service return I also have elements with list of values (or other elements).[详细]
2023-01-13 07:43 分类:问答guess what 0x564c is?
when i read linux kernel source, i found one line says: #define NCP_SUPER_MAGIC0x564c/* Guess, what 0x564c is :-) */[详细]
2023-01-07 20:30 分类:问答AddOutParameter - non-magic number way of finding length of DBType.Int32
I have a magic number in the following code... Microsoft.Practices.EnterpriseLibrary.Data.Database db = /* code o开发者_StackOverflow中文版mitted */;[详细]
2023-01-04 09:43 分类:问答Finding magic numbers using NDepend
Does anyone know how I could find magic numbers in the source code using the C开发者_StackOverflowQL queries in NDepend? This is the same problem as this question, but I don\'t want to use regex if po[详细]
2022-12-24 09:48 分类:问答Hard-coded 8191 10485 values in JavaScript rounding function
I\'ve seen the following (bizarre) Javascript rounding function in some legacy code.After googling for it I can see that it crops up in a number of places online.However I can\'t work out why the hard[详细]
2022-12-23 17:56 分类:问答How to get magic number of a binary file
There is a magic number associated with each binary file , does anyone know how to retrieve this informatio开发者_JAVA技巧n from the file?file <file_name>[详细]
2022-12-18 18:41 分类:问答Would These Be Considered Magic Numbers?
I\'ve just completed writing a program for a programming class, and I want to avoid use of magic numbers, so here\'s my question:[详细]
2022-12-17 20:06 分类:问答Are Constants Really Appropriate Here, Or Is There Another Approach? - C++
I\'m a programming student in my 2nd OOP course, which is taught in C++. I know that it is generally bad practice to use magic numbers in code, so here\'s my question:[详细]
2022-12-16 23:47 分类:问答