Longest line of code in an actual program
Blitz3D Forums/Blitz3D Programming/Longest line of code in an actual program
| ||
I think this is a new record:Case COLLISIONOBJECTGADGETPOSITIONX,COLLISIONOBJECTGADGETPOSITIONY,COLLISIONOBJECTGADGETPOSITIONZ,COLLISIONOBJECTGADGETROTATIONX,COLLISIONOBJECTGADGETROTATIONY,COLLISIONOBJECTGADGETROTATIONZ,COLLISIONOBJECTGADGETSCALEX,COLLISIONOBJECTGADGETSCALEY,COLLISIONOBJECTGADGETSCALEZ And my longest variable name: STATICMESHREFERENCE_SUBOBJECT_VBO_TEXCOORDSARRAY Longest function declaration: Function SplitTriangle(surfa,surfb,Ax#,Ay#,Az#,Bx#,By#,Bz#,Cx#,Cy#,Cz#,nx#,ny#,nz#,d#,lista=0,listb=0) |
| ||
The REAL longest function declaration:Function CreateTree(Wiggle_Flag=2,Branches_On_End_Flag=2,Leaf_Type=-1,Leaf_Mesh=100,Number_Of_Large_Branches=5,Number_Of_Medium_Branches=3,Number_Of_Small_Branches=7,Large_Branch_Minimum_Angle#=20,Medium_Branch_Minimum_Angle#=20,Small_Branch_Minimum_Angle#=20,Large_Branch_Maximum_Angle#=40,Medium_Branch_Maximum_Angle#=40,Small_Branch_Maximum_Angle#=40,Tree_Trunk_Size#=9,Large_Branch_Size_Min#=2,Medium_Branch_Size_Min#=2,Small_Branch_Size_Min#=2,Large_Branch_Size_Max#=4,Medium_Branch_Size_Max#=3,Small_Branch_Size_Max#=4,Trunk_seg=15,LBranch_seg=4,MBranch_seg=4,SBranch_seg=4,Trunk_Big_Dia#=1,Trunk_Small_Dia#=.8,LBranch_Big_Dia#=.6,LBranch_Small_Dia#=.4,MBranch_Big_Dia#=.3,MBranch_Small_Dia#=.2,SBranch_Big_Dia#=.1,SBranch_Small_Dia#=.05) From: http://www.blitzbasic.com/codearcs/codearcs.php?code=110 |
| ||
..damn. talk about giving the stack a run for it's money! |
| ||
the duck i agree. |
| ||
I found that once I started writing really big apps, I had to use long-ass variable names because I kept running out of things to call stuff. |
| ||
This is what happens when you use stupidly long variable names. COLLISIONOBJECTGADGETPOSITIONY, for instance, could easily be shortened by more than half, to colObjGadPosY. |
| ||
actually, The verbose label COLLISIONOBJECTGADGETPOSITIONY is very descriptive. I love descriptive labels and the cut & paste shortcuts (ctrl-c, ctrl-v) work wonders. |
| ||
At least make it readable: CollisionObjectGadgetPositionY CAPSLOCK is the enemy to code readability. |
| ||
At least make it readable: True CollisionObjectGadgetPositionY |
| ||
ThisIsTheYPositionOfWhereTheObjectCalledGadgetCollidedWithAnotherObject() |
| ||
Its my code, and I rule all. |
| ||
If S(Tyyppi%)\MinLevel > Level Or S(Tyyppi%)\MinStr > Strength Or S(Tyyppi%)\MinDex > Dexterity Or S(Tyyppi%)\MinVit > Vitality Or S(Tyyppi%)\MinInt > Intelligence Or S(Tyyppi%)\MinWis > Wisdom Or S(Tyyppi%)\MinCha > Charisma Or S(Tyyppi%)\MinLuck > Luck Or (S(Tyyppi%)\Ihmiset = False And Rotu = 2) Or (S(Tyyppi%)\Orkit = False And Rotu = 3) Or (S(Tyyppi%)\Keijut = False And Rotu = 4) Then Return False |
| ||
My God. |
| ||
Its my code, and I rule all. No. |
| ||
i think long variable names are very useful. i always cut and paste code anyway.. i hate it when i write view on half the lines and veiw on another 50 !!! - i know you can just use replace, but its annoying. |
| ||
I always use descriptive variable names. Even in For...Next loops, where everyone uses 'i' or something like that. I always have a nice descriptive variable for that. Its easier to cut and paste variables and know what they mean, instead of undescriptive variables. Also, my style is nothing in the main loop, except function calls... Makes it more neat. Actually, it also speeds it up a lot too. That's a tip kids, only use 'gosub' and function calls in your main loop. I had a 5 FPS increase when running it in my first person shooter with only gosub and function calls in my main loop. |
| ||
Also, my style is nothing in the main loop, except I find that hard to believe. Adding function calls will only decrease performance (albeit a negligible amount, but will decrease it nonetheless). function calls... Makes it more neat. Actually, it also speeds it up a lot too. That's a tip kids, only use 'gosub' and function calls in your main loop. I had a 5 FPS increase when running it with only gosub and function calls in my main loop. |
| ||
Really? I had it increase 5 frames per second in a game I made a while back, a 3D FPS (not frames per sec). It makes it a lot less sloppy so its a lot more readable. I also used gosubs which in some cases was better than the functions because of the scope and the speed is faster in some of it in a gosub than a function. But it was a great improvment. |
| ||
Oh, so your slowest step in the program is a little process that takes 0.001 milliseconds? If not, use all the functions you want, because it doesn't matter. Pointing out that functions slow the program down is like saying "this paper clip in my pocket will decrease my car's fuel efficiency, even if it's just a little bit". |
| ||
I don't know why, but my FPS increased 5 FPS when adding it all in functions and gosub, so I kept it! :P And, its a lot easier to read. |
| ||
COLLISIONOBJECTGADGETJOINTCOLLISIONOBJECT1LISTBOX This is a gadget in the collision editor window, which indicates which rigid body to use for a joint. |
| ||
Yea, u should probably capitalize the beginning of a new word. Even have a prefix could help you every now and then. i = integer bk = bank f = float s = string e = entity bkCollisionObjectGadgetJointCollisionObject1ListBox U could also create prefixes for your own speical cases. lisB = list box ColObj. Pretty much like someone said eariler. |
| ||
Mesh = FOLIAGE_CreateFlower(Flower\Sides[LOD], Flower\Radius#, Flower\Height#, Flower\Texture_Front_U0#, Flower\Texture_Front_V0#, Flower\Texture_Front_U1#, Flower\Texture_Front_V1#, True, Flower\Texture_Back_UOffset#, Flower\Texture_Back_UOffset#) That's my best I think... |
| ||
I rules you's all! My code will crush you! |
| ||
Why, am I going to forget that 99% of my globals are integers? You're an idiot. |
| ||
Beat this variable!!: IfStatementConditionInsertedInFor...NextLoopInsideMainLoopWithFunctionCallOfThreeParametersOfBooleanReturn$ Yeouch! might think of changing it to: IfCondInsForNextMainFuncCall3ParamBool$, but it still beats all! |