Page 1 of 1

How do you write your DLLs/Apps/Games?

Posted: Sun Jul 16, 2006 3:48 am
by ..::Origin::..
Are you a neat freak and like everything easyily read? Whats your style when writing apis?

My style:
I don't mind messy things, as long as they arent really really long. So i break them up into lots of scripts and place them in the same directory, i use the Include function when needing to call them. Works great for me :D

Whats your style?

Re: How do you write your DLLs/Apps/Games?

Posted: Sun Jul 16, 2006 7:41 am
by DarkDragon
..::Origin::.. wrote:So i break them up into lots of scripts...
What scripting language do you use? This is a PureBasic bulletin board, not a scripting language b.b.. :wink:

My engine has 2 files and about 10000 lines. 8) No useful comment or such.
I'm going to rewrite it :-P more OOP more engine features more planning.

Re: How do you write your DLLs/Apps/Games?

Posted: Sun Jul 16, 2006 7:52 am
by Joakim Christiansen
DarkDragon wrote:What scripting language do you use?
He breaks them up in lots of include files is what he meant.

Re: How do you write your DLLs/Apps/Games?

Posted: Sun Jul 16, 2006 7:58 am
by DarkDragon
Joakim Christiansen wrote:
DarkDragon wrote:What scripting language do you use?
He breaks them up in lots of include files is what he meant.
But there are definately no scripts which can be used in PureBasic. Use the words code, source, includes, files, ... but NOT scripts. :wink:

Posted: Sun Jul 16, 2006 8:04 am
by Joakim Christiansen

Posted: Sun Jul 16, 2006 9:05 am
by ..::Origin::..
They are scripts in my apps :)

I write in PB.. And yes i use the IncludeFile function for my ' Scripts '.

@Joakim
*writes and steals code*

Kidding :P

I write like that when i'm purposely trying to right clean code.. else its like

Code: Select all

if(test$="rofl")
pie=#true
else
pie=#false
endif
MessageRequester("Caption","PIE!!!")
Hard to read when theres alot of code :(

Posted: Sun Jul 16, 2006 9:25 am
by DarkDragon
..::Origin::.. wrote:They are scripts in my apps :)
So you don't use a compiler, right? How do you interpret PB code if you don't compile it to an exectuable?

Posted: Sun Jul 16, 2006 11:04 am
by KarLKoX

Posted: Sun Jul 16, 2006 12:37 pm
by Trond
I try to make my procedures so short that the contents are visible without scrolling, and I try to limit the number of nested blocks.

Posted: Sun Jul 16, 2006 1:14 pm
by Kale
I am a total neat freak and everything must be coded to make reading it as easy as possible. IMHO there is no other way to code.

Posted: Sun Jul 16, 2006 2:23 pm
by lexvictory
i rarely comment stuff, lol.........

and looking at the screenshots from KarLKoX and Joakim i found that i'm not the only one who uses royale :lol: :D

Posted: Sun Jul 16, 2006 2:32 pm
by blueznl
i feel rather old fashioned... note that i'm normally working on dual monitor setup though

http://img122.imageshack.us/my.php?imag ... d02zo4.jpg

Posted: Wed Jul 19, 2006 8:43 pm
by Pantcho!!
when i program a new project in the new blank PB file i comment the WHOLE idea of the project, for fun (when you are in PB IDE i feel i am more concentrated).

I start creating the main procedures, i mostly work with procedures to make the main program loop short.

If the project consists many procedures i make diffrent includes files for each catagories of the procedures.

and i comment each include file also ;)

thats it basicly.

ohh and in start i code very bad, but when the project RUNS and works.
I then parse the whole code and check if it looks ok or i should change it (sometimes its a total mess!)

Posted: Thu Jul 20, 2006 9:01 am
by Killswitch
I have a .pb template I use to start all of my projects, it breaks up the source into sections (Constants, Structures/Arrays/Linked Lists/Global Variables/Main Loop/Procedures) which makes everything a little easier.

From there I start coding the main procedures and any sub-procedures that I realise I need. If I have lots and lots of procedures which are, in some way, related, I put them in a seperate file. Arrays are also in their own little files.

The very last thing is the main loop, but that's because it's easy. I test all of my procedures into the ground before I even consider starting the main loop.