News:

  • June 10, 2026, 06:51:27 AM

Login with username, password and session length

Author Topic: Software friendliness  (Read 73596 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Software friendliness
« Reply #45 on: April 20, 2013, 03:46:58 PM »
You can most certainly create arrays of structures, user defined included. But no, a structure cannot contain anything but simple types, and that is not likely to change any time soon. Personally, I think it is far more important to create arrays of structures than arrays within structures, but I can certainly see the benefits of both.

That's exactly what I was going to say.  I want both of course, but arrays of structures is far more important to me than arrays IN structures.  The workaround for the one is infinitely easier than for the other.

Oh, alarm bells going off now.  You said structs may only contain simple types, and I'm assuming a struct is not a simple type.  Structs in structs is something I do quite a bit, and that IS pretty important.  Maybe not quite as important as arrays of structs, but up there. (Certainly more important than arrays IN structs, for example)

Same deal with strings as arrays in structs.  It would be the cleanest, but no big deal until you do or even if you never do.
« Last Edit: April 20, 2013, 04:48:46 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Software friendliness
« Reply #46 on: April 22, 2013, 06:05:35 PM »
Oh, alarm bells going off now.  You said structs may only contain simple types, and I'm assuming a struct is not a simple type.  Structs in structs is something I do quite a bit, and that IS pretty important.  Maybe not quite as important as arrays of structs, but up there. (Certainly more important than arrays IN structs, for example)

If a struct consists entirely of simple types, then nesting a struct within a struct doesn't add anything but additional layers of naming. If Struct A contains an instance of Struct B, and Struct B has Field1, then you would reference B's field as 'A.B.Field1'. Is that so much better than adding B_Field1 to A, which would be referenced 'A.B_Field1'? In an OO context where Struct B has significance beyond the fields it contains, embedding a struct has significant merit, but I'm not sure that our mostly flat memory model gains such advantage through nesting.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Software friendliness
« Reply #47 on: April 22, 2013, 06:43:13 PM »
Yeah, I guess it's not all that significant (especially if difficult), and doing what you say is indeed the workaround.  I guess it's just the OO mindset advantage, that it your brain just automagically views the nested structs by their OOPish significance.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Software friendliness
« Reply #48 on: April 22, 2013, 08:31:10 PM »
Yeah, I guess it's not all that significant (especially if difficult), and doing what you say is indeed the workaround.  I guess it's just the OO mindset advantage, that it your brain just automagically views the nested structs by their OOPish significance.

The advantages are huge if the complex type has meaning beyond being an aggregate of simple types, and your mindset is spot on in that context. Sadly, as capable as Do-more is, structures really have no purpose beyond that at this point.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO