How do you code?

For everything that's not in any way related to PureBasic. General chat etc...
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

White Eagle wrote:Naked
disturbing .... :shock:
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Disturbing? I do it all the time!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Nothing wrong with coding naked.

Bit cold though when coding in the back garden. :shock:
I may look like a mule, but I'm not a complete ass.
Character
Enthusiast
Enthusiast
Posts: 337
Joined: Mon Aug 07, 2006 3:51 pm
Location: Netherlands

Post by Character »

Naked except for my boots.
I always wear them no matter what.

Image
Cessante causa cessat effectus
dna
User
User
Posts: 83
Joined: Wed Aug 30, 2006 12:07 am

Post 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.
Character
Enthusiast
Enthusiast
Posts: 337
Joined: Mon Aug 07, 2006 3:51 pm
Location: Netherlands

Post by Character »

Welcome!
Cessante causa cessat effectus
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

White Eagle wrote:
How do you code?
Naked
:lol:
Dare2 cut down to size
User avatar
aszid
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 01, 2003 8:38 pm
Location: California, USA
Contact:

Post 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.
--Aszid--

Making crazy people sane, starting tomorrow.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

aszid, just like me ;)
I like logic, hence I dislike humans but love computers.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

One of my callbacks in my egrid lib is 730 lines long!

Sadly, this is not the exception to the rule!
I may look like a mule, but I'm not a complete ass.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

I agree with PB.... some of my procedures would never fit into a screen, even at 1440x900 res.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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! ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post 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?
Athlon64 3700+, 1024MB Ram, Radeon X1600
Post Reply