Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / What Is Modularization?

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Oct 2010 18:30
For some strange reason I've decided to write a tutorial on modularization. I have been staring at menu system code for the latest DNG project for a while, so that probably has something to do with it; I thought, wouldn't it be great if we wrote one menu system that we could use for all our projects!

This tutorial is aimed at intermediate programmers, those of you who have a firm grasp of the basics and are beginning to write your own functions but don't quite know how best to organize your program.

I probably shouldn't upload half a tutorial but I am taking a break so you all might as well have a look and give me any pointers.

I've gone all fancy and PDF'd it because I'm posh

Hit the download button and tell me what you think.


Do oranges know what colour they are?

Attachments

Login to view attachments
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 27th Oct 2010 23:18
Nice tutorial, definitely something that is really needed in big projects, and can really improve your code...

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Oct 2010 23:26
Looking pretty good!

Just be careful in declaring what can or cannot be done. Beginners reading a tutorial may take things at face value without questioning them or examining other information. I've done it myself, many times - making bold statements as if they are law (pats self on back)!

You didn't make any bold statements, your information is nicely laid out and to the point, but you listed Extra Actions as 'cannot be integrated because DB doesn't support variable name referencing.'

You're not defining what you mean by this and it almost seems like a side note to yourself. What's the significance of this in terms of Extra Actions? What are the alternatives? What is the goal? Referencing a variable to me means looking at it's memory position and getting the value from there. For DB, this can be accomplished using memblocks - the variable data could be stored in groups of 4 bytes or 255 bytes for strings. Then use an offset to the position in the memblock where the data is stored.

Or you could use arrays and use the index as a reference to a value. Instead of relying on the typed string name of the variable (if that's what you mean by reference) the array index points to values. It means setting up your menu system with a set of arrays. In DB, that would be global arrays so the values can be shared across functions (or use memblocks).

Just sayin'

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Oct 2010 03:21
@TheNerd and Latch
Thanks

Just to clarify on the name referencing thing, I mean that you can't do something like taking a string of input from the user and returning the value of the variable of the same name. If that clarifies lol

That WAS a note to myself, I just copied it into the document. I'll have to edit that to make it clearer when I continue with this.

Thanks for your input.


Do oranges know what colour they are?
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Dec 2010 04:32
shameless bump to keep this alive so I can finish it without starting a new thread


Everything worthwhile requires effort.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Jan 2011 14:26
Let me know when it's all done and I'll host it on DBCodeCorner.com

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 7th Jan 2011 04:46 Edited at: 7th Jan 2011 04:52
what do you mean by menu system. if you mean something for creating menu's in game. I'm currently working on this>Menu Maker

Sorry if that was a dumb question. I haven't had the chance to read it yet.

EDIT:
Now that I read it. I don't feel sooo stupid, because in a way thats what i'm doing, instead of having to hard code the menu everytime. i'm making a program that will do it for me.

and btw you spelled modularization wrong in one of two places. i'm not sure how its spelled but in one part of it you spell it modularisation and at the top its spelled modularization

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Jan 2011 07:51
@Pictionary
Yeah I think Modularisation is the English way of spelling it, which is one of the few times English spelling is lazier than American.

Thanks Phaelax, I will hopefully have it finished within the next week.


Everything worthwhile requires effort.

Login to post a reply

Server time is: 2024-04-16 07:26:54
Your offset time is: 2024-04-16 07:26:54