Longest Function - my submission
-
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygen -
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygenThis is really, really scary.
-
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygenOooh that's nasty... it reminds of the linux function which wouldn't compile in MSVC because is had >255 parameters! Joel Holdsworth "Outlook not so good" That magic 8-ball knows everything! I'll ask about Exchange Server next
-
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygenAnd your proud of this? :wtf: RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygenCan you explain what was your function's function? 'cause in Structured programming, it's no good programming practice to write that long functions and functions are tried to stay short and READABLE.
-
And your proud of this? :wtf: RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
You're you're you're you're proud. I know, I know
-
You're you're you're you're proud. I know, I know
Rubbing it in a little! :-D Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain) -
since it came up yesterday, and I couldn't check. 3643 lines created 1998 "maintained" ever since
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygenpeterchen wrote: 3643 lines :laugh: :laugh: :laugh: :laugh: :laugh: :laugh: :laugh: That's child's play! Try 10264 lines. Yea, then we'll talk. (Note: _NOT_ my function, BTW, but I did have to update it :rolleyes: ) Oh yea, and the number of
return
s in there... :eek: ~Nitron.
ññòòïðïðB A
start -
peterchen wrote: 3643 lines :laugh: :laugh: :laugh: :laugh: :laugh: :laugh: :laugh: That's child's play! Try 10264 lines. Yea, then we'll talk. (Note: _NOT_ my function, BTW, but I did have to update it :rolleyes: ) Oh yea, and the number of
return
s in there... :eek: ~Nitron.
ññòòïðïðB A
start:omg: What does it do then? Certainly it has to calculate the average speed a rocket has to crash into a piece of rock of 10cm³ to create the same amount of energy as the big bang??? ... or something like that?? What does the class do? (and how many lines is that?):wtf: :omg::wtf::rolleyes::wtf::omg::eek::eek: X| X| (get my drift :-D) "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
-
:omg: What does it do then? Certainly it has to calculate the average speed a rocket has to crash into a piece of rock of 10cm³ to create the same amount of energy as the big bang??? ... or something like that?? What does the class do? (and how many lines is that?):wtf: :omg::wtf::rolleyes::wtf::omg::eek::eek: X| X| (get my drift :-D) "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
V. wrote: Certainly it has to calculate the average speed a rocket has to crash into a piece of rock of 10cm³ to create the same amount of energy as the big bang??? As odd as it sounds, I think you'd be able to do that task with < 100 lines. Although you may run to problems with handling such collosal numbers. Also if you had as much energy as the big bang, it would be likely to cause reality to fail rather quickly I think. And so maybe yes calculating the event could be rather a task. Joel Holdsworth "Outlook not so good" That magic 8-ball knows everything! I'll ask about Exchange Server next
-
:omg: What does it do then? Certainly it has to calculate the average speed a rocket has to crash into a piece of rock of 10cm³ to create the same amount of energy as the big bang??? ... or something like that?? What does the class do? (and how many lines is that?):wtf: :omg::wtf::rolleyes::wtf::omg::eek::eek: X| X| (get my drift :-D) "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
V. wrote: What does the class do? (and how many lines is that?) Unfortunately, length of class/function does not always equate to lowered functionality. It depends on the type of process. Just as an example, I have my partner's code, rather than build a model-loader for a given 3D model (which would be on the order of 100-500 lines of total complexity including called functions), he uses a Perl program to load the model and convert it to C/C++/OpenGL calls that he can compile into a vertex array, display list, or if I can show him how, a vertex object that he can upload to the graphics card and there it will stay. Thus he has a huge function to "load" a model, vertex descriptions line after line after line. It basically turns into a giant array-member assignment function. So his F4 model is 21021 lines of code T72 tank is 27864 lines example:
Models.plots[515].coordinates[0][0]=0.84457;
Models.plots[515].coordinates[0][2]=-1.40292;
Models.plots[515].coordinates[0][1]=-1.22216;
Models.plots[515].coordinates[1][0]=0.84457;
Models.plots[515].coordinates[1][2]=-1.40292;
Models.plots[515].coordinates[1][1]=-1.22216;
Models.plots[515].coordinates[2][0]=0.84457;
Models.plots[515].coordinates[2][2]=-1.40292;
Models.plots[515].coordinates[2][1]=-1.22216;
...
Models.plots[515].coordinates[17][0]=0.83819;
Models.plots[515].coordinates[17][2]=-2.15845;
Models.plots[515].coordinates[17][1]=0.18664;
Models.plots[515].coordinates[18][0]=-1.26778;
Models.plots[515].coordinates[18][2]=-1.18953;
Models.plots[515].coordinates[18][1]=3.16743;
Models.plots[515].coords=19;It is functionally the same, however, not as flexible since to load a new model his requires a recompile, mine does not. However, his perl program strips out anything he doesn't understand about the model, so it always loads. mine, if I forget something it has problems loading the model until I fix the model loader (thus bug). His tends to be more stable on a new format we barely understand, mine requires much better understanding of the model format before it becomes stable. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
V. wrote: What does the class do? (and how many lines is that?) Unfortunately, length of class/function does not always equate to lowered functionality. It depends on the type of process. Just as an example, I have my partner's code, rather than build a model-loader for a given 3D model (which would be on the order of 100-500 lines of total complexity including called functions), he uses a Perl program to load the model and convert it to C/C++/OpenGL calls that he can compile into a vertex array, display list, or if I can show him how, a vertex object that he can upload to the graphics card and there it will stay. Thus he has a huge function to "load" a model, vertex descriptions line after line after line. It basically turns into a giant array-member assignment function. So his F4 model is 21021 lines of code T72 tank is 27864 lines example:
Models.plots[515].coordinates[0][0]=0.84457;
Models.plots[515].coordinates[0][2]=-1.40292;
Models.plots[515].coordinates[0][1]=-1.22216;
Models.plots[515].coordinates[1][0]=0.84457;
Models.plots[515].coordinates[1][2]=-1.40292;
Models.plots[515].coordinates[1][1]=-1.22216;
Models.plots[515].coordinates[2][0]=0.84457;
Models.plots[515].coordinates[2][2]=-1.40292;
Models.plots[515].coordinates[2][1]=-1.22216;
...
Models.plots[515].coordinates[17][0]=0.83819;
Models.plots[515].coordinates[17][2]=-2.15845;
Models.plots[515].coordinates[17][1]=0.18664;
Models.plots[515].coordinates[18][0]=-1.26778;
Models.plots[515].coordinates[18][2]=-1.18953;
Models.plots[515].coordinates[18][1]=3.16743;
Models.plots[515].coords=19;It is functionally the same, however, not as flexible since to load a new model his requires a recompile, mine does not. However, his perl program strips out anything he doesn't understand about the model, so it always loads. mine, if I forget something it has problems loading the model until I fix the model loader (thus bug). His tends to be more stable on a new format we barely understand, mine requires much better understanding of the model format before it becomes stable. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Well I didn't understaind your explaination, but the example explains why the function can be so long :-). Have fun counting lines now ... (yes I know linenumbers can be given in VS it was a joke off course). "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
-
Well I didn't understaind your explaination, but the example explains why the function can be so long :-). Have fun counting lines now ... (yes I know linenumbers can be given in VS it was a joke off course). "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
V. wrote: Well I didn't understaind your explaination That's okay... neither does my bosses. One of these days I still hope to master English. Actually, I should learn a second human language so I could blame it on dual language issues rather than just an innability to communicate. :) _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
And your proud of this? :wtf: RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
To paraphrase Tucholsky, "If I weren't proud, I'd still have to maintain it. So I'm rather maintaining and proud"
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygen -
Can you explain what was your function's function? 'cause in Structured programming, it's no good programming practice to write that long functions and functions are tried to stay short and READABLE.
It is feeding result windows (about 2 dozen charts and tables) in a huge switch statement with quite some of state information and repetetive code. Yes, that ugly. However, structured programming alone won't help here. At least a state helper object would be required. (to add insult to injury, there is an entity that could happily manage that state. However, the current architecture doesn't allow to use it as such, without doubling the cases) Now, for the more interesting question, why don't I change this? The code works. It currently solves a good hundred teensy little usability problems, both from the math/engineering side (where I am incompetent), and from plain app usage/presentation (where my peers are). It goes into three different products (number growing next month), and is fairly navigatable. Splitting up into functions would not do much good.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygen