|JS Classes blog||Can ActionScript real...||Post a comment||See comments (0)||Trackbacks (0)|
Download Size: 25MB Listeners: 1104
Introduction music: Riviera by Ernani Joppert, São Paulo, Brazil
RSS 2.0 feed compliant with iTunes:
Michael Kimsal: What? What? Can you speak up? There's too much rain. I can't hear you.
Manuel Lemos: I think Michael does not need an introduction anymore because...
Michael Kimsal: Hey.
Manuel Lemos: ...he's very famous in his...
Michael Kimsal: In his own mind, yes.
Manuel Lemos: ...no. In his own street.
Michael Kimsal: Yes.
Manuel Lemos: Hello Michael. How are you doing?
Michael Kimsal: Well I'm famous. That's how I'm doing. I have to stay indoors because all my neighbors know my name.
Manuel Lemos: OK.Michael Kimsal: Oh, goodness. Hello.
Manuel Lemos: Well it's always great to have you in the podcast and even greater today, we have a guest. Actually a returning guest.
Michael Kimsal: Return. Yes.
Manuel Lemos: Zach Kessin. Hello Zach. How are you doing?
Zach Kessin: I'm good. I'm good. Well getting over a bit of a cold, otherwise I'm good.
Manuel Lemos: Yeah. Well you are in Israel, right?
Zach Kessin: Yep.
Zach Kessin: Send some of that, why don't you send some of that rain over to us we could use it.
Manuel Lemos: Yeah. No. I can use it too because the weather becomes also pleasant when we deal with the rain but back to the podcast.
Michael Kimsal: Zach, as a guest, you can have the first crack at this.
That being said, I think that the thought that an untyped language which is always inferior to a typed language is a bit of a fallacy.
Manuel Lemos: Yeah. I think it really is not claiming merits about the language itself but rather what happens at runtime when it needs to compile to native code to where it benefit from JIT compilation and whatever.
Michael Kimsal: I'm going to throw out a pure anecdote. This is a friend of mine who shall remain nameless. "Hello Michael." He was a, he still is I think a Java guy, by and large. He's done a lot of Java.
He'd done some Objective-C years ago and a lot of Java but a few years ago start working, he's worked at a couple of companies where he's done PHP and he had a lot of reservations about, and I think still, still has a few them like well you don't have strong type then you don't have this, it's just, it's going to be a nightmare. And after a week or so we were talking and he said I can't believe how fast it is.Now he wasn't necessarily saying this is in all cases faster than Java but he was expecting things to be slow because he had been, he'd learned for years. Well a compiler needs to know types so that it can make things faster and yes, PHP is untyped or loosely typed, type juggling whatever you want to call it but there's so much less overhead.
And yes, there maybe a few technical merits that Actionscript is better. It's proprietary, it's closed, it's losing...
Manuel Lemos: Right. Losing.
Manuel Lemos: Exactly.
Zach Kessin: I remember a conversation somebody was having about, somebody was asking how should I sort a bunch of elements to be shown in an interface. And there was this complex discussion of this sort versus that sort versus asort, you know, whatever. And somebody finally asked so about how many items are we talking about? Answer about 50. And they're like, oh, just choose whatever sort of library comes with your system. On a modern computer, nobody's going to notice when you're sorting 50 items.
Michael Kimsal: Yeah. The hit to the file system to load the library one time is going to be far more than, you know, sorting it five million times. You're going to have a bigger hit just keeping it memory management, keeping it in memory right in the execution of the sorting.
Zach Kessin: I mean there's the famous quote, I want to say is from Uncle Bob, Robert Martin, you know...Michael Kimsal: Just say it.
Zach Kessin: ...that premature optimization is the root of all evil in programming.
Manuel Lemos: Well in this case, you're just mentioning the actual compilation to executable code which should be provided by the virtual machine engine eventually a JIT compilation and well when we are talking about speed in a browser which is, that matters for Actionscript at least, I think it may or may not be important for instance if we are dealing with animations that need to be smooth.
And I don't know if the end it will be a big advantage for the actual Actionscript code to compile to run faster or pure CPU tasks because graphics and whatever, all is I/O operations because the CPU is communicating with the graphics hardware and whatever it does in the end, I suppose it has to wait for the tasks to finish.Michael Kimsal: Yeah.
Manuel Lemos: So...
Zach Kessin: And one thing that, one thing I'm...
Manuel Lemos: Maybe what it saved is not important.
Zach Kessin: One thing I've noticed whenever I moved into a typed language with a few exceptions is just how verbose they seem. I mean I played with Haskell which is lovely but like in Java, you know you have to explicitly tell the type of everything if you have a variable, you know, NI=1.
Wouldn't it be nice if you could just say, well OK, clearly I is an N, you don't have to type N for it, which Haskell...
Michael Kimsal: Oh, but you forgot to import java.lang.integer as well. You could do that. So, yeah. In Actionscript, yes. I'm going to type these. I'm going to say this is what it is and the compiler can figure this out.
So technologically, it may be better but politically, they have shot themselves in the foot so many times in terms of mind sharing, community adoption that I just don't see where they have to win. People don't care about tech specs.
Manuel Lemos: Right. Well actually, it seemed like a desperate attempt to get some attention.
Michael Kimsal: And you gave it to him right there. We just talked about him for six minutes.
Manuel Lemos: Yeah. Right. I think that's more than enough. I think. What do you guys think? I think there are more important topics to comment and actually...
It has splats so if you have a parameter, a function usually takes two or more parameters. You can do parameter one comma parameter two dot dot dot and it'll just shove everything into second parameter.
Also that this keyword is alias to the @ sign in Coffeescript so you can just say at if you're typing this a lot. The really thing I think that really gets you though and there are a couple of nice little things that you can uhm... There's the question mark operate which helps you just see if a property exists or you know, you a problem of...
Michael Kimsal: Nulls
Zach Kessin: ...X dot Y dot Z and Y is null and blah, blah, blah and absent using something like Monad which let's talk about some other time.It's a really nice way, you follow sort of destructuring environment where you have basically (A, B) = (B, A) and switch two variables around or like that.
Michael Kimsal: Wow. Let me ask you a couple of things here because I've been aware of Coffeescript for a bit and I think, well I haven't used it on any projects myself. I did a little, at one point I think I got a "hello world" running or something but I've not incorporated it into anything mostly because that most of the projects that I work on are not green field.
I'm inheriting something else and most of my time is just spent figuring out how that stuff works rather than refactoring to use things like Coffeescript but I'm wondering and I googled around for this and I saw a little bit but I'm wondering what the current tooling support is?
Do you see some of the same attention being given to Coffeescript in the tooling market? Or is it maybe a little premature for that?Zach Kessin: I'm not really the right guy to ask because I hate IDE's.
Michael Kimsal: Oh I get it. They're not for everybody. I did see some reference to support in text mate for example.
Manuel Lemos: Yeah.
Zach Kessin: So again similar to say a Haskell or a Lisp where any of a number of functional languages that had done this for well Lisp for 50 years so it's not like it's a radical new concept.
Manuel Lemos: So from the point of view of those that are listening who are not aware about Coffeescript, do you guys think it is, it would be worth studying Coffeescript and trying to use it to get some benefits or probably not worth the time because it's yet another thing to learn and in the end probably is not a great production increase. What do you guys think?
Michael Kimsal: Uhmm.
Zach Kessin: So...
Manuel Lemos: What is the verdict?
Michael Kimsal: My verdict well...
Manuel Lemos: Thumbs up or thumbs down?
Michael Kimsal: I think Zach's verdict is probably going to be thumbs up, mine would be and I don't want to put up in your thumb there but mine would be a cautious yes especially for new projects if you have.
Manuel Lemos: Right. So your verdict is maybe?
Michael Kimsal: Yeah. It would be a you should investigate more and you should not rule it out just because it's something new, which I think some people tend to do.
Manuel Lemos: So if somebody does not have the time, should invest or maybe give it some time later when are more free?
Michael Kimsal: It all comes out of your personal schedule I think if you got some time now, I mean well it comes really this is a professionalism standpoint. You should always do investigating, spend some of your time investigating and learning new things that make your job not just up to date with the latest buzz words but that make you more productive and make you more valuable.Coffeescript may not be it three years from now maybe something else would come along but if you can demonstrate, you know, that you learned this you get value out of it, you provide value for the people and for your clients or for your employer I think it's generally a good thing to do.
Suppose you have a list of airports, right? And you'll have, I had a code so you know, for Ben Gurion Airport, you'd have TLV and the location will be, country would be Israel and then maybe you have some information about the runways and a bunch of other stuff and then you have lots of other reports.So you know you have one with Heathrow and you just want to pull out those airport codes right? Just that one field, there's a function there called pick or pluck, it's called pluck where you can just say the field name and it'll just takes one list and just boom it turns to a new list of just that field.
But it's just this wonderful thing and you end up with this code which is very, very declarative. JQuery there's some more things naturally, the reason is they both sort of revert to being more or less Monads and mathematically but that is a topic for another day but...
Michael Kimsal: Well you're bringing...
Zach Kessin: ...but yeah.
Michael Kimsal: ...you're actually highlighting the point of discussion that came up in our meeting the other day as he was demonstrating some code.
And there were a few of us that were saying, no, no, no, no, no, shut up this is better. Yes you end up in some cases, you end up writing a little bit more code not always. And I think as you hit a point where as the project will get larger, I think, certainly with something underscore you used in the proper hands, your code would be dramatically less that might otherwise have been.But there's initially you're actually making, writing more code than you might need to to separate things out but the code what we ended up seeing Kris do, it was eminently more readable and maintainable not just for him but for somebody else.
The thinking that using something you underscore sort of forces you to do I think for a lot of people would be painful upfront but once you hit that you're going to be able to give yourself and your clients and your employer much more maintainable code over the long haul. That's a kick of mine lately because I'm taking over code that is not very maintainable and...Zach Kessin: I mean one thing I've noticed since I started using underscore, first of all by the way in addition to underscore is also a backbone.js which inherits from it which adds in a whole bunch of data handling and restful data loading and models and stuff like that.
I can't think for, the last time I actually had to think about I had to write a loop is just I always go with a map. You know, I like higher order functions. They're very nice abstractions. I just say, OK. I have list A I want list B how do I take one element of A to B? What do I need to fill? Which ones do I need to reject? Which ones do I need to keep in? And write it down to a couple of steps. It tends to be as I said map, filter, map, map, filter.And each of those is one line of, you know, each of those map and filter functions tend to be one or two lines quote and if you set up, put them in line you've put them in sort of a global namespace just to keep them external, they also become trivially easy to test. Because there's only so much that can go wrong in a two-line function.
Zach Kessin: Yeah I expect... And the truth is JQuery also has as much as the same advantage if you actually use it well.Michael Kimsal: But, but, you know, I could say the same thing about PHP. But most people don't use it well because we've had a decade of copy and paste culture. Let me search for something in Google, this function does this, copy and paste it there you go. And it's been an advantage, I've said before JQuery's the PHP of the front end. I say it.. but I say it.
Zach Kessin: I think that's kind of a, I mean the thing about both JQuery and underscore that I love, OK, so this idea came out on Haskell, by the way it seems like all the really interesting ideas these days are coming out of Haskell, of what you call the Monad. I'm actually writing a short ebook for O'Reilly on Monad, it should be out eventually, that basically it's this wonderfully, it's sort of a programmable control structure it's the best way I can describe it where basically once you start running code Monads, you have basically a data and your functions just become this wonderful abstract algebra where you going to write down an algebra of your functions and things like your SQL parts are just kind of pop out.Michael Kimsal: It did happen but at the moment I'm still happy to watch other people do it and learn from them. I was never good at math either. So...
Manuel Lemos: OK. We'll be there.
Zach Kessin: Come by I'll buy you a falafel.
Michael Kimsal: That's sweet.
Manuel Lemos: And I can learn what that is.
Michael Kimsal: Speaking of falafel...
Zach Kessin: It's ah, falafel is Israel's national food. It's a fried chickpea thing. It's truly amazing and it's become almost an item of religion here.
Michael Kimsal: I can't imagine a topic of religion, you know, something of religion happening in Israel. That's kind of pointing to me.
Zach Kessin: Yeah.
Michael Kimsal: On that bombshell. I'm good at, OK, yes I'm going there. I went there. Let's reign this in and move on, Manuel I think has some time concerns that he's late for another...
Manuel Lemos: Yeah. Well actually we all have. I'm sure that's a topic of underscore and Haskell and Monads are all give good topics. Maybe in another episode we can get back to that but we are running to the end of the podcast and I still like briefly mention a topic that probably is not really, really important but it relates to the start topic of this podcast.
It's about impress.js, which is basically a presentation framework. It uses many of the possibilities of CSS3 transforms and transitions and stuff to implement animations like Prezi. I think everybody knows Prezi, right?
Michael Kimsal: Yes.
Zach Kessin: I think so. I looked to the impress.js. I mean it gives like a slideshow but does like all sorts of cool zooming and panning and these cinematic.
Zach Kessin: I did and it was gorgeous. Unfortunately it was like...
Manuel Lemos: Was it smooth for you?Zach Kessin: It was very smooth. Unfortunately what wasn't smooth was trying to write my own because basically their documentation consists of the words read the source code.
And it's like, I was using the X.JS library for a while with little bunch of stuff for like several years in fact and one thing I will say about X.JS, their docs are amazing. The documentation is fabulous and read the source code as documentation, if that's your documentation that's a pretty good way to make sure I'm not going to use your product. Honestly I don't. Show me how to use it, give me some examples and then give me a walk through and...
Manuel Lemos: Well the point I wanted to bring is that at least in my machine problems because it's a bit slow, old, and the animation did not run as smooth as the Prezi animations on the same hardware. So maybe there is plenty of room for optimization in impress.js.But I wonder how much of that lack of smoothness of this impress.js animations are due to that claim of the Adobe guy that compiled Actionscript which is what runs on Flash will eventually run faster and would it make any difference in the smoothness of the animations? Well I don't know it's just supposition.
Manuel Lemos: Right. It's true. Could it be a problem with the browser? Implementation of CSS. I'm running chrome here.
Zach Kessin: Could be. I don't know. I mean it's an interesting question. The question how do you optimize fancy graphics in web browser's probably something that we could do an entire series of shows on although probably I'm not the expert on that by any means. So...
Manuel Lemos: Well I think probably it's just because the implementations of CSS 3 animations and transitions and so on is probably not as mature as whatever are the resources that are used in Flash movies and stuff.And I agree with you that all this is probably not due to any additions as of compilation efficiency of the virtual machines.
Zach Kessin: I mean I suspect there are some of that in there but I think at best a very small second order effect. I think the native renderings and CSS renderings, I think that one reason it's much more important.
Manuel Lemos: Well I think we probably have to wait a little more for CSS 3 to be more mature in terms of implementations in the browser.
This newsletter, actually a report gives suggestions like encouraging the authors to send more interesting objects and this month we have quite a few more than the average.And what do you guys think were the most important? Zach would you like to start?
Zach Kessin: Sure. I mean I've been kind of out of, since last month I've mostly been and not coding so I kind of just sort of threw some things here.
The jQuery PhotoWall here that somebody, that Andrei I'm going to try to pass his last name, he's from the Ukraine, to put looks like it'd be really useful for the circumstances. If you need to integrate a photo wall into your app and it's only not a crazy thing to want to implement, then it looks like it would do a nice job. And I have an ugly code here...
Manuel Lemos: Actually in the end of the fact is probably what method is most, I think it's similar to the way Google presents Google image results.Zach Kessin: Probably.
Manuel Lemos: It's the different pictures of different sizes is all tiled.
Zach Kessin: One word of warning folks don't open up the sample screen shot in the office it is rather not safe for work. Of these sample images there are at least two women not wearing much clothing or at least none at all really.
Manuel Lemos: Maybe it was marketing stunt from the author.
Michael Kimsal: Can you send me that link? I just want to add it to my blocker so that I don't go there. I'm just saying if you send it to me.
Zach Kessin: Sure.
Manuel Lemos: We are in 21st century. It's not that shocking.
Michael Kimsal: Oh no I'm just saying I want to block it though. So you know, I want to add it to my blocker.
Zach Kessin: Look I mean I'm just bringing it up because some places are more conservative than others and depending on the office you work in, if you suddenly bring up a picture of a woman's unclothed to the chest you might piss some people off, just saying.Manuel Lemos: Yeah. Well now that you mentioned it everybody wants to see it.
Zach Kessin: So yeah, so Andrei if you now suddenly get 200 hits you can blame me.
Manuel Lemos: Actually there is, in the forum for these packages, all package published in js quasi site have a forum for the users to comment about, ask questions and inclusively post package ratings what they think in terms of different tasks or utility consistence, documentation, examples and so on.
And there's also a guy that comment, did not write the class at all and just comment the pictures seem obscene because they contain nudity and well...
Zach Kessin: I wouldn't call them obscene but possibly inappropriate will be I think more accurate. But on something more interesting or at least more relevant.Manuel Lemos: I need to watch out for that because Google may punish the site, they might consider not good for safe search.
Zach Kessin: Oh there's that too. Also the fact that corporate firewalls will give you prompt.
Manuel Lemos: But what did matter is that the object is useful but other than that what are the class would you like to mention? I think we have a little more time for you to comment on one another.
Zach Kessin: The Image in movement class here was written by Michael somebody, I cannot, his last name I'm not sure how to pronounce but he's in Italy.
Manuel Lemos: You may try.
Zach Kessin: It was really use-- what?
Manuel Lemos: You may try to pronounce the name. We always try. It could be Michelli Prigigalo.
Zach Kessin: Prigigaio yeah.
Michael Kimsal: Michaelli Prigigalo.
Zach Kessin: Yeah.
Manuel Lemos: OK.
Michael Kimsal: It's pronounced just like it's written.
Manuel Lemos: It's so odd that we even forget to tell what you're going to say about the object itself.
Zach Kessin: Well it lets you move something down around inside of a ah...Manuel Lemos: A container.
Zach Kessin: ...container. Unlike the sort of small does one thing hopefully does it pretty well JQuery plugins that they don't try to solve every problem, they just solved, you know one specific problem that you know if you need to do that...
Manuel Lemos: Just use the plugin.
Zach Kessin: You know, it'll do it or if not no big deal. You know it also has advantage that if you're only trying to solve one problem, you can try eight things at one point, if I only need one of them well the other seven just kind of ride along as baggage.
Well so this kind of thing, if you need it it's useful. I don't quite know why everybody feels the need to include a copy of JQuery with JQuery plugin I mean really.
Manuel Lemos: Yeah. Well that's something that we already commented before. Sometimes jQuery is not needed at all but people seems to got used to work with JQuery everywhere that now they can't get rid of it when it's not needed.Zach Kessin: No I'm not saying it's not needed I'm just saying you don't actually have to include a copy of JQuery itself in the package, you know.
Manuel Lemos: Oh yeah right.
Zach Kessin: If I'm already using JQuery I've already got a copy of it. I don't need to...
Manuel Lemos: Well sometimes it's useful because some users do not quite realize that when they really need to have JQuery they don't have it there.
Zach Kessin: I'll give you that.
Manuel Lemos: But I agree with you it's really not needed but it's a criteria of the author but also talking about that I think it would be fair to mention also the Scroll Content package which is also a JQuery plugin that does I think it's almost practically the same.
Basically to have for instance of you have an image or actually it could be something else displayed in a page and for some reason you don't have a browser area large enough to display it completely, it renders it inside the container.
And then you can scroll it either with keys or using your mouse to drag the visible area and this other plugin was actually I've noticed it's from the same author I just did not realized what would be the difference.
And anyway Michael, what would be the other object you would like to comment.
Michael Kimsal: Well there were a couple that jumped out of me this month. One specifically to kind of tie in with the talk I was talking about before, the underscore talk where Kris Jordan was doing SQL DSL.
Michael Kimsal: And it's, I was trying to compare the way it was done with the way Kris did his and certainly this is not as, he's not using underscore. It's not as clean as what I saw Kris do but it's also not as, Kris's was not as full featured.
I think he could've eventually got to that point but this one that Tom's put together has more. It manages joins and things like that as well too. So it's got more meat to it.
And actually we wrote a couple, I wrote to Tom saying, well I have a couple of questions. I haven't heard anything back from him but that's, because I only wrote a couple of hours ago. Imagine in Germany they're already in bed or I'll be out at the pub or something so.
Manuel Lemos: No not really.
Michael Kimsal: Or you want to talk about it too?Zach Kessin: I actually had a question. Was this he's trying to do, use the in-browser SQL lite, that's part of HTML5?
Michael Kimsal: That's what it seems to me to be. It doesn't seem that he's using an external SQLite database. It looks like he's using the built-in.Zach Kessin: Because the problem is that that SQLite in the browser is more or less going away.
Manuel Lemos: Right.
Zach Kessin: The various working groups is, it's five working groups have more or less abandoned it in favor of indexed DB for a variety of technical reasons.
Michael Kimsal: Not to that extent though. What he's created as an abstraction layer could probably be refactored some as actually what he's got is there's a sequel thing and there's a DB and then there's a separate adapter that is specific to SQLite. So...
Manuel Lemos: Right. It's more an abstraction layer.
Manuel Lemos: It wasn't the first one.
Zach Kessin: What's Titanium?
Manuel Lemos: And desktop right?
Michael Kimsal: Now there's a separate, you can do that but there's a separate aspect. They almost a separate SDK if you're targeting desktops and some of the things that are available for ah... Because actually the other thing you can do with desktops is you can also bundle in PHP, Python or Ruby interpreters.
Manuel Lemos: Abstraction?
Michael Kimsal: ...common, yeah common abstractions. You could use the compass in Android. You can use the compass with that, you just call the Titanium compass stuff. So they compile all the native apps.
Now what Arturs has done is he created a sort of a nice little animation or an object that provides some animation at the background if you do it with Titanium app.
Manuel Lemos: Yeah.
Manuel Lemos: Yeah. We got a few components not specifically for browser applications but there are not many and these were actually the first for Titanium?
Michael Kimsal: Titanium, yeah.
Manuel Lemos: Just a reminder for whoever who is listening that would like to submit components for those other known browser platforms to feel free go ahead.
Michael Kimsal: And I don't mean to interrupt, I'll throw out something else that I'd like that Arturs did because not everybody necessarily has the Titanium SDK already set up. He made a l little YouTube video of this is what it looks like.
Zach Kessin: PhoneGap would actually give you some of that as well.
Michael Kimsal: Oh yeah. They're different approaches and actually we talked about PhoneGap last month a bit because the company Tura has released their Mulberry platform which is sort of like rails for PhoneGap effectively and they just came out with version .3 last week and they're doing more of that so I may want to revisit in a little bit too but I like these abstraction layers that let you target mobile devices without having to write native code for every platform. Enough said. Manuel move on.
Manuel Lemos: Well I will just like to conclude this section to comment on now another object. Again from Michaelli Prigigalo, I hope I'm making it good try to spell his name.And basically this object is yet another JQuery plugin that actually does something that can be useful for many applications although many browsers support something like that for instance for textarea inputs to have a sort of a holder element that allows you to drag and resize the area of the element on the page.
Manuel Lemos: Now we are going to just move to a final section. I hope it's not soon, Michael do you have already the upcoming list of articles for the JSMag magazine?
Michael Kimsal: We got some. There's going to be some last minute changes. We've had some I think probably due to the holidays and beginning of the year we've had some cancellations but Mike Schwartz has been really for the past few months has been writing a
No comments were submitted yet.
|JS Classes blog||Can ActionScript real...||Post a comment||See comments (0)||Trackbacks (0)|