Atul
Just some thoughts that might have some truth...
On 30/11/2015 22:03, Atul Kumar wrote:
> while I also like haxe and would rather work with haxe code instead
> of, for example, js any day there are definetely some draw backs which
> should be mentioned. Like you said I also consider a list of trade
> offs very important for a presentation which suppose to present a
> realistic view in considering haxe as a technology stack.
>
> Since there are many pro arguments mentioned in this thread already
> let me step in and give you some trade offs to consider:
>
> Generated code is not 100% as u would write it yourself: Typescript
> does much better in that regard. While generated JS code is maybe
> "good" enough to do debugging I would disagree that when u would
> decide to drop Haxe afterwards that the generated code is good enough
> that u would not feel the need to rewrite it so it is more
> maintanable. That is definetely true for cpp code of course. I do not
> know much about the other targets. I might be wrong, so anybody feel
> free to correct me on that.
>
I think going in with the concept you are likely to drop Haxe is
probably a bad idea anyway, your only likely to want to swap to a
similar alternative like inferior Typescript, in which case I think you
would just wrap stuff suitably and get on with the alternative.
Realistically there is no reason why you would move back apart from
internal politics, It seems more that you might want to move parts of a
system to Haxe and as it proves itself more and more. With Haxe you can
move at your own pace so really there is no risk.
I think if you turn this argument round you see that it makes no
sense... Why code something in Javascript and then have to rewrite it
properly in Haxe to get some real control and structure to your
project! Your taking a Javascript perspective or everyone else
perspective, but if you take a code perspective or your own company
perspective then Haxe makes more sense it's a much better way to code
the javascript in your project and it just takes a couple of hours of
experimenting to realize why, every time you find something f'up in the
browser you don't need a frame work to hide it you just abstract the
horrible bit away because you have a language that makes that easy.
> Using libraries of the native platform will require extern definition
> files: If u want to use a lot of js libs in your haxe code u will
> definietely need them. Otherwise there is no big advantage anymore to
> use haxe at all. If they are not available u have to get your hands
> dirty and write them yourself. While that is true for typescript as
> well chances are higher that somebody provides them already since
> adoption of typescript is higher. For cpp u will need some "glue" code
> in most cases I guess.
>
I see javascript coders just try to drop in components but for larger
companies they end up with a mish match of tech, with front end
developers using what ever takes thier fancy, I do wonder if time
investment with a powerful language like Haxe makes it more feasible to
create what you need in terms of components, interactions and structures
and minimize some of the crutches that developers bloat projects with.
For instance many of the frameworks that companies are currently
subscribing to in javascript are purely because Javascript is too sloopy
and allows code to become a mess and could be done with a few haxe
library toolkits instead.
> Haxe is still a bit of a niche: It might be a problem if u need some
> external help in form of freelancers for example. Good luck finding
> somebody who is profecient in Haxe. I for example do not know anybody
> personally.
>
There are some very able haxe freelancers to be found on the Haxe IRC
and in some of the library groups ( Kha, Openfl, Luxe etc... ) they are
unlikely to be local to you for obvious reasons, but I don't see that it
should be a problem to find someone more than profecient in Haxe and
sometimes also with great expertise in many of the languages Haxe
targets, since Haxe language often grows programmers field of knowledge,
since it creates stepping stones into other languages that are exciting
to take rather than daunting.
> Documentation can be lacking: While the language itself is nowadays
> very well documented it is not true for many libraries. I encountered
> that problem especially when I wanted to do some cpp stuff. Try to
> find some documentation on the cpp Pointer class for example. Or how
> hxcpp building works (which is important to understand if u want to
> integrate some c++ libs). Or somebody mentioned to "use kha".. yes, I
> would love too, but without documentation it is just to time consuming.
>
This can be true of well documented languages... often it's really hard
to find good useful information, for instance in experimenting with Haxe
swing I was often fustrated by many sources of information being rather
shallow and did not really provide the overview, but too often got
muddled by the Java's love of abstracting to the complex to obscure the
simple.
> Lack of tooling: IDE support could be better. On windows there is
> FlashDevelop, on mac ur choices are text editors like Sublime or Atom
> or IntelliJ. While Sublime (and surely Atom) are great for haxe, they
> are no real IDEs. There is no debugger or fancy refactoring. While
> Intellij suppose to fill that gap it still feels to rough for me. I
> always hit some brick wall when I want to use it. U can use a debugger
> on your generated code though, which works "so so" I would say.
>
I do agree but also power development does often result in jumping
around code in a way that lets you loose sight of structuring classes
and easily you end up with classes that are too big. A simple IDE and
trace debugging forces you to try to break up code into managable
testable chunks. But I do agree tooling in Haxe could be improved, I
would just like to see the bases being vim, textmate etc.. rather than
java based IDE that are overly complex.
>
> And also I want to leave a few words about OpenFL and targeting Flash:
> It is not that simple as it seems on first sight. Last time I checked
> OpenFL uses the native display list when targeting flash. So no
> Stage3D. That is on mobile in most cases a no go. U could just use the
> starling lib and use it in haxe, but also the last time I checked u
> have to patch it and u loose all arguments names of functions when u
> just use the swc for example (the Haxe Starling port seems very
> immature to me).
>
It's feasible to mix as3 swc's with Haxe using either as3 or Haxe as the
base so if your practical then this is only a purist argument. If your
targetting Mobile then you would use the C++ and possibly cppia for
testing, using Starling every day it drives me crazy that it's really so
unlike real flash, and touch events bugs when you don't use inheritance
everywhere - have driven me crazy, and feathers seem to fall off. I am
pretty sure NME haxe c++ is much closer to normal flash and with cppia
it's really fast to compile.
> That is also true if u just use a jar on the java target platform,
> btw. So u will need extern definitions again. At least this is my
> experience, somebdoy might correct me on this again, since I did just
> try it briefly without much investgating.
>
Some Jars work really well without doing anything, it's pretty amazing I
am unsure how many of the problem ones have been submitted, but it's
getting pretty easy these days I don't think if you choose carefully you
will need to many externs hand written, you may have to avoid one or two
large frameworks.
> So by mentioning all that I just want to help to paint a realistic
> picture. Not everything might be right, but this is my current
> perception. I am happy to be corrected if somebody feels like the
> critics are unjustified.
>
Well the critics are justified but I add my thoughs as possible counters
to them, I realize that some of my thoughs may not hold water with many
peoples approaches. But I do believe that some of the javascript
workflows that are currently popular are due to the mess of the
language, and would be laughed at if approach that way in a more
structured language. So the arguments are lessened in a more
structurely expressive language.
But would be really interesetd in any blog post you make covering some
of the workrounds and approaches you have discovered when using Haxe.
PS there are at least two very good libraries in Haxe that cover short
Lambda so it is not a biggy.
Best Justin