Author: Manuel Lemos
Updated on: 2011-01-18
Posted on: 2010-09-29
Also covered are the latest objects published in the JSClasses site and the latest interesting articles published in the JSMag magazine.
Also covered are the latest objects published in the JSClasses site and the latest interesting articles published in the JSMag magazine.
Click on the Play button to listen now.
Download Size: 26MB Listeners: 2457
Introduction music: Riviera by Ernani Joppert, Săo Paulo, Brazil
RSS 2.0 feed compliant with iTunes:
- PHPClasses repository site
- Lately in PHP podcast
- JSMag magazine
- GroovyMag magazine
- IndieConf - Independent Developers Conference
- CommonJS API
- Node.JS project
- E-mail validation PHP class
- YayQuery podcast
- Object Literal Pattern article by Rebecca Murphey in JSMag issue of April 2009
- HTML Page animations object
- HTML Template Editor object
- HTML Cutter object
- SQLite Connector object for Adobe AIR applications
- Retrieve Twitter statuses object
- JSMag issue of September 2010
- Getting Started with Node.js article in JSMag issue of February 2010
- Mário Valente's blog (Twitter @mvalente)
- SeedCapital seed funding company - funding project submission
Introduction of Mário Valente (03:33)
The latest interesting articles on JSMag magazine (49:22)
I have created many years ago a site named PHPClasses.org that is basically a repository for components that are written in an object oriented fashion. And that was meant to make the components more usable and useful for other developers.
And following the same format I also have a co-host; in this case it is Michael Kimsal.
Michael Kimsal: Hello, hello!
Manuel Lemos: Hello, Michael, how are you doing?
Michael Kimsal: Excellente!
Michael Kimsal: It would, wouldn't it? Let's give them a little ear candy. Hello everybody, my name is Michael Kimsal, I do many things.
When I'm not busy putting those together I do things like do some custom PHP and development, I do some training for the Zend Company on PHP, and I'm trying my hand at conference organizing.
Indieconf is a freelance web conference coming up in Raleigh, North Carolina November 13th, so that's a little bit about who I am, what I do and what's coming up, thank you.
Manuel Lemos: Well, that's interesting to know. Just to give an advance to our listeners, more or less by the end of this podcast it would be interesting to have a regular section on which you talk about the latest articles that were published in your JSMag magazine.
Michael Kimsal: Sure!
Introduction of Mário Valente (03:33)Manuel Lemos: Okay, but let's move, starting right in this episode we also have a guest, in this case Mário Valente. Hello, Mário, how are you doing?
Mário Valente: Hi there, hi everyone.
Manuel Lemos: Well, Mário is Portuguese like myself. Despite I moved to Brazil many years ago I am still Portuguese. I know Mário from the Portuguese Internet scene and for many years ago. He was a co-founder of one of the independent ISP's in the early days of the commercial Internet.
But it would probably be more interesting if Mário you could give a brief overview of what you have been doing and hopefully put in context why I have invited you to this podcast.
Mário Valente: Okay. I graduated from computer science back in ‘92. I started the first Portuguese private ISP, Internet Service Provider, back in '94. And I've been basically an entrepreneur for I mean not all my life but for all of my short life.
And in 2002 I got my MBA from the Portuguese Catholic University, and after a brief stint as the CIO for the Portuguese Ministry of Justice from 2005 until 2008 I left to finish my Master Thesis and start up a new startup. And in this case this new startup can be called the mother of all startups since it is a micro-venture capital company, we are following the Y-Combinator model to invest in technology startups here in Portugal.
Would you like to expand a bit more on that Mário?
In about 2005 I started looking, for professional reasons, I started looking into... I mean I was a pro PHP man myself from 1994 up until 1999, and I switched to Python and worked with, and still do lots of work with Python, but in 2005 I had to look for professional reasons as I was saying into language choices and language trends and taking into account lots of stuff that was going on, and especially the trend towards functional languages like Haskell or Erlang.
That group eventually has turned into and is a current working group on something that is called CommonJS, if you go to commonjs.org you can find lots of stuff there.
Manuel Lemos: Well, but you've also been a detractor of Flash. Do you think Flash can be seen as something evil or just something wrong for the current context?
So I mean that's my take on it, it's not that I hate Flash but Flash is proprietary, doesn't allow you to look at the source code, and has huge penalties in CPU performance since it starts inside its own virtual machine, and so I think that like you said before Flash made sense ten years ago since web browsers didn't have the certain capabilities. Nowadays Flash doesn't make sense anymore.
Other than that one thing that annoys me about Flash is for instance it is not well integrated in the browser. For instance if you have some tags in a Java applet, if you can call it so, you cannot do a select all in the whole page and include the text that is in the Flash because it is not well integrated.
And other things like for instance I tend to use a lot the mouse wheel to scroll up and down, and then when you hit a Flash movie often it does not react as it was a single thing not just a square in the middle of a page.
And that is probably the annoyances of Flash, not just Flash, also Java and whatever gets inserted in the page as a plug-in.
Manuel Lemos: It's probably an iframe, that's a different offset on the page. Well, anyway, I'm just expressing a concern from the non-technical user point of view.
Michael Kimsal: That was a shock!
So we are already talking a different context not just the browser, it's also the server side and what happens on that side. And basically it provides many modules that are often available by typical server side development languages.
Michael Kimsal: Totally different, yeah.
And I think NodeJS, despite it's very recent, it sort of took off last year if I'm not mistaken, it already has many interesting modules and it is very quickly getting close to the level of support of server side programming like PHP. What do you think about this perspective Mário?
Mário Valente: Me? My turn?
Michael Kimsal: Yes, your turn.
Manuel Lemos: Actually I noticed that site some time ago although it did not go into detail how exactly they do implement things like asynchronous calls. Are you saying that they implemented with NodeJS?
Manuel Lemos: Is it something feature complete or maybe it's still part of...?
Mário Valente: I think it's practically complete, yeah, I think there's a huge list of functions that have been ported and I mean I haven't looked hard at PHP lately or for the last few years, but from what I see and from what I understand there's a progress bar here on the site and it's 83% of the PHP functions are ported already.
Manuel Lemos: Yeah, that could be interesting to share with our listeners, I'm sure many of them are PHP developers. And actually I will also take a look because I wonder how they implement for instance networking IO synchronously as it happens in PHP because I could not figure how to do it with NodeJS.
Mário Valente: Yeah, but NodeJS is completely asynchronous, it's philosophy is asynchronous. There are several things that you can do to make it synchronous, but it's basic philosophy is being asynchronous. What happens is that in PHPJS you have the IO functions which basically call the synchronous versions, the synchronous APIs of NodeJS.
Manuel Lemos: Right, that's what I was wondering because I know there are synchronous versions for file I/O but I did not find at least in the latest version that I tried, which is 0.2.2, and networking.
Let me give you more details why I'm thinking about this because just as an exercise I tried to port one of my oldest and successful components that I wrote in PHP many years ago which basically did some email address validation.
It did not just validate the format of the email address, and check the MX records, it also simulated SMTP connection to the destination server to see if it would accept the message almost to the point of sending the actual message body
And it was an hell to implement it without synchronous calls because we have to do all with callbacks. And if you have to iterate over several MX servers to see if one accepts the message in case one, for instance, rejects the connection, you have to skip to the other, it's even more complicated.
Actually I succeeded with it but it took me practically two days to write a few hundred lines of code, which of course that's my fault, that's my limitation, it's for me I think with everybody else, when you are so used to programming with synchronous function calls, switching to a synchronous mode you have to think a lot what your strategy is.
Mário Valente: It's hell, you just have to get into it.
Manuel Lemos: Now imagine SMTP protocol dialog, you have to send the request and then wait for the response and depending on the response you move on to one action or another. And that done a dozen of times in the same protocol connection.
And, well, I will upload that email validation component that I ported.
Manuel Lemos: Yeah, using NodeJS, but if not fully done. There are a few things that I do not handle already because I did not have the time to check how to handle timeouts of connection receiving and sending data, but most of the functionality is already there.
I will upload it in the next days. But by the time this podcast is live on the site it will be already there so I'll have a link to that component.
Now, when you embed those into a virtual machine you can then use them either to synchronous I/O or asynchronous I/O.
Manuel Lemos: Yes, for file I/O that is already present. I just think that at least for networking I/O if it is already available it is not there in the documentation, but I suspect that for getting a better acceptance of NodeJS they will have to concede and provide synchronous implementations as well just so people do not get nuts when trying to do things like I did simulating protocol.
Michael Kimsal: I would disagree slightly. I think just briefly here the one thing that will really, really, really help adoption is to have some of the major Linux distros provide out of the box apt get yum packages and to have some of those adopted by some of the major hosting companies.
If when I got a Linode virtual machine if it just came with some moderately recent version of NodeJS or something that had some built-in way like pre-defined proxies and things like that, so I could just point a domain name at it, maybe this is a control panel sort of thing, it took a while for the rails stuff to get integrated into web hosting control panels, but it's there now and hopefully we'll see some of that adoption by mainstream hosting providers.
To me that's going to be the thing that breaks it into the mainstream. And it's one of the things that has kept PHP there for so long, not that it doesn't have its other ups and downs or other pros, but it's just there because it's there, and it's so easy, you can build it into Apache, there's a lot of utilities, I can point and click, and the hosting providers and the control panel companies have that nailed down for years.
Is there enough demand for them to go out and say, okay, we're going to provide something for Helma or we're going to provide a point and click or NodeJS, it'd be awesome if they did.
Mário Valente: Yeah, I agree, I totally agree. And that has started to happen. I agree with you when you say Ruby On Rails took some time to come out, the Ruby language has existed for a few years. And it's the Rails framework that really pushed the adoption of Ruby as a popular language.
Mário Valente: I totally disagree with doing Object Oriented the right way.
Manuel Lemos: I meant in the sense of doing Object Oriented Programming in the way that promotes reuse of the code.
Michael Kimsal: I was going to throw out a couple things, one, Rebecca Murphy who does a little bit of work for JSMag, she writes sometimes and helps out in other ways, also runs the yayQuery Podcast for JQuery stuff, some people know her name.
She had an article in JSMag about a year ago, a year and a half ago, but it's also on her blog. It's Using Objects to Organize Your Code, and I've seen her give this presentation a couple of times too, she talks about the object literal pattern and she gives some very good reasons and gives some very good examples in that, not saying this is necessarily a replacement for that book but it's sort of a taste of why you should do this and what problems it solves.
Manuel Lemos: Right. Well, that's what I meant but Mário won't agree.
Mário Valente: Well, you used the words 'the right way' to do Object Oriented. There are actually two ways of doing Object Oriented, one is the class-based way which is probably what you are referring to as 'the right way' to do it, but there's another way of doing Object Oriented Programming which is called prototype oriented way.
Where as in the class based way of doing Object Oriented you have classes as abstract types. In prototype object oriented languages or model you have objects and you don't need abstract classes, so you instanciate other objects not from classes but from previous objects.
So I have programmed for a long time in class based Object Oriented-ness, I still have some difficulties going into the prototype way of doing things, but what I have been finding out for the last couple of years is that the prototype way of doing Object Oriented-ness is much better.
Manuel Lemos: Right. Well, so I think we do not disagree after all. What I mean the right way, as I mentioned, is that people encapsulate the functionality inside the object functions rather than put them in the global scope which is something actually Michael commented on in the podcast that we did about the JSClasses site that people, for instance, they use JQuery which is all Object Oriented, but in the end they clutter many global variables and functions to use it and it makes it very messy and hard to maintain and that was my sense of what wouldn't be the right way.
I do Groovy work and I came to it from PHP, very class oriented. There's a lot of parody, a lot of things that I would do in PHP I can mimic almost entirely in Groovy, but Groovy, as Ruby, offers a lot of meta programming stuff that's very slick, very easy, and very integral to the language.
And I think that the more languages that we use as developers the easier it is for us to adapt to the nuance and the features of each language but it does take some time.
Manuel Lemos: Right. Yeah, I think for people that come from other languages it's just a matter of adapting to things that are a little different.
Michael Kimsal: Well, functional programming, for example, does kind of take some people off guard; it takes a while. Closures just came to PHP5.3 a year ago, it's taking people a while to figure out how can I use this, what's the benefits, what's the drawbacks, what do I gain from this, oh, I get this, let me try this.
Mário Valente: Yeah, but see all this stuff is closely related. Closures, prototype based programming, synchronous functions, this is all interconnected, you can only do asynchronous program, namely asynchronous I/O or asynchronous programming in general, if you understand the concept of closures.
And if you understand to use closures not in 'the right way', I don't want to say that, but you do need to change your mind from class based objects oriented to prototype based objects oriented. So I totally agree with Mike, it's something that takes time with it; I, myself, am still trying to adapt myself to this way of thinking, but you do get lots of benefits from these features.
Michael Kimsal: Yeah.
Well, there are several interesting classes, actually objects, that were published here. I have published a few just to get the site started, one about making page animations to easily script them to provide very simple basic but useful effects.
I also have written a wrapper around HTML editors that several browsers support, but adding special support for templates which basically consist of marks that appear in the middle of HTML, and you can visually insert them in the HTML editor. This is very useful for implementing documents that have placeholders to insert complex, more complex HTML.
And other than that I would like to mention just a few submitted by other developers. One which is very interesting which is an object that cuts HTML when the text acts as a certain length of words. And this is very useful when you want to paste, want to present a text in an HTML page that visually it would be better to cut it or make it shorter until the user wants to click a button to expand and at the same time keep the original HTML text in there in the page, so the search engine is Google or others can fully index the pages and you do not have to apply some server side tricks to cut the HTML to make it shorter.
Michael Kimsal: There's one other that jumped out at me, can I jump in here?
Manuel Lemos: Sure.
Michael Kimsal: They prefer whatever Adobe tells them to prefer, so.
Manuel Lemos: Yeah, they obey.
Michael Kimsal: Yes.
Michael Kimsal: Well, the one I found most interesting is the one that I'm writing myself which I plan to upload probably in the next week or so which does client side resizing of images before you upload an image. So instead of uploading a 4MB image that's gigantically huge if you only need a thumbnail of it to be like 400 pixels across this will do that.
So I'm working on how to package that up into something more reusable, that's my focus right now, but I should have that up probably in the next couple of weeks.
Manuel Lemos: That's interesting, what is your approach, do you use canvas or something like that?
Michael Kimsal: Hey! That would be telling. You'll find out soon enough.
Manuel Lemos: Oh, okay, that will be a surprise, as if we couldn't guess.
Michael Kimsal: I have more error checking to put in and I have to make it more reusable but I'll let you know when that's ready.
Manuel Lemos: Right. Well, there are a few other classes but we don't have much more time to go through them.
The latest interesting articles on JSMag magazine (49:22)Manuel Lemos: Other than that Michael already mentioned an article that would be worth looking at in your magazine. What about the latest issues? What articles would be worth taking a look at?
We did have Ben Dowling gave an article in February on getting set up with NodeJS, although I'm not sure how out of date, it's been seven or eight months, it might be a little out of date now, but we've got this ongoing series right now about server side development with Helma, so I'm looking forward to the next edition of that which will be out this coming Friday, October 1st.
And to kind of throw this out to tie it in with JSClasses, if you use the coupon code JS Classes, jsclasses at jsmag.com you can register with that and use that coupon to grab any issue of your choice.
Manuel Lemos: Oh, that's interesting.
Michael Kimsal: If you want to check out Ben's article from February 2010 on Node JS just redeem that coupon jsclasses and it's yours.
Manuel Lemos: Yeah, that's nice, I think that will be an opportunity that many listeners will take.
Manuel Lemos: That's great but what would be the business model or you're just funding because you like it?
Mário Valente: Well, I mean several other development frameworks exist and they do make money, so there would just be some thinking about what the business model could be, but that was something that I would be interested in.
Manuel Lemos: Right, so just to give some more detail for people that would be interested to consider your offer, do you have any restrictions in terms of projects that you would fund or not?
Mário Valente: No, we would or we will fund any idea that we find interesting from the business point of view not from the technology point of view. I mean of course we do prefer a couple or a few technologies just for the reason that they might be able to lower costs and from that I mean open source and free access technologies.
We would tend not to choose projects based on technologies for example like .NET or ASP or Microsoft languages or infrastructure, not because it's Microsoft, and I don't like them, I can state that, but it would mostly be due to cost reasons because if the right project came up for investment and we found out it was a good possibility for investment we wouldn't, we couldn't care less about what technologies they are using.
So from the investment point of view we are technology agnostic. Then I have my personal preferences but that's it.
Manuel Lemos: Okay, so anybody could approach and propose a project for investment or do you have things like geographic restrictions, or would the funded teams have to maybe be in Europe or they could be elsewhere?
Mário Valente: I mean we are just starting up ourselves, so we don't have that many resources, so we do prefer that the projects are for now based in Portugal, but we're looking towards Europe as well.
We are investing right now in a company from, in a startup from Lithuania, and where we would like to do some traveling back and forth and some distributed team coordination but we intend to do it.
The rest of the world I mean it would be a little bit more difficult, for example, Brazil would be easier basically due to the language, I mean right now we are focusing on our geographic area.
Later on if we grow up a little more I mean then we can start looking at wider possibilities, but I mean once again if a good idea comes up I don't know from Pakistan or from Australia what we would try to do is convince people to come spend six months or a year here in sunny Portugal.
We are better than San Francisco, we have a better bridge, better wine, better food, better trams, and so we would try to convince the team of that project, that interesting project, we will try to convince them to come to Portugal for six months to a year, that's what we would try to do.
Manuel Lemos: Yeah, sounds good. Well, so what would be the way to contact you is there a site that they can visit?
Mário Valente: If you go to my personal blog, that's mvalente.eu, or if you search for me on Google, Mário Valente, you can find my personal blog, there's a contact form there. Or if you go to the company's, to our company's investment site, seedcapital.pt, there's a project submission form there and you can submit your projects there.
Manuel Lemos: Okay, sounds good.
Conclusion (57:34)Manuel Lemos: Just let me thank you, Mário, for coming, it was great to have you here, you have your insights, as well Michael. And if you don't have anything else to comment on that's the end.
Michael Kimsal: Just, hey, Mário it was great to meet you, thank you very much for your time. And, Manuel, thank you for putting this together again.
Mário Valente: Thank you Michael and thank you Manuel as well.
Manuel Lemos: Okay, bye, bye.
Michael Kimsal: Adios.
Mário Valente: Bye.
You need to be a registered user or login to post a comment
Login Immediately with your account on:
No comments were submitted yet.