I saw the following identifier in code today:
Interrupt_Order_Array_Index
It was controlling a for loop. I can only assume that i took a day off.
What ridiculous code do you have to work with?
I saw the following identifier in code today:
Interrupt_Order_Array_Index
It was controlling a for loop. I can only assume that i took a day off.
What ridiculous code do you have to work with?
FAQ
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
Or maybe they wanted something more meaningful then i
Still its not as bad as hungrian notation
This is code to do polynomial regressions. It was origionally written in BASIC and no one has dared to try and make it more readable because they're afraid to break it (myself included).
It's now in one of my VB apps, but ridiculous nonetheless:
Code:A(1) = n For i = 1 To n xVal = x(i) yVal = y(i) For j = 2 To 2 * D + 1 A(j) = A(j) + xVal ^ (j - 1) Next j For k = 1 To D + 1 R(k, D + 2) = T(k) + yVal * xVal ^ (k - 1) T(k) = T(k) + yVal * xVal ^ (k - 1) Next k T(D + 2) = T(D + 2) + yVal ^ 2 Next i For j = 1 To D + 1 For k = 1 To D + 1 R(j, k) = A(j + k - 1) Next k Next j For j = 1 To D + 1 k = j For i = 1 To D + 2 S = R(j, i) R(j, i) = R(k, i) R(k, i) = S Next i Z = 1 / R(j, j) For i = 1 To D + 2 R(j, i) = Z * R(j, i) Next i For k = 1 To D + 1 If k <> j Then Z = -R(k, j) For i = 1 To D + 2 R(k, i) = R(k, i) + Z * R(j, i) Next i End If Next k Next j C(D, 0) = R(1, D + 2) C(D, 1) = R(2, D + 2) C(D, 2) = R(3, D + 2) C(D, 3) = R(4, D + 2) C(D, 4) = R(5, D + 2)
>>Still its not as bad as hungrian notation
agreed.
Bah...I like hungarian notation.
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
The only thing worse than hungarian notation (I like this version of it though: http://www.joelonsoftware.com/articles/Wrong.html) is when no one even follows the standards.
We use some pretty basic guidelines at work. Classes should have all private member variables at the top, all in caMeL case and prefixed with an underscore. Next comes constructors, then public properties (in Pascal case), then class methods (private, then public). All variables and method parameters are in caMeL case. Pedantic? maybe. But when you open a source file and need to find something in a hurry, you can usually feel your way around a LOT faster if you know what order everything is declared. If you see anything in caMeL case, you know its a parameter or a variable. If you see something starting with an underscore, you know its a private member variable. Simple.
But there is one guy who just doesn't follow standards. Not a bit. He doesn't use private members, doesn't use C# properties at all (just exposes public member variables, in caMeL case no less), and all his methods take parameters in Pascal case. And they're declared all over the place in the class file.
I'm not saying our standard is the right way, but everyone else here uses it except him. He thinks he's Internet Explorer or something
Edit: that same guy has been known to accidentally 'check out' all files from our SourceSafe repository, and go to lunch for long periods of time in the same day.
Last edited by nickname_changed; 05-18-2005 at 08:15 AM.