I'll put one of my favorite features here too. When you switch on enum, the compiler enforces you to explicitly handle every enum entry or it's an error. I love this. In C++ I tend to put an assert(false) in the default case to try to prevent other people from not updating a switch statement but that means it just crashes at runtime. I could probably mitigate that with a static if or something but I cant use modern c++ most of the time.
I don't know if both are needed or just the latter, but I compile my C++ code with -Wall and -Werror and it does stop me when a switch doesn't handle every value.
More often than not I don't have control over the compiler flags
What are the recommended tools for building and unit testing?
IMO the way to go is haxelib (which is part of haxe) and FlashDevelop. FD has full haxe support and works like an aboslute dream for every target (that reminds me, I need to send them a donation).
FD I think is windows only though. Depending on whether or not you have/use windows that could be a big issue. After that I'm sure you could augment sublime text with a plugin or something like that. At that point you would have to start managing your own build scripts.
As for unit testing. I've never done it in the language because I've only ever really used it to make games on top of a library (haxeflixel) that implements anything I use that might be concievably unit-testable.
I should probably have phrased that question differently. When I wrote "tools for building" I really meant tools for
building. I'm the Terminal + Sublime type of developer
, so managing my own build scripts is usually my way to roll. What I'm looking for is the equivalent of
make,
grunt or
gradle.
For unit testing I've been looking at
MassiveUnit. This is what openfl and flixel are using. But I prefare bdd-style frameworks like
mocha.js.
When I use Haxe I explicity use the IDE route because my day job involves writing build systems and I just want to make games.
I not totally sure but I think it might work a bit like jam where it can just look for build targets according to file system structure rules. Each haxe project uses an xml file to define a lot of stuff you would do in make or jam but IIRC it doesn't specify code files explicitly like you would in make. I'm at work right now so I can't confirm though.
As for grunt and gradle I'm not familiar. The gradle website seems to talk about CI and kind of looks like Teamcity or Jenkins. There's definitely nothing like that built into haxe.