Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB Express #16 Now Available
#5
A few words of constructive (in my opinion) criticism, if I may.


Hmm, ok, I read the part on unions by Richard Clark. I was able to get a better understanding of what he was talking about here:

http://www.freebasic.net/wiki/wikka.php?...KeyPgUnion

I would just like to say that a rambling such as this on unions can be made much more understandable in two ways.

1) Post a link to the keyword in the freebasic keyword site.
2) Explain clearly why your way is better than some other way X. Richard Clark's explanation is that you would not need routines for separate data types, but that is completely wrong. Unions are several steps ahead of that, and it's two dimensional:

Dimension 1: Routines for each data item, or for one data item.
Dimension 2: Separate variables, types, arrays, or types+unions.


I would approach this from a QB to FB perspective.

Without unions, I would approach this by:
*creating arrays for the general data item
*creating separate arrays for the particular data items (i.e. armor)
*In the general data item array/type array, I would have two indexes for the inventory items, one for the type of the particular data item, and one for the location in its array.

The disadvantage of this is that you must define the maximum lengths of your specific data beforehand while the union approach dynamically creates the types that you need for each inventory item. Obviously the complexity of the program is increased with the array approach, but not in the way that Richard Clark describes.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Messages In This Thread
QB Express #16 Now Available - by Pete - 11-27-2005, 12:16 PM
QB Express #16 Now Available - by Josiah Tobin - 11-27-2005, 12:48 PM
QB Express #16 Now Available - by marzecTM - 11-27-2005, 02:19 PM
QB Express #16 Now Available - by Z!re - 11-27-2005, 03:25 PM
QB Express #16 Now Available - by Agamemnus - 11-27-2005, 10:26 PM
QB Express #16 Now Available - by Deleter - 11-28-2005, 01:21 AM
QB Express #16 Now Available - by Torahteen - 11-28-2005, 05:21 AM
QB Express #16 Now Available - by na_th_an - 11-28-2005, 04:32 PM
QB Express #16 Now Available - by Pete - 11-29-2005, 01:54 AM
QB Express #16 Now Available - by na_th_an - 11-29-2005, 04:07 PM
QB Express #16 Now Available - by Torahteen - 12-23-2005, 08:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)