Local variables

New releases and general discussions.

Post » Sat Apr 18, 2009 1:51 am

We're just going around in circles here, and everything that can be said on the subject has pretty much been said, on both sides of the issue.

This is just belaboring the point.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Apr 18, 2009 9:08 am

Yeah, I think this thread isn't productive anymore since it's way too heated up. There'll always be topics where one group of people thinks solution A is better and the other group pledges for solution B - in the end, it's not worth getting all mixed up about that.

Personally, if I know the app has global variables, I sorta assume that we'd also have local (the better term actually is layout) variables. Getting to the solution that I'll have to use a buffer sprite and use its private variable would've taken me longer to figure out than having layout variables natively built into the app.

It doesn't really matter right now since we get the same result using both ways, so let's not get all fussed up about it anymore. There are more important things to talk and research about :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sat Apr 18, 2009 1:18 pm

I think this argument is completely ridiculous. As I said before, it won't happen before 2.0, but I think layout variables are a good idea and we can fairly easily implement them next time around for 2.0 without occupying much time. If you don't think they're useful you can completely ignore them. If you like the idea you get the benefit of having them.

In the meantime using a small sprite is a perfectly acceptable workaround. The VRAM argument is irrelevant. The runtime could easily allocate 16mb of VRAM internally depending on what you're doing. Having a 32x32 sprite to store some private variables will occupy about 4kb of VRAM. It's like trying to save 10 CPU cycles on an event when the object selection routines use 10s of thousands of cycles, or a simple CPU branch mispredict might take 20 cycles. Have some perspective!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Sun Apr 19, 2009 10:08 am

To add layout variables right now would be to add another layer of arbitrary variables; in 2.0, there will be just 1 place to set up variables, and there it can be decided if a variable is of global or layout scope.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests