02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous Video
Chapter is concluded.Next is

Questions and Answers

Why use haXe? Any real world samples of haXe? What's the difference between FDT and Flash Builder?

Video Transcript

00:00our Power Flasher GitHub account. So, if you actually just go to our sources here,
00:04you'll find the sources available for this.
00:08For all these projects I'm using here, check it out, or I'm sure you just Google
00:12GitHub Power Flasher, and it'll pop right up.
00:16This is the question that I have in my head, because I saw when you said that you had a
00:20title of a hack. Sorry, that's all you're supposed to say. I had no idea what it
00:24was. I did a Google search, and then I decided, you know what, I'm going to stay knowing
00:28something about it, so I'll ask the right questions instead of asking it after I actually know
00:32what I'm talking about. So, my question is, why would I
00:36want to actually do hacks? Why not just stay with the programming
00:40language? If I'm in JavaScript, why not just work in JavaScript? What are
00:45the big advantage of working with hacks?
00:49I think that is just an amazing question, and I think that's something
00:53that every person should ask themselves.
00:57For some people, hacks is not the right way to go.
01:01They'll just be like, why would I do that?
01:05It's a personal preference we've actually had at the Power Flasher
01:09Agency. We have some people who just, maybe they...
01:13For example, I used the JavaScript example.
01:17Some people, it just drives them nuts writing JavaScript.
01:21They just do not like it. They're prejudiced. I'm
01:25not using words in their mouth. Let me get the idea. They just don't want to deal with it. They hate it.
01:29And they do kind of like the idea of having an editor, of using
01:33a syntax that's more similar to ActionScript
01:37to generate the JavaScript code for you.
01:41I do think, I will say, I'll be totally honest, that I think
01:45if you're just doing a small thing, a small project, do it in JavaScript.
01:49And again, we're talking more about the JavaScript example.
01:53I've never even started JavaScript. However, I know a guy who's...
01:57His name's James Jackson. You can check him out on Twitter and on the web.
02:01He is building a massive, massive cloud platform.
02:05I will say he is working with a really massive
02:09project. And he's
02:13a very proficient JavaScript programmer. And he's very comfortable.
02:18He actually relaxed the idea of writing it in HEX. Because he's got hundreds
02:22of classes. It's a massive, massive project. And for him,
02:26it makes him much more efficient to write it in HEX than
02:30doing it all in JavaScript.
02:34So really, I'm getting out of it that a lot of it is just the workflow.
02:38So if you're more comfortable with the structured workflow, then obviously
02:42you don't have to worry about if it's PHP, which is much harder to get all the
02:46classes and names and structures versus needing to remember it by heart or googling
02:50it each time. You just get that convenience of the same structure. Even though
02:54the application that you're building is custom built for PHP. So if I'm building
02:58this HEX project and it's going to be for PHP, it's not going to be that easy
03:02for me to refactor it and make it good for Flash and good for
03:06JavaScript, right? It's not about making it easy for you to cross
03:10between languages more than making it easier for you to work in the same workflow and the same
03:14type of mythologies. Would that be an accurate statement? Yeah. Yes.
03:18That's exactly what I would say. I think some people talk about...
03:23I've heard this. Even within the HEX community, there's people who
03:27disagree with each other on how to use HEX. Some say, oh, I just want to have one
03:31code base. That's it. Then push out the mobile platforms. And other people
03:35are like, eh, I like having my PHP HEX project
03:39and my JavaScript HEX project. I'll keep the platform separate.
03:43So I would definitely say that
03:47it's nice, though, when you do share... There are some libraries that you can share.
03:51Like, for example, if you have a math library. That's platform agnostic.
03:55Just maybe some calculations or some methods that you've
03:59done that you want to share between different platforms. That's totally doable.
04:03So especially between Flash and JavaScript and C++.
04:07Or you have a...
04:12I know that there's a port of rubber-penner signals for HEX. I think it's called
04:16a hustle, like HXL. And that is...
04:20So you can actually use that same messaging system
04:24for Flash, for JavaScript, and for C++ even. And even
04:28I think Nico, possibly even PHP. So you can actually have the same
04:32way of having this way of working with events.
04:36One library for all these different platforms.
04:43Very interesting. So just a couple more questions from our guests. Real world
04:48application...
04:52Well, let me just stutter a little bit. But basically, are there a lot
04:56of real case applications? Or is it kind of hard to know who's actually
05:00using HEX? And are there any sample projects of big sites
05:04or big implementations of something that we know that they're using HEX?
05:08And we could learn from their experience. Yeah, I think the best thing to do would be to
05:12check out the HEX.org website. They have a few...
05:17It's kind of old. It hasn't been updated for a little bit. The guys are working on the
05:21API right now. There are some examples there.
05:25There's a HEX group on Google+, and there's a few guys
05:29on Twitter floating around who talk about their projects.
05:33But you're all right. It is a little tough to know because they
05:37write in HEX, and they don't... When you go to a website, they don't advertise,
05:41hey, this is, by the way, this is written in JavaScript HEX.
05:46That doesn't really happen too much. Actually, it doesn't happen at all. No one's going to advertise that.
05:50I do know that among game developers
05:54that there's a ton of guys using HEX for game
05:58development for Swift. There's that there.
06:02So, there was another question which I think you already answered was
06:06basically, could HEX convert C++ code to ActionScript 3?
06:10So, it seems like the answer is no because it's really more
06:14I wouldn't even know how to call this.
06:19It's more like a... There's actually quite a lot of languages that try to do this, but basically it's a language
06:24where you build your application and it converts itself into whatever
06:29output you need it to be, but vice versa, it doesn't go the other way around.
06:33It's not like Adobe's attempt with Wallaby or other
06:37applications that try to convert from one programming language to another programming language.
06:43Unless you have something to add that I could ask the big question
06:47of the day, which obviously I think everyone was really excited about this topic.
06:51It was really interesting. And the next question would be, and you could always answer the first one as well.
06:55The next question would be, what is really the difference between
06:59Flash Builder and FDT, which is a question that Shammy had.
07:03By the way, Shammy, send us an email at
07:06www.everythingaffiliate.com and for a little gift as well. So, whoever talked publicly
07:11today, just send us an email and we'll figure out with you something from our
07:14goodie bag. We actually have quite a lot of stuff in the goodie bag, so we'll be
07:17relatively generous because almost no one actually did the Twitter stuff.
07:21Yeah. Okay. So, the first... Oh yeah. So, if you remember what I was talking to earlier
07:28about trying to introduce the... I know it was kind of like a fire hose here of information
07:33here. I kind of let off. For the hex, it's kind of in the case of hex to Flash, it's a compiler.
07:42You have script, output by code. But for the other targets, I would say it's more
07:48better to call it a script generator or a code generator. So, that's kind of how...
07:55It's outputting JavaScript code. It's outputting PHP code. It's outputting C++ code.
08:01So yeah, you're right. It's not like an in-between, some kind of
08:05conglomerate or together. It's just you write hex and then you can generate
08:11JavaScript, PHP, C++ code. Or in the case of Flash, Iniko actually compile, of course compile in
08:19the sense of we take source code and generate a binary, a Swift, or a Iniko... I think it's
08:27called NK files, like that they just execute. All right. So, the next one is difference
08:34between Flash Builder and FCT. That's... I mean, I get that all the time. And let me just open up here.
08:42So, the biggest difference is... The easiest way to answer that is we have a live parser
08:51that does not exist with Flash Builder. So, if you ever used Flash Builder that...
08:58Just go ahead and do this. If you have, if you download, download something like that.
09:02You create a file and you type in Flash Builder, you're not going to know that
09:08all this code I'm doing my screen here is breaking my application until I save.
09:14And when I do save, you only get one error back at a time.
09:18And that's because how Flash Builder works is that it actually saves your file,
09:23generates a Swift, and then whatever error the Swift says to you, that's what it tells you back.
09:29So, that's why, like for this example, if my screen is still active, which I think it is,
09:33you know, I have five errors here. Flash Builder, you really would have one error
09:37coming back to you at a time. And you'd be like, oh wait, okay, it says I have this
09:40code as well, so get rid of that. Then you have to compile again and be like, oh, okay,
09:43there's a line here. Okay, okay. And then I would save that. Whereas for FTT, it's actually,
09:50it's always, we have this parser, it's always running while you type. And so that enables
09:55you to very quickly write code and find mistakes really fast. There's one, that's probably the
10:02biggest example. And then the other one is that we have a lot more quick fixes and quick
10:08assist available to you and advanced refactoring. Like for example, you know, I could do things like,
10:14let's see here, extract a constant variable out, right? Or let's see here, I can do things like
10:21select a block of code and extract a method, right? Do things like that. You know, I have
10:29things like, you know, 10, like can we just do a 10? Two, well, you can do things like
10:35extracting local variables. So you have a lot more of those things available to you.
10:40Other things like quick fixes, quick assist. So we have something like, what was it? I think 35 or 40
10:47of things that you can do to quick fix or quick assist to generate code for you.
10:54So that's, I'd say that's definitely it. So actually, I'll show one real quick. I'll show,
10:59go ahead and talk. I'll show a quick one. Obviously, one of the bigger advantages it
11:06starts free, you get almost everything, which is really cool and exciting.
11:11All right, this is actually an interesting question that we didn't really ask anyone, but
11:15can I limit my application to only work on some mobile devices such as only on the Kindle Fire?
11:21So all this time we were talking about building it for Android in general, but is there a way
11:25to make sure that your application will only be presented for people with specific devices?
11:30It's such a specific question that, you know, it is a good question, though, such as the Kindle Fire
11:36just coming out and people wanting to develop just for the Kindle Fire. I think we just have to do
11:41a little bit more of research on it, but I think that doesn't depend on our development itself. It
11:46depends on the actual platform that sells the applications. So if the application has some
11:51configurations that enable you only to show it for people that have specific devices, I think
11:56Amazon does have that. I'm not sure about if Apple has that configuration or not, if you could sell
12:01it only for your iPad, or I'm not sure. That's just something you have to research into and
12:07figure out as you figure out what applications you want your app to run on. By the way, Chris
12:13sent us answers to most of the questions, so we'll post them up on our website hopefully
12:18later this week, but he had some good answers. And again, anyone that is in our event is going
12:24to get a free book. Well, it's not a printed book, but it's an e-book from O'Reilly. We'll send you
12:32information about that in an email.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!