Read the show notes and download the episode here
Michaela Light: 00:00 Welcome back to the show. I'm here with Nolan Hook from the south of Shasta and we're going to be talking about ColdFusion command box versus no js and all the cool development things you can do with each. And we're doing a developer feature shootout today to see which one is the better one to use field development process. So if you have not met Nolan a, he has been developing software for more than 20 years and he started off from the video game industry but quickly came into web development and he now runs the sat interactive user group in Sacramento and he teaches classes on all kinds of software development. Cool stuff. And he is a prolific presenter. I lost [inaudible] into the box in Texas, but I think you're going to a CF Summit in Las Vegas on you as well now.
Nolan Erck: 00:51 Yes, I am.
Michaela Light: 02:00 Well I think we should compare. Node.JS to CommandBox, and see how they do that. Are you up for that? Yes. But before we get into the details of the shootout and compare feature to feature and see which one is better, maybe we should just back up and, and and answer what the heck is Node.js just in case anyone listening hasn't really played with it.
Michaela Light: 03:12 So it's a combination. It's both a web server in effect. But running the running in Java script, uh, and also has a zillion development tools that we're gonna talk about in a in level
Michaela Light: 03:44 Excellent. So maybe we should also also what is CommandBox because not everyone may have used CommandBox.
Nolan Erck: 03:52 That is an excellent question. Command box does the exact same thing but for ColdFusion developers, so traditionally ColdFusion is a server side tool he would install on your web server and that's it. You can technically install it on your dev laptop as well, but that's just running a local web server for like development purposes. Cold fusion has not been a tool you can build command line applications with. It has not been a tool you can use in really any situation other than powering a web server. And now that we have command box, that's all changed. Command box now is an app you install on your laptop just like you would install node on your laptop. Or you can install command box on your server just like you can install node up there and it gives you ColdFusion from the command line. So you have your servers side CFML just like you did previously, whether you're running ColdFusion 2016 or 18 or lucee five or whatever, that all still stays the same and you can turn that on and off. With command box, you also get the ability to write native command line tools on your laptop purely in cold fusion. So traditionally if you wanted to write a command line tool, you'd have to use some sort of shell scripting like bash or some sort of compiled language like c plus plus to get command line tooling. And now with command box you can do all of that writing. Nothing but CFML.
Michaela Light: 05:15 Wow. So no more wacky script languages to learn. You do it all in CFML or all in Java script, which you know, many developers know both those languages. So right now it's all very well. These things sound really cool and powerful, but what about installing them? Maybe that should be the first a comparison in a shootout. Are they hard to install or
Nolan Erck: 05:39 no, they're both pretty easy for node. You just go to node js.org and they usually have a couple of great big green buttons on the front page showing you like the latest version that most users have, a sort of the longterm stable support version of node. And then they'll also have a button for the most recent bleeding edge version with all the latest features that maybe isn't quite tested as thoroughly yet. Um, but installing either of those is pretty easy. You Click the green button for the version of your choice and it usually just works. There are regular updates available for no js pretty often on their website. Um, you download, yeah. So you just click the green button, download the installer, it takes a few seconds and that's usually all you have to do. And then on the command box side, it's the same thing. So command box is made by order solutions.
Nolan Erck: 06:26 The folks that give us cold box and test box and a dozen or two other great uh, cold fusion products. You just go to the order solutions.com website, go to the command box page, and they've also got a set of green buttons where you can just pick the version of command box that's right for you. There's one for windows, one for Mac. There's a couple of different options for, uh, Linux machines. Command box requires the Java runtime before command box. We'll run. Some people get a little scared off when they hear that. They think, oh, I have to download Java first and configure it a certain way and do something more complex with it. That's not the case. In addition to those bright green buttons for installing command box, there's a set of buttons right next to it that will give you a command box and the correct version of the Java runtime that you would need for your platform.
Nolan Erck: 07:18 She simply just click that button and command box. We'll install both itself and the job for run time that you need in one step. Um, and that also usually just works. You Click it, run it and it's done. And just to be clear, you don't have to understand that. You just need to say I'm using this version of windows or Linux or Mac. Yeah, if I have a run time or not already installed, just download the one with the runtime and play it safe, you'll be fine. Excellent. Sounds very easy. Now I think we should just ask what the cost of each of these things are because that might be concerning people. Sure. So these are both free open source products. There is no cost to install node, there was no cost to install command box. There is no limit to the number of things you can use it for for the number of web apps or command line tools.
Michaela Light: 09:27 no, I, I noticed when I've done that it I type Palo world or whatever, you know, to the console I'm using Java script command at, but it says undefined.
Michaela Light: 10:36 All right. Now what about command box? Can you do the same thing? You can just write calls
Michaela Light: 11:25 Well, I think rapport must mean read, evaluate, and then the P is, um, that's where I print prints. Probably print. Yeah. Thank you. Uh, but I think that just, I keep wanting to say it's Parse, but I'm like, no, it's not parsed. That's just the side of printing to this print to the screen is what I mean. I think the l means loop. Right? Right. Cause you can too much time writing parsers in my video game days even though that's wrong. Right. But the upshot is you can put either Java script or ColdFusion fusion script into, into either of them. Yes. Execute it. And you can you run whole little programs. Is that the idea? Yeah,
Michaela Light: 12:33 All right now I noticed c'mon on is, is a lot more colorful and um, I think Brad wood who wrote this must have ASCII art embedded in his DNA.
Nolan Erck: 12:45 Yes, he does add the colorful bits of UI to the command box screen. There's actually even um, you can get even more colorful bits of output in command box by installing an add on pack for it called bullet train and that gives you not just more colors, which it does, but it also gives you a more informative prompt when you're in your terminal window by default. Say you're in dos or terminal on a Mac. Usually the prompt shows you the name of the folder you're in and that's about it. You can install bullet train in command box and it will actually give you the name of the folder you're in as well as the time it took to execute the previous statement in command box. It will give you the status of the project folder where you're at. So if you're in a project that's connected to a get repo, the bullet train prompt will show you like the status of that. If you have files that have not been checked in and that sort of thing. Um, it gives you several bits of useful info. If you spend a lot of time at the command line and command box, installing that bullet train thing can give you extra colors and lots of extra nice functionality too. And a bullet train is also a free open source extension for command box. No cost to anyone.
Michaela Light: 14:01 All right, so what's the score on the command line feature? Cause then
Nolan Erck: 14:04 I'd say we're still tied at like two to two.
Michaela Light: 14:07 All right, well the pressure is building up here. So let's look at a running five miles. You've run some batch files you've written in Java script tool called fusion.
Michaela Light: 14:56 Well that sounds easy. So I guess the score is three. All right.
Nolan Erck: 15:00 I would say three. Three to three. Yeah, they're both, they both did the exact same thing. It takes the same amount of typing. There's no difference in the workflow. They both solve that same problem. I want to run code of this nature on the command line and I can do it with one simple command statement.
Michaela Light: 15:17 And what are some common examples of code you might want to run from either of these things?
Nolan Erck: 15:23 Um, you might have. So the nice thing about running both of these on the, uh, laptop itself on the server is you can do things outside of what the browser can do. So if I had files that I wanted to read off of the hard drive and parse them to, you know, create some sort of new output, um, or just manage scripting style things on my laptop. So copying files from one directory to another. If I'm not comfortable with bash script commands, um, if I'm not comfortable with setting permissions in that, uh, environment. If I just don't like Shell scripting, I've, I don't know if I don't know how to do batch script and that sort of thing. I'm more comfortable with the Java script style syntax or with the CFML syntax. I can write code to do things like that, loop over all of the folders, all of the files in this directory count.
Nolan Erck: 16:15 How many of them are, you know, images or copy all of the jpegs from one folder into another folder. Um, the nice thing about being able to do that from the command line is I know there's been a lot of cold fusion work done in the past where people have written giant maybe scheduled tasks in ColdFusion code to do things like nightly pack, a nightly processing of files. So maybe I have raw camera photos uploaded in jpeg format up to a cloud server somewhere by the truckload. We have hundreds and hundreds of new files uploaded and they all need to be run through the CFM image tag to be downsized into a certain resolution or whatever. Um, I can do that with a scheduled task and cold fusion, but I can also do that now from the command line. If I want to test that code straight out in a terminal window, you can do all that from the command my now. So you can do all that from command box and um, yeah, just different like scripting abilities like that are usually what I see people using command box for from the command line.
Michaela Light: 17:19 Well they both found good. So I, it sounds like they're equal score on running files. So it's three to three are right now. But what about if you want to learn these things? Do they have built in hell and is there any
Nolan Erck: 17:33 yeah, so they both have a, sorry, I didn't mean to talk over you there. Um, they both have documentation on the websites that tell you how to use both of them and they both have health commands baked in. So in the node side, if I just typed node dash dash help, I get the default documentation output into the screen that will show me various bits of sort of the default stuff that it does. Here's different command line options you can use to turn features on. And often node here's different flags for setting, you know, I don't know, turning different syntax options on and off, um, things of that nature. And then on the command box side, same thing you just typed box space help, you don't need the dash dash part on the command box side, just box help and it will spit out the default information about which commands are available for you in command box.
Nolan Erck: 18:24 Now the output you get on the node help is a little bit different than the output you get in the command box side. But that just has to do with how the commands inside node are collected versus how the commands inside command box are collected. Command box has what they call namespaces. So you have, you might have a um, command like server if you type box server by itself that doesn't do anything but box server help, we'll show you all of the stuff inside that server name namespace you can do. So things like server start server stop to turn your ColdFusion servers on and off a server list to list all of the ColdFusion servers on the given a machine, things like that. Um, but yeah, they both have pretty good baked in default health. You type, no dash dash help or you type of box help and it both spit out a pretty decent information to get you started and show you what options are available to you out of the gate.
Michaela Light: 19:26 All right, so I think the a score here is for all still neck and neck. Let's see if we can break the tie here by looking at how each of these tools work.
Nolan Erck: 20:45 Just right from the get go and on the command box side, it's the same thing. You type box to start coming box up and that will run a ColdFusion app server at right there on your laptop or on your server. If you have your execute some filed out cfm, all of that cfm code is processed through that app server that's running on your laptop. Command box will spin up different services as it needs them. They're called modules. You might have other installed packages in your command box set up. It'll just turn those on and off and he used them as it needs to. And just like on the node side, command box also has some customizable, um, dot. Jason config files to tweak how cold fusion is run on your machine. So if you want to give it more memory in the JPM, if you want to use a particular port on your machine or, um, pretty much whatever setting you would normally go into the ColdFusion admin screen for and turn on and off with a checkbox, you can tweak all of that stuff through the command, uh, through the command box config j.
Nolan Erck: 21:49 Some files just like you would through a UI. So they both work the exact same way, spins up an engine, processes your code, turns on different modules as it needs to. And you've got config j some files available to tweak both node and command box to set it up however you need.
Michaela Light: 22:08 Well I think they score equally on this fake shit. Twos. Yep.
Nolan Erck: 22:13 The five.
Michaela Light: 22:15 Yup. Five to five. So let's look at setting up a new project in node and C'mon box.
Nolan Erck: 23:15 A few other bits of info, like maybe the author of your project and if you're using a particular license, like uh, an open source license of some sort. Basically any of those questions that you get asked when you type npm in it, you answer all of those or whichever combination of them you want to answer, you can just hit enter. If you want to skip one node, we'll collect all that info, saves it to your package dot json file and that's all you need to start using node as a project, uh, set up on your laptop and pm in it. It spits out a Jason file with all the stuff in it and you're ready to go on the command box side instead of typing npm in it like you do for node, you type box in it and it does basically the exact same thing you do, boxing it in a terminal window.
Nolan Erck: 24:01 Command box will fire up and run and it will ask you a handful of questions as well. Say, okay, what's the name of your project going to be? Who's the author, what version of [inaudible] you're using? Pretty much the same type of questions. Node will ask you on the node side. And again, if you don't know the answer to something or you don't care, you can just hit your enter key and skip pretty much anything in that list. Most of it's optional stuff you don't need to specify to get your project running. Um, when the command box box and command is done running, just like on the node side, you get a package dot json file spit out as the results with all of your info saved in it. In command box you get a box dot Jason file saved with all of your information in it.
Nolan Erck: 24:47 And that's again, all you need to do to start using command boxes. You need to box dot Jason File. So on the node side you need to package Jayce on file. On the command box side, you need to box Jason and file. They both have simple commands, you type to start running and spit that file out. No extra work needed on either side. All right, well say a score is six old, I think six to six. Seven that write to me. All right. I'm going to see if I can throw a spanner in this. A equal thing by a I asking how they deal with dependencies. You know if you've got frameworks for library to use in your production code, right? So dependencies just for people that that might not be familiar with that term. Dependencies are trumps of code. Your app needs in order to run.
Nolan Erck: 28:11 So again, you would put a link in your dependencies in command box for not just jquery and low dash. You might also put links in there for things like I need framework one, I need DIY one or wire box or cold box, the different libraries that your code relies on number in order to function. So again, instead of me going manually out to order solutions.com looking for the wire box stuff, copying it down, going again to order solutions.com looking for the cold box stuff, copying it down, doing the same thing for framework one and d I won and so on in my box Jason File, it was a section called dependencies and I simply put the names of the items that I need in there. Instead of typing, NPM install like I do in the Node Java script space, I type box install and what that will do is it'll look in that dependency section in my box, Jace on file.
Nolan Erck: 29:03 It'll go out to the cloud, hit those URLs, grab the items that I need and just like node has the node modules folder. Um, in your box Jason File, you have a section called install paths where you can just tell command box. When you have copy cold box down, for instance, please put it in a folder called slash cold box. When you copy framework one down, please put it in a folder called you know, FW one or whatever you want to name that. And so they both work the exact same way. You have a box, Jace on file or a package chase on file. They both have a dependency section. You put the names of the things that you need them there. And when you type your install command, whichever engine you're on, node or command box, we'll go out to the cloud and grab the stuff that you need and it drops it right on.
Nolan Erck: 29:50 Your machine. Sounds really convenient. It's super convenient. It really speeds up. Um, building open source apps. When you want to download an app that somebody else wrote and you want to run it several years ago. The readings for those apps use to include things like, okay, before this will work, you have to go out to this website and grab cold spring and then you have to grab this library over here and this library over there and configure them this way. And that was kind of annoying, especially when you just want to get an open source app up and running quickly. And now the author of those open source apps can simply include a box Jay, some file and all you as a developer have to do is type box install and wait a few seconds. It's done. Wow. That's a total productivity wait and whichever way you go. So I guess the score is seven Oh old what you said it all sounds about right to me, and I'm sort of beginning to wonder if the developers of node and the developers come on box and really one on the same person because they will have the same features.
Nolan Erck: 30:47 I don't think they're one in the same person because I don't think Brad would be able to sleep if he was writing in both the notes and the command box stuff. And He's already a pretty busy dude as it is. He is very productive from busy. Yes. I think he has a clone of himself running on a raspberry Pi somewhere. Autists headquarters, you know that very well could be the case. Yeah. Well let's move, move on to Dev dependencies. You know you have, yeah. So dependencies, like I mentioned, those are the things your app needs in order for it to run. So those would be files that have to go on the production web server for the code to function. It's like angular. If I'm building an angular app, you have to have the angular support files up there for the code to function. Otherwise it won't do anything.
Nolan Erck: 32:22 Maybe opening a security hole if I've got a bunch of, you know, sensitive data in the tests, things like that. Uh, so what you want to do with Dev dependencies is have them installed on the Dev laptop but not have them go out to the prod server. So in addition to your dependency section, in those Jason Files we talked about, you can also have a dev dependency section in both of them. And what that does, it list out things that when I type, NPM install or when I type box install it will grab the dependencies and put them in the note in the node modules folder, but it will also grab the Dev dependencies. When I do npm install dash dash dev grabs the Dev dependencies so that way if I'm on the production server I can type NPM install and things like angular and j query will be downloaded.
Nolan Erck: 33:13 However, things like my testing libraries will not be downloaded to gives you a separate spot to put those there for. When I went to do npm install dev on a dev laptop versus just npm install on a production machine and then on the command box side it's exactly the same, right? It's exactly the same yet you have a box Jason file, it's got a dependency section for your framework one or your wire box or whatever. It's also got a Dev dependency section for your test box. Um, your build tools. If you have something in there you want to have on the developer machine, that stuff can all be saved separate to your Dev dependency section. And then same thing if you do box install and installs your production stuff. If you do box install dash dash saved Dev, it will grab your Dev dependencies and set all those up as well. And again, it just puts them in. You've got an install paths folder section for your Dev dependencies just like you do for the production ones. And so I can tell it, please install test box in a folder called whatever you want. Test box to go into. It works exactly the same in node and in command box.
Michaela Light: 34:17 Wow. All right. Well score is a eight all I think. Yup. Yeah. So let's turn to package management. Um, just for people who don't understand what is package management, why would you want it? So,
Michaela Light: 37:56 That's great. I mean, I think that's a really way to speed up development and to share really cool open source code stuff with other folks. So great way to empower ColdFusion or whatever language you code in.
Nolan Erck: 38:10 Yeah, it works really well. The nice thing about it too is folks often will, they'll have a blog where they put a link to a product that they make and sometimes they get bored running a blog and they take the website down and when that happens, so does the link to that open source app. Whereas if you put things out in forge box, it's being maintained by people in the ColdFusion community. So you don't, you weren't as, um, Neri to maintaining your blog to keep that product available for the world as you might've been. Yeah. Maybe 10, 15 years ago. Now you can just throw it on forge box and it will be maintained by artists. So it's going to be there for quite some time.
Michaela Light: 38:45 Resistance is useless. The ball court takeover, fortunately they are very friendly. They are three Mondays open, smalls lit. We've got about 10 minutes left. So let's, let's quickly look at docker. Containerization. Do they both support that?
Nolan Erck: 39:00 They do. Yeah. So you can um, on the node side there is an official docker container. You can go to hub.docker.com and there are node docker images up there if you like to use docker for your Dev setup for production setup. Um, yeah, super easy. Uh, getting into the details of what docker does would probably send us on a pretty big sideways tangent. So I'll just leave it at that and say yes, there is a docker node image available if you want to check that out. And on the command box side we have the same thing. You've got a node, a docker, I'm sorry, not a node, a docker container for command box. Same thing. Go to hub dot Dr Com and order solutions has an official command box, Dr Image sitting right there for you to download and play with.
Michaela Light: 39:46 All right, score is 10. All this game is getting very a nerve wracking. We want to know if there's going to be a winner here. So I think we should go to a totally wacky category and ask, can you make games with these things? Because of course all developers love making games,
Michaela Light: 41:53 Now you mentioned earlier that both node and C'mon Ball, which are open source. What if you want to contribute new features,
Michaela Light: 42:57 easier to contribute to command box,
Nolan Erck: 43:00 um, perhaps a little bit easier. Yeah. On the command box side, 90% of the core engine of command box is written in CFML and the rain remaining 10% is written in Java. I don't think every ColdFusion developer knows Java, but a noticeable chunk of them do. So contributing to the core of CFML is pretty easy. And the Nice thing about running command box is when you install command box on your laptop, it actually gives you all of the source code and as you'll see, 90% of which is CFML. So you don't have to do any extra step to go track down that code.
Michaela Light: 43:37 All right, well sounds like score is 12. All right. Now, so which one should you use?
Michaela Light: 45:12 But but many developers could just pick one and go with it. You don't have to load both, right?
Nolan Erck: 45:17 You don't have to know if you're writing a lot of what we'd call traditional ColdFusion apps where it's like a top down dot cfm file and that sort of thing. If you're stuck in like a legacy style ColdFusion app install command box. Um, and it's really useful in that space for doing things like testing your code against different types of cold patients. Say you're on a little bit of an older server, maybe cold fusion on 11 and your boss finally approved budget to update the code to cold fusion 2018 you don't have to go through the manual steps of turning off your cflf and server, downloading the 2018 installer, clicking the 50 different screens in the installer to set it all up only to realize, oh man, there's a bug in that I have to turn off the 2018 server and turned back on 11 so I can fix my code and make sure that it works on the 2018 machine.
Nolan Erck: 46:06 With command box, it's really easy to flip between versions of cold fusion. You type box servers start to turn on the default server and if I want to pick a specific one, I type box server start CF engine equals Adobe. At 2018 you wait a few seconds for the jar file to be downloaded and Poof, my laptop is now running cold fusion in 2018 let's say we're into that project. I realize my code has a bug and it's not quite compatible with 2018 yet. And I want to flip back to CF 11. Box Server start CF engine equals Adobe at 11, and it will just magically switch you to cold fusion 11. And it really is that simple. You don't have to install anything separate. You don't have to click in the installers for version 11 or 2016 or 18 or anything else. It just command box will download the jar file and set it up for you in seconds. It's great.
Michaela Light: 46:59 So, uh, for people who want to learn this, I know you provide a training in c'mon box and node and all these exciting things. Um, there's also a bunch of other learning resources. I'll put them in the show notes. There's a book on command box autists, uh, has online. And uh, of course Brad Woods blog is another great place. So, um, just as we wrap up, you're going to be at CF summit and last Vegas. What are you looking forward to there?
Nolan Erck: 47:29 Um, I always look
Michaela Light: 47:29 forward to the summit, see the quantity of ColdFusion developers that are there. That conference tends to grow in attendance every year, which I like to see. I like to see more and more people, uh, building ColdFusion stuff and showing up at the conference to get excited about everything. Um, I also like talking with the other folks from the ColdFusion space that are vocal and doing the best they can to support it such as you and the orders folks. And um, I'll probably see some of the guys from Blue River there. Um, and I like calling you. I'll call on you down the road. I feel like we're in.
Nolan Erck: 48:04 I agree. I mean it, um, it's weird. They, yeah, they are like two exits up the freeway from me, but we most often see each other at conferences. Uh, not here in town. We're just, everyone's so busy working on things. I don't get a chance to go down there and say hi to them unless we're splitting a project together, which we do sometimes.
Michaela Light: 48:22 Well, I'll put the link for CF summit in the show notes on the terror tech site. Um, but it's only $99 to x a attend that. It's the early bird price to go to it. It's in October and it is two days packed full of cold fusion info and really intelligent people who were in the cold fusion world. So if you do anything in cold fusion, get there and check it out. Um, it's amazing. I'll be there. I will have a new book on cold fusion out at the summit. So hit me up if you see that and you know, saying hello to Nolan if you see him there. And it's also a great way all the way Adobe engineers from the cold fusion department in India fly all the way to last Vegas. So if you're having a tech issue with cold fusion where you have a new feature you wished it had, this is your opportunity to like just grab them either over a beer or a coffee and just, uh, make the case for whatever it is needs doing. Um, a very effective way to get stuff to happen. So, uh, anyway, if people want to find you online, what's the best way for folks to do that?
Nolan Erck: 49:28 Um, they can find me at my website, south of shasta.com. They can also find me on Twitter at south of Shasta. And uh, yeah, those are probably the best ways.
Michaela Light: 49:38 Excellent. Well, we'll put those links together with your other links for get hub and linkedin and what have you into the show notes. And thanks so much for coming on the show, Nolan.
Nolan Erck: 49:47 Thanks for having me.