Page 3 of 4

Posted: Fri Sep 08, 2006 6:35 pm
by Num3
White Eagle wrote:Naked
disturbing .... :shock:

Posted: Fri Sep 08, 2006 6:40 pm
by dracflamloc
Disturbing? I do it all the time!

Posted: Fri Sep 08, 2006 6:54 pm
by srod
Nothing wrong with coding naked.

Bit cold though when coding in the back garden. :shock:

Posted: Fri Sep 08, 2006 6:58 pm
by Character
Naked except for my boots.
I always wear them no matter what.

Image

Posted: Fri Sep 08, 2006 8:24 pm
by dna
Hello everyone. I'm basically new and over here from the Blitz website.

I code by using a diagram first which includes a rough sketch of what all the user screens will look like.
Then I sit down and write the code that will function as the front end of the screens that I created and then I write the back end of the software last.

Posted: Fri Sep 08, 2006 8:33 pm
by Character
Welcome!

Posted: Sat Sep 09, 2006 12:03 am
by Dare
White Eagle wrote:
How do you code?
Naked
:lol:

Posted: Tue Sep 12, 2006 1:04 am
by aszid
welllll... my code... is somewhat like the "john wayne" style you described... but not completely. here's a quick idea of how i do things when starting anything that is going to end up large and/or complicated:

- Start with a few files in the beginning, usually Init, Procedures, and Main.
- Build a basic framework in which i can easily navigate. generally i do not have much code in the main loop, usually i have everything in there just do a few small checks (if needed) and call a procedure that deals with it.
- Rewrite everything 5 times. Yeah, pretty much that's what i do. I go through my code, and as i add more things to it... i realize how i did other things wrong.. or... not the best way at least. Then I go back to optimize them. usually i optimize for the least amount of code to do the job. unfortunately, it's not always the fastest code.. but honestly with anything i've made thus far in PB, speed has never been an issue.

If i need to find something, i'll usually start by looking in the main event loop, then i can find the procedure that deals with *whatever* and then move to the procedures file and easily navigate to it. I try to keep my procedures somewhat small.. so if it's something very complex, i split it up between a few, simply for my sake when coding.

Posted: Tue Sep 12, 2006 1:08 am
by Joakim Christiansen
aszid, just like me ;)

Posted: Tue Oct 10, 2006 1:13 pm
by Trond
Trond wrote:
remi_meier wrote:Also: no procedure should be larger than the screen height.
I follow that rule as well. And with my large font I can only fit 30 lines on the screen at once.
I'd like to emphasize the "should". At the moment I've got one procedure that 377 lines long. But it's the exception to the rule.

Posted: Tue Oct 10, 2006 1:22 pm
by srod
One of my callbacks in my egrid lib is 730 lines long!

Sadly, this is not the exception to the rule!

Posted: Tue Oct 10, 2006 1:30 pm
by PB
> no procedure should be larger than the screen height

I disagree. Procedures can be fully self-contained routines whose length
depends on what task they perform. Such tasks may not be simple little
lines of code. And it depends on your screen resolution, too. ;)

Posted: Tue Oct 10, 2006 1:31 pm
by dracflamloc
I agree with PB.... some of my procedures would never fit into a screen, even at 1440x900 res.

Posted: Tue Oct 10, 2006 1:45 pm
by PB
A good example is my SendKeys procedure:

http://www.purebasic.fr/english/viewtopic.php?p=12777

Bit hard to fit that into less than a screen height! ;)

Posted: Tue Oct 10, 2006 6:39 pm
by remi_meier
You could / (should) put the Select-EndSelect stuff into a procedure
named GetVKOfString() or something like that :P
And after my statement earlier in this thread, I explained why I handle
it like this, I won't write it twice :wink:

You guys heard of divide and conquer?