Is the array object completely broken?

Discussion and feedback on Construct 2

Post » Mon Jun 09, 2014 8:47 pm

++What Yann said.

Arrays are much more fundamental than "collection classes" which is what most people who just started coding in the past 10 years think of when they are talking about lists of things... collection classes provide a lot of convenience features like lookup by field name string or index...etc.

Attached is the capx from "bolosaur" on his other thread (how-do-i-use-construct-2-arrays-correctly_t106969) with changes that use the three dimension array in a manner that might be useful to him... of coarse you can use the C2 Array in many different ways because it isn't a "collection class" but an array with various utility methods added on.

arraytest.PNG
You do not have the required permissions to view the files attached to this post.
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Mon Jun 09, 2014 9:02 pm

@Yann Good lord sir... a simple "well that's kind of true but you meant to say was hash table" i think would have sufficed and even then that's nitpicking considering most C2 users aren't developers. I may as well be on reddit with a response like this. Yes all I did was mask a 3 dimensional JavaScript "object" (technically not an array for those that are in to symantecs) similar to whats available in most high level languages like JavaScript or PHP. That "object" however, which for most developers that program in high level languages, is considered and used like an array (they are practically synonymous even though not technically the same). I want people to use my plugin, not be scared away by complicated technical jargon, so they would have an option for dynamically "string" accessible 3 dimensional information which isn't currently available C2.

I encourage you to at least try my plug in and offer constructive criticism on it before giving me a hard time for being symanteclly incorrect.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Mon Jun 09, 2014 9:13 pm

troublesum wrote:@Yann Good lord sir...

I encourage you to at least try my plug in and offer constructive criticism on it before giving me a hard time for being symanteclly incorrect.



Your plugin looks interesting and would probably be helpful to a lot of people who do not want to dig in and learn how to use the Array.

I will check it out myself to see how it compares (pros and cons) with the tools I have built for myself on top of the C2 Array.

With my current method of using the C2 array my column names are C2 instance variables and so they show up in the C2 intellisense and when I change a variable name it goes through all the events and updates the name in all the places where I used that variable... with your plugin is that possible or not because you are referring to everything with strings of text?
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Mon Jun 09, 2014 9:30 pm

With my current method of using the C2 array my column names are C2 instance variables and so they show up in the C2 intellisense and when I change a variable name it goes through all the events and updates the name in all the places where I used that variable... with your plugin is that possible or not because you are referring to everything with strings of text?


Is this what you mean for intellensence? You could have variables with string names that are used for referencing.
variable.png

intel.png
You do not have the required permissions to view the files attached to this post.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Mon Jun 09, 2014 9:54 pm

Yes that is basically what I meant.

I think this probably just comes down to a convenience vs performance decision... just like in normal programming languages.

The tools I have built on top of the C2 Array allows me to do basically the same thing you are doing except all through indexes (and arrays of UIDs pointing to more Arrays for hierarchies) instead of string / hash lookups... so I do not do any loops at all which will make it run faster than your plugin will... the con to my tools is it took me months to build them up as I was working on a game before they got to the point where they are today... with your plugin people can get the immediate usefulness of the plugin with the sacrifice of some performance.

Your tool should probably be used by people to get their game up and going quickly and only switch to something more efficient like indexing via the C2 Array if they need to squeeze out more performance after doing tests.
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Mon Jun 09, 2014 10:01 pm

@troublesum
Nope, I wouldn't have (:
My post had more purpose than just to correct you affirmation.

By going a bit more in-depth into how array works on a lower level, I aimed at offering another perspective on arrays on general. Since it's the main topic. You just gave me a pretext and a starting point.

I think some misunderstanding about C2's array comes from what they try to emulate (multiD-array) vs what people are, nowadays (mostly with php and javascript), used to (array of arrays).

Also, I believe that sometimes, digging further in the complexity, makes the current problem simpler by contrast (: ... works sometimes...

Oh and I won't lie. I like to show off sometimes :D
B
68
S
22
G
14
Posts: 1,485
Reputation: 16,561

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests