BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Interviews Azat Mardan on NodeJS and Express

Azat Mardan on NodeJS and Express

Bookmarks
   

1. This is Brian Rinaldi and I’m here with Azat Mardan. Azat hello, tell us a little bit about yourself, where you work and your background in programming.

Sure, my name is Azat, I worked in software development for about 12-13 years, I worked at startups, US Federal Government Agencies and lately corporations as well. So I played with pretty much and worked with pretty much all technologies, including PHP, Java, Ruby on Rails, but my passion lately has been NodeJS, that’s where I’ve been focusing my time and energy.

   

2. [...]Comparing Node and PHP and kind of saying like Node wins in a way, tell a little bit about that and why you feel that way.

Brian's full question: In fact, so I know you blog about it on your blog, webapplog.com and you have a number of books that you’ve been working on, a lot of them focus on Node, so in terms of you had some recent posts even that are being somewhat controversial, one you did maybe a little while ago comparing Node and PHP and kind of saying like Node wins in a way, tell a little bit about that and why you feel that way.

Yes, that was quite an interesting post to some random people come to me and mention that post and in Silicon Valley and the area. So first of all I think, first I wrote it for startuppers and also maybe people in corporations who try to choose the technology to go forward but more for startuppers than corporations. And I had some person in mind who would choose between different stacks of technology and PHP being the most popular technology out there in the wild, we have Wordpress and other websites. And PHP is also very approachable for like general population and I think NodeJS it’s kind of taking that place in the startup and in the laymen area, in the amateur developer area. So I had that idea in mind so my post might helped somebody to make a decision, and of course at the end of the post I wrote that it’s completely biased because I’ve been teaching NodeJS and I like NodeJS, but also I have lots of years of experience with PHP, so I have some background.

Brian: And I thought that was interesting because some of the reaction I saw was like: “Oh, you can’t really compare with the two, it’s apples to oranges comparison” but I think one of the arguments I made you can tell me if you agree was that, that’s how people, when people are deciding they are not like looking at the little details, they are like saying well I can use this and NodeJS, they are looking at stack that I’m going to use PHP or Node or some other technology, rather than kind of getting into the detailed comparisons of how each function that some of these people were saying was the unfair part of your comparison.

Yes exactly, there are a lot of purists that try to compare apples to apples, but when business people at startuppers approach, they don’t think about it that way, they think about like just give me the answer to my solution, and it could be Ruby on Rails, so it could be PHP without any frameworks, or it could be NodeJS without any frameworks, or it could be NodeJS with Hapi or ExpressJS, because all they care about is the end product, the startup.

   

3. So you obviously have a lot of interest in Express and written about the Express framework for NodeJS quite a bit, and there is been some major changes going on in express, I mean it hadn’t been released but they also have a new project entirely, tell me a little bit about that, maybe if you have any thoughts on that.

You’re talking about Koa? KoaJS is ExpressJS with generators but it’s coming a new version of NodeJS, it’s a ES6 standard and I think that’s the future, but for now the pure Express JS 3 or 4 is here to stay for at least a few months or years, and the main difference between ExpressJS 4 and ExpressJS 3 is that the contributors debundled the middleware so there was some bodyparser or middleware included and it caused some security leaks, it was very hard to maintain while keeping those middleware in the core of ExpressJS. So now there are separate modules and it’s very easy to upgrade them and maintain, and also pick and choose, so there are a lot of alternative to bodyparser people can choose from.

   

4. For anybody who’s like say not use to ExpressJS, what would be like the benefits of choosing a framework like that, and even being on Node, the benefits of being able to run Express on Node and everything.

The benefits compare to going without any framework just, there is so much work, extra work, developers will have to do, for example like parsing and the payload of incoming HTTP request and create a meaningfullJavaScript objects out of that Payload. And in the end they will end up with their own custom framework anyways if they work on a relatively large project, so why reinvent the wheel, where you can chose Hapi or ExpressJS or something else. And when I start working with NodeJS I noted that 90% of the projects use ExpressJS so it became like standard because it’s the most popular, actually I think is the most starred module npm right now. Then I also saw that some frameworks like SailsJS and DerbyJS, they use ExpressJS at their foundation, so there are frameworks that are built on top of ExpressJS, so I think it’s very important to start learning of ExpressJS and move to something right.

   

5. Another thing about, on the topic of learning and something, learning Node in particular, you wrote a post, I’ve seen it kind of recently that was somewhat controversial about things to stop doing in Node, some practices you want people to stop doing, there is someone based on an early post by Burke Holland and things stop doing JQuery.

And that’s one of the most popular posts on Flippin’ Awesome.

Brian: Yes, still to this day, but tell a little bit about some of the things that you suggested, and maybe some of them, you know what was controversial about them, if you feel any of them were controversial.

I added few of the items that might be controversial but they are subjective and I’ve stated that they’re subjective and purely my opinion, but I think one of the most important take aways is that sometimes people put stars in package JSon file which leads to some breakage if the module is updated.

   

6. And I saw did you recommended, you had some recommendations about using semicolons which is like for some reason hot topic, what was your recommendation there?

Well, over a year I’ve been working with CoffeeScript at DocuSign, so I don’t use use semicolons at all in my day job, and in my site projects I also now started not using them in NodeJS and JavaScript and I find it beautiful and wonderful and the code is more consistent now.

Brian: You know I was found it, I thought that was funny when, that was probably last year and that was like a raging debate about semicolons, there was lots of blog posts about it, I remember thinking like you know all the letters written over this semicolon debate probably are more than the number of characters you’ve save by leaving them off in the first place.

It’s kind of moot, I agree, it’s kind of moot, maybe I meet that discussion, for me if I copy-paste some code really quick and like or I type quick I miss a semicolon, the code will still work because the automatic semicolon insertion will insert them, so I end up with inconsistent code, because I miss it, the choice that to use JS linter or not to use semicolons at all to keep code consistent.

   

7. Right, it make sense and you’re obviously a fan of CoffeeScript, I know even that seems to be a topic of like people either love CoffeeScript or they think it’s an abomination of some sort, and why do you think that is?

I actually used to make fun of CoffeeScript, I used to say CoffeeScript is a solution without a problem, but I went to DocuSign and they said one good thing that really opened my mind: all those people that are skeptical about CoffeeScript that they actually didn’t build the things that are relatively large production scale project, so people try, the syntax it’s kind of weird and they might stumbled on some errors, some mistakes because they didn’t understand it and I approached with an open mind and I spend one Sunday, read a book by Alex MacCaw and I really try to understand the language and I loved it since then.

   

8. [...]What are some of the considerations you think that people need to kind of take to account when they are possibly considering using NodeJS in large enterprise applications or large companies as opposed to say something like Java or some of the other systems that are typically using?

Brian's full question: Well that’s good, so one of the things that I want to talk lastly about is that a lot of the readers of InfoQ are enterprise developers and I know there are examples of Node now being used in the enterprise, what are some of the considerations you think that people need to kind of take to account when they are possibly considering using NodeJS in large enterprise applications or large companies as opposed to say something like Java or some of the other systems that are typically using?

Yes, that’s very interesting phenomenon, now we see not just startups starting using NodeJS but companies, big companies like PayPal, Ebay, Groupon, etc, and also Docusign is a good example. So I think the general move is from monolithic Java Apps or some other stack, .Net, to more modularized, more service like architecture with very small services working in a modularized fashion and they rewrite in NodeJS in that modularized fashion. And one of the major kind of main question that always resurfaced at DocuSign when we worked with NodeJS is whether we should pick some module out there from the user land, from the OpenSource Community or create our own. The main reason is that platform is still very immature compare to Java, so the modules out there, they might be below 1.0, so it’s always like we should really scrutinize the third party modules and decide whether its easier to create our own or take that module and maybe patch it or fork it.

Brian: But obviously you found like it performs well in large scale applications, there’s no considerations that they need to take into account for like how to deploy and …

I think our DevOps love it, I think it’s easier to deploy and create, and with the PaaS, platform as a service, now private companies can have, corporations can have private clouds, so that PaaS is even easier and they can do continuous deployment.

   

9. And before we go, maybe you should, you have a book coming out on Node, right? What’s the book and…

It’s my first traditionally published book, I’m super excited, it’s by Apress, it’s called Practical NodeJS, so the angle of the book is to cover pretty much the whole stack not just the beginner “hello world” or not just one particular framework. So it’s for intermediaries definitely but it should given exposure to pretty much all aspects of how to use NodeJS in production.

   

10. Cool, and when you expect that to be out?

In 2 or 3 weeks, the alpha is already available for purchase with the first chapters.

Brian: Very cool, thanks for coming to the interview and hopefully you enjoy QCon!

Thank you!

Nov 06, 2014

BT