Graphic in on function
Graphic in on function
Hi everyone
Would it be worth re doing my graphic sub functions into one single function to control all graphicals function in the program?
Would that make the software a little more stable?
Would it be worth re doing my graphic sub functions into one single function to control all graphicals function in the program?
Would that make the software a little more stable?
Re: Graphic in on function
No, it will make it unreadable and impossible to maintain. What do you mean with 'stable'?Gablea wrote:...
Would that make the software a little more stable?
Re: Graphic in on function
I keep getting kernal panic but not in the same spot.
Sometimes I can run the program for hours and nothing other times I can start it and then 30 seconds it would crash
Sometimes I can run the program for hours and nothing other times I can start it and then 30 seconds it would crash
Re: Graphic in on function
I assume you already compile with "fbc32 -w all -exx" for debugging?
Re: Graphic in on function
Er no I did not know that was a option.
I’ll try that and let you all know.
I’ll try that and let you all know.
Re: Graphic in on function
https://freebasic.net/wiki/wikka.php?wakka=CatPgCompOpt
-w additional error checking when compiling
-exx add error checking when running the program. Your program will be somewhat slower. If your program crashes, you'll probably get a message that tell you where it crashed.
-w additional error checking when compiling
-exx add error checking when running the program. Your program will be somewhat slower. If your program crashes, you'll probably get a message that tell you where it crashed.
Re: Graphic in on function
This has all the visage of:Gablea wrote:I keep getting kernal panic but not in the same spot.
Sometimes I can run the program for hours and nothing other times I can start it and then 30 seconds it would crash
- An off-by-one error while accessing an array
- Faulty pointer arithmetic, sometimes landing on the pad area (that would explain the erratic behavior)
I don't know who or where you get the idea that putting everything in one giant function will help you. It's one of the worst things you could do, it will immensely hinder the maintainability of your program. You should be doing quite the opposite: separating the program into many small, cohesive functions that can work together and, preferably, statelessly.
Re: Graphic in on function
@Paul Doe
Thanks for the advice I have been doing that having each Graphical function in its own code but then a "programmer" mate of mine told me i am a fool for having the graphics spread across the program. in his words I should have one file called graphics.bas and have each graphical function stored there (Im sure he was thinking it would be easier to locate the code)
oh a side note does anyone know if FB could run in windows 3.11? or is there any plans to port a compiler to Windows 3.11?
Thanks for the advice I have been doing that having each Graphical function in its own code but then a "programmer" mate of mine told me i am a fool for having the graphics spread across the program. in his words I should have one file called graphics.bas and have each graphical function stored there (Im sure he was thinking it would be easier to locate the code)
oh a side note does anyone know if FB could run in windows 3.11? or is there any plans to port a compiler to Windows 3.11?
Re: Graphic in on function
No problem. Now, modularizing the code (putting each related function in separate modules) is a good practice. Of course, sanity must also be applied: putting each single function into its own file will grind compile times to a halt, and just drive you mad =DGablea wrote:Thanks for the advice I have been doing that having each Graphical function in its own code but then a "programmer" mate of mine told me i am a fool for having the graphics spread across the program. in his words I should have one file called graphics.bas and have each graphical function stored there (Im sure he was thinking it would be easier to locate the code)
On the other hand, having really small functions (preferably they should be doing just one thing) is quite useful, as they allow you to compose the code into larger units. You then cluster together related functionality into a single file (module) and that's all the modularizing you'll ever need. Having all the graphics functions cramped together into one large file doesn't make the code easier to locate, quite the contrary.
So, your mate 'programmer' called you fool? Call him 'code monkey' -revenge is always sweet =D
Re: Graphic in on function
I just tend to ignore him when he start to give “advice” I think he is use to working to much on web systems and I’m sure he had never compiled anything.
Re: Graphic in on function
There is absolutely nothing wrong with that, by contrast:Gablea wrote:in his words I should have one file called graphics.bas and have each graphical function stored there
putting it all in one procedure, is a really bad idea!
Note: the two are massively different!
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: Graphic in on function
For Win 3.11 is only a DOS - frontend, the DOS version of FB should work with it.Gablea wrote:oh a side note does anyone know if FB could run in windows 3.11? or is there any plans to port a compiler to Windows 3.11?