phobius

u/phobius




r/haxe•

Is there a strong argument for using PHP-style Map definitions, over (say) the JavaScript approach?

It seems overly verbose, and I can't ascertain any advantage.

eg. Haxe3:

var myMap = { "hello" => 20, "howdy" => 16 };

vs. JavaScript (ish):

var myMap = { "hello" : 20, "howdy" : 16 };

I know it likely seems like a small thing, but I'm just curious as to whether there's an established reasoning behind it.

34

r/haxe•

Hi r/haxe!

I've been slowly trying to ween myself onto Haxe recently since it seems a more sustainable option.

But one thing that's difficult to look past is the single type of python-style for loops.

A construct I use a lot in image processing and game code is:

// this is c/java pseudocode
int width = 640;
int height = 480;
int area = width * height;
float linear2dArray[] = new float[area];

// perform a series of calculations which rely on X, Y
for (int y=0, offset = 0; y < height ; y++) {
   for (int x=0; x < width; x++, offset++) {
       linear2dArray[offset] = someGenerator( x, y );
   }
}

This is beneficial since it:

  • avoid
42