Does JavaScript Really Need OOP Classes? - Lately in JavaScript podcast episode 25

Recommend this page to a friend!
  Blog JS Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Does JavaScript Reall...   Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)  

Author:

Categories: Site features, Lately in JavaScript podcast, JavaScript performance, JavaScript opinions

Ecmascript 6 is adding support to classes of objects in JavaScript like we have in other languages, but the interest of that is not consensual among the JavaScript community.

That was one of the topics discussed by Manuel Lemos and Michael Kimsal in the episode 25 of the Lately in JavaScript podcast.

They also cover other interesting JavaScript related topics like the Web Platform site, using Object Properties, writung memory efficient JavaScript, the JavaScript API you never heard of, and the new system of levels and missions implemented in the JS Classes site to make it more fun and engaging for site contributors.

Listen to the podcast, or watch the podcast video, or read the transcript now to learn more about these and other interesting JavaScript topics.




Loaded Article


Contents

Listen or download the podcast, RSS feed

Watch the podcast video

Read the podcast transcript


Click on the Play button to listen now.


Download Size: 30MB Listeners: 1665

Introduction music: Riviera by Ernani Joppert, São Paulo, Brazil

View Podcast in iTunes

RSS 2.0 feed compliant with iTunes:

http://www.jsclasses.org/blog/category/podcast/post/latest.rss

Watch the podcast video

Note that the timestamps below in the transcript may not match the same positions in the video because they were based on the audio timestamps and the audio was compacted to truncate silence periods.

Show notes

Read the podcast transcript

Contents

Introduction (00:20)

The JavaScript Classes Debate (2:51)

Using Object Properties (13:30)

Writing Memory Efficient JavaScript (19:02)

JavaScript API you've never heard of (26:30)

The Web Platform site (31:37)

The New System of Levels and Missions to Become a JavaScript Master (37:44)

Latest JavaScript Objects published on the JS Classes site (50:05)

Upcoming Articles of the JSMag magazine (58:36)

Conclusion (1:00:03)

Introduction (00:20)

[Music]

Manuel Lemos: Hello and welcome to the Lately In Javascript PodCast, this is Episode 25 of this great podcast with no more no less, the greatest Michael Kimsal or should it be some other... Did you mute your microphone or making fun of me?

Michael Kimsal: I'm just messing with you.

[Laughter]

Manuel Lemos: Hello, Michael. How are you doing?

Michael Kimsal: Good morning. I am too legit to quit.

Manuel Lemos: As always.

Michael Kimsal: Yes.

Manuel Lemos: So Michael, well I was curious about how did it go with your independent professionals conference?

Michael Kimsal: Indiconf after all that. All that hullabaloo and all that build up, I think it went well. I had meant to send out a survey this week to people and kind of got... I've been playing a lot of catch up over the last couple of weeks both between the holidays and then some other work.

But overall we had very minor problems this year compared to last year. Numbers wise, I think it was a slightly more attendance this year, more people stayed. I got some comments from people that even at five o'clock in the evening, there where still probably 90% of the people that were there, that were there at the beginning of the day.

People stayed throughout the whole day which is good. So overall it was good. There's a lot of work and it's really only been the last few days that I've been decompressed from it.

Manuel Lemos: Yeah. You look tired I think.

Michael Kimsal: Gee, thanks.

Manuel Lemos: Like you've been sort of giving birth to your own baby after months of preparation.

Michael Kimsal: That and I just got a haircut on Friday too so it's been tough all around.

[Laughter]

Manuel Lemos: Well, on my part I've been also working very hard on something. I actually almost mentioned it in the previous episodes regarding the new system of levels and missions for users of both PHP Classes and JS Classes sites to engage and have more fun, but on that I'll be going to get back a little ahead in this show because it ties in with the sections regarding the contributions done to the site.

The JavaScript Classes Debate (2:51)

Manuel Lemos: But now I'm actually getting back to the JavaScript topics.

I like to start about discussions that I've been seeing all around the Web regarding the upcoming ECMAScript 6 and it's planned support for classes, actually real classes not just objects like you have in the current JavaScript versions that are in use.

Basically I like actually to start by sharing a discussion here. Let me just look at it on the right page.

Michael Kimsal: Is it the one from the chat? Is that the Quora link you've got?

Manuel Lemos: Yeah. That's just one discussion actually I participated in it.

Michael Kimsal: I can't tell when that question is from.

Manuel Lemos: Yeah. That's one problem of Quora, but let me share it first here and try to increase the font because it's not very large. Not that people will be able to read it much.

Michael Kimsal: Yeah.

Manuel Lemos: Well, basically from somebody that for some reason Quora does not disclose was from somebody that asked why do some people think that JavaScript needs classes? And there were a couple of answers actually, one of them is from me, but this is funny.

Michael Kimsal: Here we go.

Manuel Lemos: At least for me Quora is requiring me to be logged in in Facebook.

Anyway, the answer was regarding at least my point of view that JavaScript would probably better to have classes like we see in other languages, not because the other languages have it, but I think mostly what classes offer is a better organization of the way you define your objects.

For instance one thing that I see that the current implementation of objects in JavaScript does not make very natural is the creation of subclasses, inheritance.

Michael, in your experience did you have need to have a more closer way to create subclasses and implementing that in JavaScript?

Michael Kimsal: Well, short answers probably no because I don't typically do enough advanced development in JavaScript clients of JavaScript to where that becomes a huge problem for me. I'm looking at it and it seems like such a simple question, but it's actually deeper than I thought. Why do some people think it needs classes?

It could be well, because other languages have them and that is an answer and it's maybe not a good answer, but I think it's deeper to me it's deeper than just... well those other languages have them.

There's a standardization of how or it would allow for greater standardization of how people solve problems in one area and being able to take that same problem solving approach and to bring that to JavaScript, to bring it for most intense and purposes, to bring that to the client side.

It's the same argument that in reverse that people argue for things like node.js and other server side JavaScript. I want to be able to do my programming in the same language or maybe taking that one step further in the same style of thinking.

If we had a class system, nothing's going to be exactly the same, but if you had a similar class system that you have say PHP or Java or C# and we're able to bring that to JavaScript even if the syntax is somewhat different, people would be able to more easily mimic some of the same organization code and data organization and problem solving abilities that they do in those other languages.

Manuel Lemos: Yeah.

Michael Kimsal: So I think I repeated myself a couple of times. To some extent that answer is just well because other things have it, but just because they have it doesn't mean Basic have that statements, we don't have those anymore, unless you're using Basic. But there's a unification on that and I think standardization of thinking that would be beneficial.

Manuel Lemos: Right. Well, I think you brought up a good point that if your regular use of JavaScript is not exactly to create your own libraries and probably use inheritance to implement some design patterns that would benefit from inheritance, you probably would not miss that, but for me I'm quite used to develop practically all my code being that in JavaScript or PHP or something else in case I use it.

And I cannot say that I am the common case because I suffer from the NIH syndrome, Not Invented Here. And I ended up developing a lot of my code and I feel the need to have subclasses.

And the way it currently it is implemented in JavaScript I mean ECMAScript 5 it's not natural we have to go through hacks to implement inheritance and that is one of the things that I miss in JavaScript without classes as they are in the other languages.

Not that I'm not able to do whatever I need, I could do it but it's still sort of an emulation. Well, there is a discussion about this.

Michael Kimsal: What seems to be obvious though is that to me is that there is not... the type of organization and development processes that are enabled by JavaScript do not seem to be beneficial enough over the old way that people are more used to doing to warrant just going down the JavaScripts sort of prototypical functional sort of approach.

It has a benefit in some situations, but it maybe that we are so wrapped up in class oriented development as a culture whether it's Ruby, Python, or PHP, or Java, or C# or whatever that we need this in a client side language as well and I realized JavaScript is just JavaScript ECMAScript and it's going to be server, it's going to be all over the place.

But the overwhelming number of people are building JavaScript applications in the client and are struggling to determine good ways of organizing things. And there are some really sharper brains out there doing really cutting edge things and building large scale frameworks, but those don't seemed to be being adopted by the masses.

And so do we dumb down a language to as dumb down, maybe seen by some as dumb down, but you broaden the ability in the language structurally or syntactically to let less talented people such as myself get more stuff done or should remain... I mean, really it comes down to it I want to be productive in that too and I can't wrap my meager brain around all of the things that you need to do when I already understand how to do it in a different language or multiple different languages.

Manuel Lemos: Well, I would not say that you are less talented, I just say you don't have the need... because you are humble.

Michael Kimsal: Well, no, but certainly at JavaScript I am less talented than many, many other people. There's a lot of people out there that are really good at it. It's not that I could not get there at all, but my talent hasn't exist right now, it's about here. If I studied and that's all I did, I would get up there, and if I run a marathon everyday I would really be thin, but neither of those are going to happen.

Manuel Lemos: Well, I think many of us just do the... just use JavaScript as much as you need, not because you are studying it in the college or you are having fun creating your own libraries. We have very pragmatic uses of the language, and if we don't need the classes for what we do we simply don't miss them.

There was actually a discussion in Quora with some guy named Baptiste Fontaine, I don't know this guy, but there was a quite long exchange of comments and there was no agreement in the end, that I think it is due to the fact that some people need them and other people don't and it's all fine.

Other than that I don't think the classes will be embraced even when the first ECMAScript 6 implementations come down to the browsers because people will always try to be as much compatible with older browsers for a few years until they become too old to be supported. And I probably do not see classes being embraced in the next four years.

I mean, embraced at large. Well, that's just a guess about the future of the option of classes because in the end you can still do what we need to do with prototype base objects, but obviously I think to be cleaner, to do certain things with the classes as they are.

Using Object Properties (13:30)

Manuel Lemos: Well, that was just one topic and we need to move on to the next topic.

Michael Kimsal: You've gotten very, very quiet.

[Laughter]

Manuel Lemos: Did you miss my voice for a while?

Michael Kimsal: Well, I wouldn't say I was missing it, but you've got very quiet.

Manuel Lemos: Yeah. Well, I don't know what was cut. I'll have to figure it out in the recording. Well, anyway since I don't know it was cut, I need to move on in the pass to the next topic on which we are going to comment just briefly about an article that I have seen about object properties which somehow it is related with the current topic because I think this pertains also to ECMAScript 6, let me screen share it here.

There was this article here Object Properties in JavaScript by Axel Rauschmayer. I never know if I'm spelling his name properly.

Michael Kimsal: That sounds right.

Manuel Lemos: Oh, thank you. Now I'm more relieved. Since you are an expert in foreign languages, you probably know better than me whether I sounded right or not.

Anyway, one thing that got my attention here because I'm not yet very familiar with the whole ECMAScript 6 new syntax constructs, but one thing that got my attention is this name accessor properties because just the other day we were discussing actually in PHP podcast, there was a similar proposal to implement this in PHP to have getters and setters defined with the prefix as we can see here.

Let me try to increase the font. We already have this discussion and actually you even brought up the alternative that... is it Groovy, right?

Michael Kimsal: Groovy. Yeah, Groovy.

Manuel Lemos: I think it is a better alternative that is probably backwards compatible... more backwards compatible than this one because if you try to run this code in older JavaScript versions, it would probably give us syntax error and it will not run.

For me what you told me in Groovy, it is something that you just define your getters and setters explicity as functions if you want to, right?

Michael Kimsal: All property access, all any access isn't always compiled into a getFoo and setFoo. So, either if you write explicitly a getFoo or setFoo or just one or the other, then those will be used and if you don't a generic one will be compiled for you. So under the hood it's always calling getFoo or setFoo, and that's how that works.

Manuel Lemos: What matters for whoever write in Groovy is that you will be able to decide whether you want to write your own getters and setters and regardless if that the default implementation turns into a getter and a setter function, you don't get bothered to actually write if you just want to implement the default behavior which is to have properties public... is it... are they public by default or...

Michael Kimsal: The methods themselves are public and it will convert the properties to be private, but because there's public methods on them anyway, it sort of doesn't matter from day to day standpoint.

Just looking at the named accessor properties here, it still at first blush it actually looks more like C#, but I'm seeing explicitly the get and the set definitions there and those are on the object. So yeah, this actually looks kind of like a hybrid between the Groovy approach and the C# approach.

Manuel Lemos: Yeah. Well, regardless of that from the point of view of the developer, that wants to be productive, actually from your suggestion PHP maybe even JavaScript should adopt the Groovy approach because I think it's nicer and it doesn't get in the way, doesn't force you to go into a bureaucratic development.

Michael Kimsal: Right.

Manuel Lemos: Because by the end of the day all the time that passes we need to work on stuff that needs to get done. If you get buried then these little things writing your getter and setter functions explicitly, all that delays your work.

Writing Memory Efficient JavaScript (19:02)

Manuel Lemos: But moving on to podcast, and now I'm going to comment also briefly on an article by Addy  Osmani. Let me screen share it here. I don't know if I can increase the font.

Michael Kimsal: Yeah.

Manuel Lemos: There are just too many heads that squeeze the space of the window. Anyway, the article is about writing the fast memory feature in JavaScript code. Well, this is a very low level article, probably most developers will not be bothering to going to match detail about memory organization.

But basically it talks about how the different engines work and the differences in the memory management and they disconcept the garbage collection which basically means that once a values assigned to variables are no longer needed probably because they were assigned inside the functions that already exited.

The values are freed so memory becomes available to other values and you don't actually need to do anything specific to free your memory. And as long as you don't keep references to variables, objects that use that memory.

And there was this delete keyword, I was not familiar with this keyword, Michael, did you know about this keyword?

Michael Kimsal: I was not aware of it.

Manuel Lemos: I think it mentions about a map object which I'm not familiar either. I wonder if this looks too much like Java not JavaScript. Well, anyway, I think that this concept of the how they call it the memory leaks...

I'm not sure if it would be right to talk about memory leaks in JavaScript because since there is this collection thing. Memory leaks are not exactly the same as C or C++ that there was some memory that was allocated in those not freed.

I think the memory that remains allocated is because there is some variable assigned to some objects or variable, or value that is holding some memory and once you unassign those variables that reference to those objects actually assign them to new, that memory will get eventually freed by the garbage collections.

Michael Kimsal: Right.

Manuel Lemos: But I don't  think it needs to delete, does it?

Michael Kimsal: Well, you're assuming that whoever is writing the code or the team that's writing the code understands every little bit about what's going on.

I don't know of good strong tools that find all of these things for you yet. Oh, at this point in time, you know, being able to stop and say, "Gosh! This memory is still taken up because it still has this values and this variables are pointing to this values, gosh! I didn't want that.

I thought I cleared all references to those. I don't think there's any good tools to do that right now in Java. I might be wrong, and I'm learning about how to do these sorts of things in Java in over the last year or so. But it's maybe a little naive to just say, "Well, it should all be taken cared of."

Yes! Garbage collection should always take care of this stuff, but doesn't always work, I mean, generally it does, but it's only to do what we are expecting it to do. When it doesn't, how do we figure out, how do we even know there's a problem?

The interesting thing I think maybe for you and me more so this from a PHP background, the idea of low running processes that locked out memory for hours or days that's just not on our radar from a PHP background.

So the importance of this as we continue to move towards processes running in browsers, I've got a web based app that's going to run for three months because it's a app in a browser, but it's really a front end on a mobile device for data collection out in the field.

They are concerns that we need to know more about, but knowing that there's problems or could potentially be problems only helps us so far. We need more tools, we need our tool sets to mature more either in browser things or maybe in browsers things plus in more comprehensive IDEs that help us find this things in the first place.

Manuel Lemos: Well, you mentioned in Java and I think it would be worth mentioning that Java has a lower level control of garbage collector and in JavaScript I don't think that's something that we want to get bothered.

Michael Kimsal: But we are getting bothered with it, and it's something as already handling that, in Java I don't run a garbage collector, a garbage collector runs for me.

Manuel Lemos: Right. But you can control it, its trigger.

Michael Kimsal: Somewhat, but in JavaScript there's data, there's stuff that needs to be collected. Is there a garbage collector that's running? It's doing something, but how do I know what it's doing? How do I know what it did? How do I know that it did what I wanted to do? We were also talking before that while we're still have pants on about the maturity of the JavaScript tools out there.

The idea of garbage collection I said some before some of it maybe lost to the midsts of time, but in general we don't have enough tools to help us identify things that should be garbage collected to the hell as when garbage collection is going wrong to tell us that there's still a reference to this some place which small application is probably easy to find that as we continue to develop much, much larger applications that need to be running for days or weeks, or months at a time in a browser setting.

Manuel Lemos: Yeah.

Michael Kimsal: Will find this, will become bigger problems. And I also suspect that the tools that we use will adapt and mature to help us deal with this problems.

Manuel Lemos: I think you have a point, I am just not getting used so much yet to develop what it's called, so the single page apps. They don't actually switch to another page. And well, what's that?

Michael Kimsal: This is a third of an Oreo cookie, OK.

Manuel Lemos: You're eating?

Michael Kimsal: Now it's nothing. Now it's in my mouth.

Manuel Lemos: Now it's gone. Well, I think you're right and well we don't have the same tools in JavaScript as we have in Java, but probably it's a matter of time until Google comes out with a...

Michael Kimsal: It will be Google, won't it? To me... excuse me, just for one moment. Carry on, but I'll be right back just one moment.

JavaScript API you've never heard of (26:30)

Manuel Lemos: Well, I'm going to just take this chance to move on and open here the screen for the next topic that I would like to comment here. Let me just put it down on the right window.

Michael Kimsal: [Singing] To the left, to the left, to the left.

Manuel Lemos: Well, where was I? JavaScript APIs, right? Screen sharing, the next article I just wanted you to comment. Wait, that's not it. I'm sharing the screen in an infinite loop.

Michael Kimsal: Well, that's great. That won't break, will it?

Manuel Lemos: I hope not. Well, this article that I want you to comment about by Nicolas Zakas is a well known personality here at JavaScript world.

Well, it's about a talk that ended up being converted into a screencast on the so called JavaScript APIs you never heard of or at least I'll should say that most developers do not know that they exist, but they are part of the DOM and there is even a screencast video and Slideshare article.

I'm not going over it now, but I'd like just to mention that it covers several interesting... I would say useful functions of the DOM that they allow us to somehow solve very simple problems that you would better know about them because you want to need them regardless if nowadays you are relying more on JQuery and other libraries that make at least part of this functions not necessarily they provide more elegant solutions.

Michael, I don't know if you actually have seen this presentation and if you wanted to comment about any of the functions that it mentions. It's mostly to navigate over the DOM objects.

Michael Kimsal: Yeah. I haven't seen the presentation, I've seen the slides, but I didn't see or hear the audio or the video with it at YUIConf. But some of the seemed little... they remind me a little bit of I think I mentioned a few months ago of JavaScript performance presentation I saw at Code Stock in the summer.

And I think they didn't... this presentation and that one didn't quite deal with the same things, but there was a lot of... it reminds me of in some ways just because there's some either performance ... I'm pretty sure there's going to be a performance issue with some of the actually I'm thinking of something else, not performance, but..

Manuel Lemos: Complications?

Michael Kimsal: Looking at the screen right now and there's a word that's escaping me, but there's differences and distinction between... he gives a few examples here; child notes and children. They're both going and grabbing something, but they're grabbing different things based on what you might expect. So understanding some of those differences.

And honestly, if somebody maybe has come into JavaScript lately like they've done this in the past few years, they might not. Some of these remind me of old ways of getting stuff like child notes, I seemed to remember that being something that I was doing 10 years ago, 12 years ago. Why that was? Maybe because I just didn't know any better or things like children weren't available at that time. I don't know, I'm not good enough to know that.

I like the way that he's done this because it does kind of show oh, if you're using this, this is what you're going to get. And you're not going to get an error in other case, sometimes specially if I'm doing something kind of quick and hacky I'll just keep throwing something at it until I don't get an error. And it has also given me what I want, but sometimes you may get what you want in some cases, but not all the time.

Manuel Lemos: Right. Well, I think most of this function that you've already mentioned they exist for a long time and I think that some are actually standardized by W3C, probably.

Michael Kimsal: Now, I see 10 maybe 12, 13 years ago. I don't know if all these were necessarily available, you know IE 4 kind of thing.

Manuel Lemos: At least in the presentation I saw some icons that seemed to show that which browsers and versions supports those functions, but well at least now as you said they are available and it would be interesting to know and sometimes you need to solve a problem using your regular jQuery or whatever library you use, you probably will not do the what you wanted.

Michael Kimsal: Yeah.

Manuel Lemos: Well, that's mainly what I wanted to mention regarding this presentation and it is available as I said as a screencast and also slide share presentation. So, go ahead.

The Web Platform site (31:37)

MAnuel Lemos: Moving on to the next podcast. I'd like to mention a site probably most JavaScript developers that are really connected to everything that happens in this community should be aware which is the recent initiative of I think it's less than a couple of months.

All that initiative called the Web Platform, and I'm trying to screen share it here just the side. Basically this is an attempt, I don't know how far this will go, but to have a single web site documenting all the basic JavaScipt libraries, not just JavaScript, but also CSS, HTML 5, and everything else, all the basic APIs.

And this isn't here to be collaborative effort on which the users also participate in a sort of wikis and question and answer sections and tutorials, and everything else that you would like to participate, to help on this effort, to document on which thing in supporting different browsers so you don't have to find those things in different sites.

Well, this is an initiative that is still getting started, they say that web platforms docs are currently in alpha. I think it means that not everybody has been aware of this, and I think the intention of this is just to turn it into a Wikipedia for web development. I think that pretty much summarizes this effort.

I have not been following this very closely, but I think this can promise to be the initiative that everybody will use in the future as a basic reference for whatever web development you want to do. Michael, do you go and decide what did you find about it so far?

Michael Kimsal: I remember when it first was announced a couple of months ago. I think I first heard about this in early October and it was a little bit more promoted as 'Hey, this is a collaboration between all this big names and if you look at the bottom of the screen it's a Google and Microsoft, and Mozilla and HP, and Opera and Adobe and so on with Facebook.

I don't know too many of the people involved right now, what's kind of interesting for me is that there's nothing here explicitly like there's not about the team sort of thing because it's not 10 or 15 people there or 10 or 15 core of people from all these companies.

It seems like it is somewhat of a smaller group, but I was looking through some of the Q and A or the blog section, there's a big name Christian Heilmann or Chris Heilmann I think, fairly well known and very big name in the JavaScript community or I guess the web community in general.

He was just asking a question saying, "Hey, when is this going to happen?" But he brought up some things and his point was when you have live examples you better make sure that the servers are beefed up, and someone had responded, 'Yes, we're working on that."

It almost seems too early right now for this to be a large resource because they don't have live examples of standards and things of that nature. I'm presuming that that's coming in the next few months and once that's there, this might end up being the canonical resource for how do you do this?

How do you do this? How do you do this in a somewhat vendor-neutral way, it's not Adobe saying this, it's not Facebook saying this, it's not Mozilla saying it or Microsoft, it's a collaboration between everybody.

Manuel Lemos: Yeah.

Michael Kimsal: Maybe a little Pollyana to think that this will become something.

It feels like almost any platform or any community that people try to put together to be the place to go, no one goes there.

Manuel Lemos: Yeah.

Michael Kimsal: And the ones that people just sort of start or things that have been around for a while continue to grow or sprout out in unexpected places. With that said, if the level of people that I have seen contributing here continue to contribute and they get live talks and live examples of, it could be a great place.

Manuel Lemos: Yeah. I think this is basically a promise because for now there is not much material in there. Once in that I noticed that in some places sometimes you search for things related with the JavaScript CSS and the first thing that comes up is W3schools and that doesn't sound very standard for many people.

And I don't see much harm in that site, but it doesn't look like what it should be because it's not a site endorsed by anything official like this site which is endorsed by W3.

Actually W3 is the institution that is behind this effort and as you said despite all those big names appearing there, they do not seem to be the ones that are actually putting much effort in this. Let's move on.

The New System of Levels and Missions to Become a JavaScript Master (37:44)

Manuel Lemos: Well, moving on with the podcast, now it's time to talk about the latest contributions submitted to the JS Classes site, but first I'd like to mention superficially about a new feature that is being introduced in the site. It was introduced in the PHP Classes site first, which is basically a system of the missions and levels that contributors can accomplish.

These mission and level are meant to motivate the developers that submits components to the site to do it in a way that will bring them more exposure ad eventually more recognition and feedback from the users.

And actually this is going to be launched in the JS Classes site soon. It was launched in PHP Classes site first because when you accomplish each level, you after accomplishing a few missions, you can earn some badges, just symbols of the missions that you have accomplished.

And these badges at the time we are recording are not yet ready to do JS Classes site. But they will be probably by the time when this podcast is going to be published.

So, I just want to give an overview what this is about. It's basically what I call the path student to becoming a master of in the case the site I'm showing, it's PHP, but it will also be in JavaScript.

Well, these missions are mainly means to provide feedback to the authors, how much they have gone, how much their packages has been accepted.

And the site provides them challenges like reaching a certain level of users and publishing certain number of classes and having some possibility of being nominated for the Innovation Award that in the case the JS Classes did not start yet, but I expect to start soon because we're closer to the goal of the challenge.

Well, just as you... hopefully you can see on your screen, the site provides very nice badges of graphical images that show the level that you have reached and as well as your name. And so this badges are personalized. They are quite large there, there are also small versions of these badges.

And well, anyway if you go to this article that I'm showing here in the PHP Classes site, there is also a video on it that... it's a quick demonstration of all the aspects of this initiative, and I will not go into much more details that this because parts of the challenges are supposed to be surprises to keep the people interested in moving on and level after level.

The only thing that I can say is that each level will have an increasing difficulty, so it becomes even more interesting at the same time as the difficulty increases, the recognition that is provided to the author in many ways as a reflex of the missions that has accomplished it will be higher.

And also the quality of the graphics of the badges will be increasing. In the first of level, which is just an apprentice level, you just need to accomplish a very simple mission which is to read some rules, you earn a badge made of wood, but in subsequent levels the badges would be made up of more prestigious materials. Well at least I hope that's the way I expect the people that we engage on this missions to see it.

Well, this is just one of many initiatives that I'm planning for the upcoming times in the JS Classes and PHP Classes site. And stay tuned because the next things that I need to implement will make it even more fun engaging, at least I hope. And from the feedback that I got so far from the PHP Classes site users they are very excited and many, many of them already engaged on these missions.

There were few minor complaints because some missions like for instance you have to link your account to your Facebook account, and some users do not have Facebook account and do not want to have them. And I probably will fix that by making those missions optional.

They are just there not because there is a specific interest of the site, they are just linking your account to Facebook or Twitter will help you to get more visibility to the work you do on the site as we publish new things and that was the main goal of those missions

But other than that, everything else is coming fine despite the whole effort that was put on this. Lots of code had to be written to implement this, but it was quite interesting and well, I hope it becomes as fun as I think it will get for the users. Michael, did you take a look at this initiative? What were your thoughts about it?

Michael Kimsal: Well, I've looked at it and you have talked to me a couple of times about some of the research that you've looked at and the idea of there's the term that you're using I don't want to go to the term right now, but incentivization, public incentivizations and socializing some of that, and it looks like you're continuing to go on in that direction and we hopefully see that in the JS Classes site as long as it's actually bringing a benefit not just to you, but to the people themselves.

Manuel Lemos: Right.

Michael Kimsal: Personally, me, I don't want to say, I don't fall for that... I don't mean it that way, just I am not those sorts of things are not a reward for me, they never have been. Even years and years, and years ago, I mean, as a kid I remember not liking some of those same symbols.

Manuel Lemos: Rewards.

Michael Kimsal: Rewards, badges, things like that, you know, if you give something in class, oh, here's a sticker, here's that I've always felt uncomfortable with that, but I do realize that it's a staple of the social internet and it means a lot of different things to a lot of different people.

So you know, if you can make that happen and provide value for people and they get some motivation out of it, that's great.

Manuel Lemos: Right. That's actually interesting to bring out that point because this giving badges to users, it's not the exact point of the system, it's actually a bit silly to think about the season let's just give badges as compensation.

The actual rewards for the authors that contribute to the site is that once they've accomplished those missions, the missions themselves have as goals to give greater exposure to the work of the authors and in the end they'll get more recognitions and feedback. And that's what they think it would be the real reward and the badge itself is just a symbol.

Manuel Lemos: Right. But I don't think... I wasn't trying to trivialize it at all. And I don't think it really is trivial. I mean, the idea of somebody is going to do X, Y, and Z and then they get the reward that they get is really the exposure and the accomplishment, and the fact they got something done, and then the idea of a badges just some little extra thing there, people could be doing that already, and there is a lot of people like the reward whatever that may be.

And I'm not saying people are doing it just because of that, but that is also the public symbol that they did something. And the people that they interacted with initially may know that, but six months down the line, other people coming to that interacting with that person, they can look and see, oh, here's your symbols, here's your PHP Classes stuff, here is your JS Classes stuff, here is your badges on other sites, these are the collected shorthand representations of accomplishments.

Manuel Lemos: Right.

Michael Kimsal: So, and they're longer lasting somewhat too, so again I wasn't trying to trivialize and I think I actually get what you're saying even you may nov think I do, but anyway you asked.

Manuel Lemos: I get what you're saying, what I meant is that some users are already doing what is required to accomplish some of the missions, but others don't because they don't realize what is the importance.

Let me just give an example of one mission that most of the authors are not aware that is important for them which is if you... there is something now actually introduced by Google this year which is establishing authorship which is you have a page on the internet and you are the author of it, but how does Google know that you are the author, and to see of somebody copies your work, use the original is you, is in your site.

And the Google created this sort of protocol on which you establish some links between the pages and the actual Google profile that you have there could be on Google+ or not. You don't have to have an account on Google+.

Once you've establish that profile, if somebody searches for your work on the Web, if a page appears under search results, which is a page that you establish authorship using this protocol, the results appear with your picture on the search results.

And some authors know about this, others don't, and they have to just to establish a link between that site and the Google profile, to do that and one mission just requires you to that. And ultimately the benefit for the author it just not show the picture in the search results, your picture, picture of your face in the search results.

What happens is that if somebody is searching for your work, when they see the search results with a picture, that looks more like the official version and people will tend to click on that page that has the picture and not the others that are sort of unofficial. And the idea of these missions is also to teach these things to developers.

They can also implement these things in their sites, not necessarily just to establish some of authorship of work in JS Classes and PHP Classes.

And this is an example of something that they learn. I'm not, as I said I'm not going to detail the other missions, some missions are very simple, they are not very meaningful, others are more meaningful, it would depend on each author.

And I could stay hours talking about this, but we don't have the time, we need to move on. But anyway as you said, I hope this helps other authors to contribute more and do better contributions not just in quantity, but also in quality.

So we can actually talk more about them say a year on this podcast on which we talk about the latest classes in the site.

Latest JavaScript Objects published on the JS Classes site (50:05)

Manuel Lemos: So, this is the segue way to the actual topic on which you comment the latest classes published then on the JS Classes site, and on that Michael, which ones would you like to talk about this month?

Michael Kimsal: Well, there are a couple, I'm trying to find them now. Of course the moment I tried to bring up my browser, they go away. Let me see if I can do a quick share here -screen share. [Humming] Yeah, share that one.

And I'm, realizing as I'm looking myself in the window that I've got a camera facing me, but the main... the laptop at the main screen I'm looking at is over to this side, so I've realized some of the videos, it's probably looking like I'm not paying attention anything the whole time. I'm actually looking at the screen where the bigger screen, in case you're wondering.

Manuel Lemos: You have a bigger screen, if you have a reflects on your window of the...

Michael Kimsal: Are you seeing my...OK.

Manuel Lemos: Yeah. I see your screen share, I was asking if you are seeing yourself reflected on your window?

Michael Kimsal: Sometimes. I don't have it up right now, but I'm sharing, but I don't see my share being shared on the main screen, I don't know why that is.

Manuel Lemos: Well, I can see now.

Michael Kimsal: Baking classes in North Carolina. So there were two that very recently past couple of weeks Dixan Santiesteban I hope I'm saying that close to correct. Hello from Cuba, Hola! or hello to Cuba.

This is a progress bar and he made a progress bar class. It's just a couple of files, it's actually one file here, I mean, there's a sample, there's HTML, but then oh! I got to log in.

Manuel Lemos: Now you... if you can then increase the font.

Michael Kimsal: Yes I will once I logged in. Don't look at my password there, it's nine black dots.

Manuel Lemos: Oh, I've seen your password. It's dot, dot, dot, dot, dot, dot, dot, dot, .

Michael Kimsal: Yeah. Don't look at that man.

Manuel Lemos: It's big dots.

Michael Kimsal: It is. It's huge. Yeah, there we go. So, Dixan, I see the accent on the A, Dixan Santiesteban fair enough. See this is a class... we will just say class progress bar and it would have methods in it, but as it is in itself is a function.

Manuel Lemos: Sometimes they doesn't look like they are classes.

Michael Kimsal: I know. I'm just going back to our earlier ECMAScript discussion. What would these looked like if they were actually class based instead of ..

Manuel Lemos: That would be a constructor I think.

Michael Kimsal: Would be nice. One of the things I've seen here is that some hard coded styles right in here, certainly things like margins you may want to have it, would be nice for some of these to be maybe programmatically set somehow to set color, and maybe the spacing and the sizing a little bit, but for a progress bar, this is a fairly small class to be able to do and he's got the animation method right there.

And there were... let me jump back a couple more pages back to here. As you can see this month we've had one, two, three, four, five, six, seven, eight, nine, ten, at least nine or 10 things since we last recorded. So it has been quite an upsurge since last month.

Manuel Lemos: Yeah.

Michael Kimsal: Obviously there's a bunch of things we could call out here. Thanks to everybody for contributing so far. Give me one other... just one other call out here from my standpoint would be a fancy alert box, popped up from... why am I not? Satyam kumawat from India. Show alert boxes retrieved from AJAX, down here the code.

Actually a little bit more... you've got bundling jQuery, but then an alert box, this would be the meet of it here, and it's minified look at that. Not easy to tell what's going on.

Manuel Lemos: Actually...

Michael Kimsal: Thank you, Satyam.

Manuel Lemos: No, actually the problem there is that is set the 5.2 HTML that's why it sort of confusing.

Michael Kimsal: There you go.

Manuel Lemos: Now it's very readable.

Michael Kimsal: Yeah, certainly in the last month there has been quite a lot of activity. Is there something that you want to call out?

Manuel Lemos: Oh well, I wanted to also mention a couple of classes this month. Let me screen share them here. Screen share, Google hangouts changed the user interface, now we have to find the buttons somewhere else.

The first one that I wanted you to comment about is this jQuery plug in for what they call masks. Basically masks is sort of a filter that defines which characters can be entered and inputs.

Let's say if you want an input to have a date in a sort of text you can define a mask and from there you can like restrict the characters that the input will allow. Well, I changed the entry here an invalid date, trying to increase the font.

Michael Kimsal: I wish I've done this two years ago. I got a project that I've done most of the people that are using it are school age kids and most of the stuff I write portends to be line of business, larger, more adult people.

And I'm just shocked say create a username, and I've got people putting in everything under the sun, I'm doing SQL escaping so I'm not getting any injections here and I'm dong doing HTML escaping, so I'm not having any issues there, but I'm just shocked at all the garbage that people put in for a username. And it was not even on my radar that I should really be faltering this out or preventing it through a masking mechanisms of some sort.

Manuel Lemos: Well, this class was actually... this JavaScript object was developed by Igor Escobar from Brazil. Actually I have talked with him recently and even mentioned that he has a whole bunch of new objects that he's planning to send, so kudos for him to get started.

This is a very simple plugin, but it is quite useful and you see uses for it and practically all applications that have forms in them. And well, let's hope that Igor will continue to send also other very interesting plugin.

And another class that I wanted to mention is actually we already talked about it in previous podcast, but it was in Lately in PHP podcast by Bradley Matusiak from the United States.

Basically it's one object ties exactly in the topic that we've bee talking about classes and extending classes to implement subclasses. And in this case Bradley provides a solution that is standalone, it's not tied to JQuery or some other library that provide a similar construct.

Well I think this is useful although it's not very complicated, but for people that are wondering, how can I implement sort of class inheritance in JavaScript, they can take a look at this component and gets a few ideas or actually use the complement if you don't want to reinvent the will, but there are always people though who do rather have this implement and both so they can take a look at this class to learn how to do it.

Upcoming Articles of the JSMag magazine (58:36)

Manuel Lemos: Well, with that we conclude this section of the podcast and now we're going to move on to one final section which is Michael, would you like to comment on the upcoming articles of the JSMag magazine.

Michael Kimsal: Well, when I like to? No I wouldn't, but I will. Actually just..

Manuel Lemos: It's a very hard task for you.

Michael Kimsal: Yeah. Yeah. Speaking of duty. There is a couple of things coming up, one we have a piece from Callum MacRae who has written for us before. JavaScript regular expressions and actually compares in between a couple of different engine types out there and some of the pitfalls you need to watch out for.

And we've also got a piece on Grunt.js which is a command line build tool in javaScript. So both of those coming up. There's a couple of other things which we are trying to decide if they're going to make a cut mostly just because of the timing issues so I don't want to say too much, it will definitely be December or January, but JSMag.com check it out, and we will be back with you next month.

[Laughter]

Manuel Lemos: OK

Michael Kimsal: Sarah Palin, yeah.

Manuel Lemos: Sarah Palin. [Laughter]. Well,

Michael Kimsal: Little before your time, little before yours.

Manuel Lemos: Not really, but I was trying not to remember much about her, but nevermind.

Michael Kimsal: There you go.

Conclusion (1:00:03)

Manuel Lemos: Well, this is a bit long podcast recording because we had a few recording problems.

Michael Kimsal: Break them up.

Manuel Lemos: Several times, but we finally made it and I would like to thank you Michael again for coming. I know you are not going to engage all the missions and levels that are coming to the site because you are not a badge boy, but on the positive side, I can assure that the next initiatives that I'm planning will be more appealing to you because... well, I'm not going to tell you what they are, but just put it in the air that they will appeal a different kind of audience to engage not just the people that enjoy earning badges it's not completing missions and stuff.

Michael Kimsal: Are you trying to say I'm fat?

Manuel Lemos: Again?

Michael Kimsal: Are you? Always with the weight jokes, constantly.

Manuel Lemos: Well, you asked me that.

Michael Kimsal: It's getting very annoying.

Manuel Lemos: No, no, not at all, but I could -do you feel fat, Michael? Not to mention.

Michael Kimsal: Camera. It's the facetime camera, it adds like 20 pounds on.

Manuel Lemos: Or it could be my eyes?

Michael Kimsal: Damn you apple.

Manuel Lemos: Yeah. Well, on that humor note, that's all for now. Thank you. Bye.

[Music]


You need to be a registered user or login to post a comment

26,068 JavaScript developers registered to the JS Classes site.
Be One of Us!

Login Immediately with your account on:



Comments:

1. from Cuba - Dixan Santiesteban (2013-01-08 12:57)
hellou Michael and Manuel... - 0 replies
Read the whole comment and replies




  Blog JS Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Does JavaScript Reall...   Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)