The Modern .NET Show

Episode 76 - The Story of dotnet new3 With Sayed Hashimi

Embedded Player

Episode 76 - The Story of dotnet new3 With Sayed Hashimi
The .NET Core Podcast

Episode 76 - The Story of dotnet new3 With Sayed Hashimi

Supporting The Show

If this episode was interesting or useful to you, please consider supporting the show with one of the above options.

Episode Transcription

Hello everyone and welcome to THE .NET Core Podcast. A podcast where we reach into the core of the .NET technology stack and, with the help of the .NET community, present you with the information that you need in order to grok the many moving parts of one of the biggest cross-platform, multi-application frameworks on the planet.

I am your host, Jamie “GaProgMan” Taylor, and this is Episode 76 - dotnet new3 With Sayed Hashimi. In this episode Sayed shared the history of the dotnet new3 command. I’ll let Sayed go into it, but dotnet new3 is what you use when you create instances of the majority of the .NET templates for .NET Core, .NET Five, and above, and it has a really interesting story. Like, why is it called new3 for instance?

Sayed is a program manager at Microsoft, and works on the ASP .NET team, building tools for web developers.

So let’s sit back, open up a terminal, type in dotnet new podcast (there’s a story about that in this episode, too) and let the show begin.

The following is a machine transcription, as such there may be subtle errors. If you would like to help to fix this transcription, please see this GitHub repository

Jamie

So, thank you ever so much Sayed for being on the show, it’s a real pleasure to talk to you. Because I have to say, we were saying off air, just as we were setting up that I’ve used some of the tools that you’ve built almost on a daily basis. And I have to say, they’re a pleasure to use, I have to say, Thank you ever so much for that. And thank you ever so much to your team, or teams that have put those together.

Sayed

Yeah, definitely. Thanks a lot, you know, for having me on. And do it’s always nice to hear people appreciating the tools. And, you know, I’m just a small part of this, obviously, you know, but, you know, all the credit goes to the, to the, to the engineering team here, I just kind of put some ideas out there, and, you know, they make it, they take my ideas and make them much better, and then, you know, actually implement that and deliver the value, you know, so for me, I’m just kind of a very small part of this, you know?

Jamie

Well, I mean, how do I put every, I guess everyone’s a small part in in a machine somewhere. And without that, without that part, regardless of whether it’s a small part or a big part, the machine wouldn’t work, right. So we’re all important is what I’m trying to get at.

Sayed

Absolutely, absolutely.

Jamie

Yeah. Like, so my editor is my brother. And he, he used to say, to me that his previous role, I don’t feel like I’m important. And I said to him, you know, without you being there, the work wouldn’t get done. And the people further down the line, whatever it is you’re doing, wouldn’t be able to do the work they’re doing so everybody’s important, right?

Sayed

Yeah, you know, I think it’s easy for folks to kind of look at what they’re doing and then kind of marginalise it or or minimise that, you know, and, you know, even you know, I, you know, I suffer from that too, and lots of people that I work with suffer from that too. But, you know, it’s hard when you’re kind of working day in and day out in the weeds. And, but you know, there there, there’s those times, you know, at the conferences where, you know, we can we can see our kind of hard work, and we see, wow, it’s really kind of, we delivered a lot of really cool stuff, you know, and added a lot of user value here. So, I, you know, we do have those kind of good times, too, you know, but yeah, it’s very easy to kind of get into that mindset. And, you know, I tried to avoid that sort of mindset, too. But, but you know, it happens? I mean, that’s just the way life you know.

Jamie

Yeah, I guess, I guess you say, it is easy to feel that way. if, let’s say from a tech example, right: if all you’re doing today is making - I say “if all you’re doing,” I don’t want to try and you know, belittle anything that anyone’s working on - but if your task for today is great, and input form, and you feel like well, “all I’m doing” hopefully you can hear the bunny quote there, “all I’m doing is creating an HTML input form,” then you might feel like, “oh, maybe my skills or whatever, aren’t being used,” but you also, you’re going to be doing other things as well, you know, and if you’re tied down to what you’re what’s happening now, then, what’s happening right now isn’t the entire experience the entire geschtalt out of your, your abilities and skills, you know.

But we’ve talked for like, two or three minutes now, and I haven’t really introduced you properly, Sayed. So would you mind giving the folks who are listening a bit of an introduction to yourself, so like, what I’ve already said, you know, you’ve worked on these tools, and you’ve worked with these teams, but if they haven’t read the description, nobody’s gonna know what we’re talking about. Right?

Sayed

Yeah, sure, no problem. Yeah. So I’m a, I’m a programme manager at Microsoft Developer Tools division, been been working on this division for for like, 10 and a half years, essentially, I was a ASP dotnet developer before that. And, you know, the areas that I’ve always kind of worked on, you know, ASP dotnet, and one way or another, when I first started out at Microsoft, like, the first probably about six, seven years was was doing, you know, project system features, they call it project system, and you can kind of thing about project system is, you know, almost basically everything except for the editors for web experiences, right? So I worked on that and publishing was a big part of that and, and then after that, I was living in Seattle at the time, but then I had gotten married and I had one child at the time and, and, you know, I made a decision that I kind of moved back home to to Florida, because, you know, my parents needed a little bit more assistance. And, and my kids needed more room and my child, I guess, at the time needed more room to kind of run around. I have another another child since then a son. And, and the way that I was able to do that was you know, I actually had to switch teams. So I switched over to a team that was already remote and that was Visual Studio. For Max, I did the ASP dotnet features in Visual Studio for Mac for probably about two years. And then, and then an opportunity came back, an opportunity came up for me to go back to the web tools team in Visual Studio. So I went ahead and did that, too. That’s the area that I’m working on now. The things that I specifically own are kind of different from what I owned before. So now I own the the web editors, you know, the the HTML, the CSS, the JavaScript, the Jason etc. And then also I do I do still on publishing, or sorry, I do still own project system, minus any sort of publish or GitHub or Azure related stuff. So yeah, so those are, those are the areas that I’m working on. And, you know, when I was on the web tools team, before moving to Florida, in addition to the, to the web project system, I also did did own dotnet new. And, you know, I gave that up when I moved to being remote. And when I came back to web tools, you know, just kind of left it where it was. So now I don’t own dotnet new itself that’s in the good hands of Kathleen dollard. So she’s the kind of dotnet new owner and but, you know, we have lots of conversations, because I own the kind of new project experience in Visual Studio for ASP dotnet. So, you know, we’re constantly kind of collaborating on on the project creation experience. Yeah,

Jamie

that’s awesome. Yeah, I have to say there’s, there’s a whole bunch of stuff that you’ve been involved in that. Like I said, I use almost on a daily basis, I don’t use the Visual Studio for Mac so much, but that’s only because my Mac error is sitting off camera, and I’ve lost the power cable. Soon as I find the power cable again.

Sayed

back at it.

Jamie

That’s it. Okay. So that is that there’s a lot going on there. And I do remember, we talked offline, when we first sort of connected, I believe over Twitter, you were like, Hey, why don’t I tell you the story of dotnet? New? So I was wondering, could you give us a rundown of that. So I like I said, I know, I’ve done a new because I can open up a terminal, or a command prompt or PowerShell or Ws or whatever. and type in because I’ve got the tools installed dotnet space new, and it gives me a whole list of stuff. But that’s about as far as you know, you may not have even used that, right? Because some people are the weather I’ve always said is use the CLA if the CLA is picking new productive, use the user interface, if it’s making you productive, whichever.

Sayed

Yeah, that’s right. That’s right. You know, they’re there. There’s different types of developers that’s out there. And you know, this, the one, there’s no one kind of solution that will fit all developers there. And, and, you know, just like what you mentioned, you know, there there’s kind of command line oriented developers that, you know, they, they, they really care about the nitty gritty details, and they want to be an absolute control of everything, and you got that class of users. And then and then you have the the other users who are just, Hey, you know, I just want to be productive, I want to finish my goal, and I want to complete my task. So there’s those two kind of, you know, opposing viewpoints. And, you know, our challenge is to deliver value to both of those kind of user bases, they’re basically right to. So that’s, that, that’s sometimes pretty challenging to do, because they’re, they’re drastically different, and they have drastically different kind of wants and needs there. But, but, you know, I think we’re moving in the right direction here. And let’s say with respect to the kind of history of dotnet, new, you know, it’s, it’s really kind of goes far back actually, you know, and I was thinking about this the past couple days to you know, I knew that it would be here for this podcast, so, you know, kind of reflected back on this and, you know, this actually, the, this actually first started several, several years ago, my involvement in in templates, basically, and, and I remember the moment and I remember the the time where, you know, I first kind of got turned on to templates and realised how how difficult this problem was, so it was that the so I live in Jacksonville, Florida, currently, right, but but this story goes back to when I was living in Seattle. But I was back in Jacksonville at the time, for it was, I believe, the first code on the beach conference that was there that they ever had, right? So I was there. And during like one of the breaks or the lunchtime or whatever it was, I was chatting with Rob Eisenberg. And he knew the viewers might be familiar with his name from like Australia and a bunch of other kind of cool stuff that he’s done. But anyways, Rob, at the time was telling me he goes, man, you know, it’s just an incredible nightmare to create and maintain templates for Visual Studio and, and, you know, I had no idea about how hard it was to actually maintain the Visual Studio templates at the time. So he, you know, he kind of told me a little bit about that. And then, you know, and then I went back and tried it out and and realise, wow, this is just a giant pain in the neck basically. And, and then and then I asked myself, I said, Well, you know, if he’s having such a hard time, how is it that we’re able to do this? You know, at the ASP. NET team, because we had a, we had a bunch of templates back then. And, you know, we still got a bunch of templates now. And, and what I, what I learned from that was, we basically had one developer who, you know, and I’m almost embarrassed to say this, you know, we had one developer that he would spend three quarters of his time just maintaining the templates. And let me tell you, and this guy, his name is Phil Henning. And, you know, he works with me to this day, and he works on the the ASP. NET templates now. And let me tell you what, dude, if you were to talk to Phil Hanning, like six, seven years back, like when he was working, man, you were like, Dude, this guy’s just totally depressed. Because he was just maintaining templates, you know, three quarters of his time, right? And, and, but now, if you look at him, dude, you know, templates is just a small part of what he’s doing. And the guy’s so excited, and he’s got so much energy, and it’s just a totally different. It’s just a totally different thing from him. So yeah, so basically, I found out that, you know, maintaining these templates is just incredibly problematic.

So then what happened was, you know, one of my good friends is Mads Christiansen, and he used to be on the web tools team now, but you know, he’s kind of focusing on some other stuff now. So he’s moved on from that team. But you know, we’re still very good friends, we talk all the time. So I was chatting with Mads and you know, Matt says, hey, let’s create some sort of an extension to simplify this. So then what we did was we created what we call the sidewall full and sidewall full was kind of two things it was, it was a distribution pack of templates that the community had authored. But then on top of that, it was essentially like, some, some kind of build extensions there. And you know, I have a kind of a deep background with with him as build too. So I kind of automated the process of creating an extension there with sidewall. But what I realised but you know, sidewall full kind of sits on top of the technology that Visual Studio has for templates, and you know, I call that vs template. And, you know, even what sidewall full, you know, you could, you could have an experience where you kind of develop your template, and then you could do like a Ctrl, f5, and test it, but, but at the end of the day, you were still building on top of that vs template technology, that was really the crux of the issue. So then, even after sidewalk four was done, we realised, hey, this is great. We made it a little bit easier. But you know, for template authors, they’re still a huge burden of maintenance here. So yeah, so that was the that was kind of one kind of input, right. And then I was working with a developer, his name is Mike lor, bet ski. And unfortunately, he’s not at Microsoft anymore. He also kind of moved back home, and took a different gig there. But man, Mike libecki is really great. I really love Michael or Betsy, he’s one of the most passionate developers I’ve ever worked with. And he’s really great about making things perform well. But anyways, so we were chatting with Mike libecki, and coming up with some ideas, and we created some side projects, too. And, and so that was that. And then what happened was, you know, like, right when, right when ASP dotnet core was, was picking up and, and I’m not even sure what the name of it was back then. But I’m pretty sure it was an ASP, dotnet core, I think it was project K. So you know, we we call that project K and, and then we realised we say, Hey, we need a, we need to, we need a way to create templates, cross platform, because you know, a speedo nine is going to be cross platform for the first time. And, and at that time, I might get hooked up with an intern, I was like an intern manager. And, and the intern that came over was Saurabh. And he’s actually a pm on the ASP. NET team now. And we were just chatting. And, you know, we came up with the idea of creating a command line experience for for you know, mostly for for Mac developers, but it would work cross platform for creating templates. And and there’s there was there’s there was already a very kind of popular templating system for web developers known as Yeoman. So we created some we created a Yeoman plugin. I forget what the Yeoman generators what they call it. So we created a Yeoman generator for for project k for ASP dotnet. And then man that got like, lots of usage. We were like getting to the top of the the list of Yeoman generators. We were in the top 10 for sure. I forget the specific number, but man, it was, wow, it was lots of people use it. I was really shocked actually. And then as and then as kind of ASP. dotnet core kind of progressed. Then you said, Hey, well, you know, it doesn’t make sense to do so Yeoman was humans built on top of like node and NPM. So we’re like, you know, it doesn’t make sense to ask dotnet developers to instal node to create their project. So we need something that’s kind of built into dotnet itself. And then the the way that that first kind of started out was, uh, you know, I wasn’t even involved in the very kind of first dotnet new and you know, even when I actually kind of find out found out about it by surprise, basically. So, at that time, it was very kind of early days of the SDK. And, and, and all the commands, they were like, I’m not, they were like, almost kind of essentially hard coded in and make me we’re not really hard coded, but you know, they had to be contained in like, a specific assembly basically. Right. So, and then at that point, when you did dotnet, new, there was very basic, there was a very minimal kind of options, you know, you could create a console project, and, and it wasn’t even, it wasn’t even like parameterize, you know, you would say, dotnet, new console, and it would spit out the exact same files every time. And I think there was a web one there, too. And it was, it would spit out the exact same files as well. And then, you know, that kind of, you know, worked for for a little bit, you know, like the first one or two previews maybe and, and then, you know, that’s when I kind of got wind of it. And then Damien Edwards was working on a proposal for templates. And,

and at this time, you know, you couldn’t create a command that had the same name, as a command that was already built in, because the built in command would take precedence, right? And Damien was working on a prototype, and he called it dotnet, new two. And then that was his prototype. And, you know, he had some ideas, basically. And, and then me and Mike, me and Mike libecki, we got involved, and we said, Hey, dude, oh, so let me let me kind of lay the framework for this, right, too. When you look at Visual Studio for, for, for managed, kind of coat managed development, you know, when you look at that, you know, the, the team that has, you know, a lot of investment in templates is really ASP dotnet. So, you know, I told Mike, I said, Hey, we’re already, we’re already heavily invested in templates. And, you know, between the two of us, we have a lot of experience with templates, too, because, you know, by this time, we created like, three or four different side projects, trying to address templates, there was sidewall fall, there was like pecan waffle, there was like, dotnet waffle. And then we said, you know, let’s just, let’s just make, let’s just put together a really good proposal. And then what we should try and do is we should actually just try and take ownership of this whole thing that we can run it ourselves. And then we put together this like this, like, really good proposal, and there was like a GitHub thread that was going on at the time. And, and it was, it was owned by somebody else who’s not at Microsoft anymore. We called him z. So he kind of owned it. And you know, we and then I made this like GitHub comment and say, Hey, here’s my ideas for templates. And, you know, this is the way that it should be. And then, and then Mike created a prototype, and it was called dotnet. New three. So that’s how we got the name of dotnet, new three. And then, and then we just kind of worked it through, you know, we said, Hey, dude, this is what we got. And, you know, we’re way ahead of what you guys are doing and what you guys are even thinking we’re just going far beyond. So you know, we really need to own this ourselves. So we can build it and run it. And and then, you know, we were able to convince people to go ahead and give it to us. So yeah, so we took over it. And man, and it was me and Michael Urbanski dude. And man, he would come up with some crazy ideas, and he would just go on implemented at like, three or four o’clock in the morning, you know, I’m pretty sure Mike libecki just doesn’t sleep at all. And then so yeah, that’s kind of how it started. And then, you know, I think I think we have a pretty good model here. Because, you know, every other every other template system that I’ve ever worked with requires you to change your source code in a way that it won’t build any more. So what I mean by that is, let’s, let’s take like vs template, for example, right? Let’s say if I’ve got like a programme.cs, I’m going to have to modify the namespace declaration in a way to where won’t build anymore, right? Like, I think they’re like percent signs or dollar signs or something, but it’d be like percent root namespace percent, or dollar sign, I’m not sure I just don’t remember. But anyways, you know, that’s never gonna build. And then the, the fundamental problem with templates is, you know, you’ve got your source code, and then you’ve got your template. And if those two things differ, every time you build a new version of it, you’re going to have to go through and do some sort of manual modifications to that, right. And that is just really a nightmare. And, you know, imagine, you’ve got it you’ve got, you know, let’s say, if you’ve got five or six templates, that becomes a management nightmare. Right? So it’s really incredible. So with the template engine, and you know, for those who don’t know, the template engine is the library that that dotnet new sits on top of and, and Visual Studio also calls into the template engine and the same for Visual Studio for Mac and there’s also some third party IDs that also kind of call into the template engine there. So yeah, the the model that the template engine uses, we kind of flip it on its head, we say, hey, instead of, instead of modifying your code to indicate where the replacements are, you’re gonna go and indicate these replacements on a different file. That’s called template dot Jason. Right. So let’s say if you had a, you, let’s say, if you had a project that was called cool web, yeah, we kind of flip it on its head, you know. And then inside the the template die, Jason file is where you would basically indicates a Hey, and I want cool web to be replaced with whatever the project name is that the user has provided for me. So that’s kind of the model that we use. But But you know, it’s, it’s actually a lot trickier than what I thought because let’s say let’s say if you have that string, cool web and let’s say, the CS capitalised, then maybe maybe there is maybe it’s actually cool dot web. So what happens is, you know, when you, when you do a replacement for that, and a C sharp class, you have certain restrictions or certain characters that you can’t use, right, so let’s say if the user gave the name as like my space web, right, we would have to know that in a C sharp class, we would have to use an underscore for that. But in other and other file types, they may have different forms that they could use, right? Like, for example, there are certain files that everything has to be lowercase. And there are certain files that you know, the separator is not an underscore, maybe it’s a dot

Suba. But you know, I wasn’t smart enough to figure that out. But Mike, but fortunately, Mike lubezki was smart enough to think about that. And he said, Hey, you know, when we get a string, there’s different possible transformations that it needs to go through. So we need to take that into account. So the template engine already has that. So if there are certain restrictions of you know, how a string gets transformed, the template engine will figure that out, basically. So that’s pretty interesting. And, and we also did the same, you know, kind of for optional content, you know, what we did was we said, Hey, for C sharp, you know, we’ll use the the C sharp preprocessor syntax, that way, what you can do is you can always test your template, you know, like, let’s say, if you’ve got it in a preprocessor block, that’s if you can, you can set that value, and then you can run it, and then you’ll you’ll test that part, and then you can go and set a different value and test it. So yeah, so I think that’s kind of the the history of, of how we came to dotnet. New and, and let me also kind of clarify, you know, for those who are not familiar with dotnet, new three, what happens is, you know, the template engine is, you know, it’s open source and, and if you pull down that GitHub repository, and you build it, you’ll get a new command, and that, in that command prompt session that’s done that new three, so you know, if you do dotnet, new, you’ll be running off, you know, whatever version of the SDK that you have installed. But if you do dotnet, new three, then that will be working off the version that you just built there, basically. And so that was kind of the history of dotnet, new three, and then we just kind of left it as dotnet, new three, that way, we can keep doing the side by side, and we don’t have to worry about conflict, and what version of dotnet new Am I using here? So yeah, that’s that’s kind of how we got to it. And, you know, templates, you know, I’ve been working on templates for a long time. And, you know, there’s kind of two spaces and tooling that, that I could say that I really love, you know, and I think publishing is one of those that was that was probably my, my original kind of love, I think was was publishing. But, you know, I think templates is, is the kind of the, the next one after that, you know, and man, I really love the the space of templates, and, and I had no idea how, how complicated it was to create and maintain these templates, you know, but, you know, I think now we’ve come with a pretty good solution, you know, obviously, you know, it can be improved and simplified. But you know, I think it’s much better for the community. You know, for example, AWS has a has a template pack, and I think there’s more than 20 templates inside that template pack. And I can tell you with certainty, they would never have done that, with the existing technology that was there. And even even I heard other horror stories, too, you know, like Nancy effects, that was a pretty popular web framework in the past that was, you know, open source. And so the story of Nancy was, you know, they, they develop their C sharp templates, and then a community member, contributed the VB version of it. But then when NC FX got updated, it was so hard to update the templates that they they had to abandon the VB part of it, you know, and then they just, they just went with the C sharp part of it. But you know, I’m pretty confident that, you know, if, if a framework owner gets in that situation with dotnet new I’m pretty sure they would continue on because all you have to do is create a project. You don’t have to it’s way easier maintenance. I mean, so yeah, you know, I think we’ve I think we’ve come with something really great here for the community, you know. Yeah, I

Jamie

think um, I think you kind of hit the nail on I had though when you were saying that, in the previous iteration, the Visual Studio templates, you had to make it so that we wouldn’t run it, you can’t compile your template anymore. Whereas in the past when I’ve created templates for the for the Donate new templating engine for donate the three, it is quite literally, I mean, you said that they you get to the point where your code is working with where your code is working, you create a template or JSON. And this template, there’s hardly any work there. Yeah, that’s right. That’s right. And, you know, I’ve seen it at a previous employer, we had a specific sort of template dotnet stack that we would use. And one of the developers went away and spent two or three days building a winforms app, where you would, you’d fire up the winforms app, and you type in a bunch of stuff into some input fields, maybe like the name of the project, or the name of the client or something like that, you’d hit go, and then walk away for two minutes and come back, because what would happen was, it was running a regex, on a project that already existed and running through every single file, and then to sort of rename namespaces and set values, and then he would then compile it to make sure it worked. And if it failed, he would say sorry, that didn’t work. Try again. Whereas now I literally would do dotnet, new name of the project, and then maybe pass some parameters in for base namespace, or maybe I’m using tailwind? Is that a bootstrap? Or maybe I want to include jQuery and fontawesome. And they just include a bunch of parameters. And within a second, it’s there.

Sayed

Yeah, that’s right. So yeah, I’ll tell you something that I found was really kind of interesting. You know, I already kind of said, you know, Michael Urbanski man, he would create some super performant code. And the first version of dotnet, new that went out, me and Mike, we compare the time that it took to let’s say, if he had a folder that was called, you know, foo, so we would, we would create a template out of that, and then we would run it through dotnet. New to see how long it would take to to instantiate that template into a different folder. Right? And then we compare that and then we took that, and we compare to say, hey, if I just copied the Foo folder, and Windows Explorer to another place, how long does that take? And dotnet new actually was faster than that. And then it was doing all the processing and all that sort of stuff, too. And, and, you know, in Mikey, really, he really just he hates read regular expressions, you know, so he avoided any sort of regular expression usage there. And, and man, he made it super fast. And you know, I think to this day, it’s actually very performant. But, you know, we’ve added a lot of additional features since then. So it’s probably not at the same kind of performance as what it was before. But, but wow, I think it’s still really fast. You know, I think you could, you could create a template with 1000 files, and your experience would still be pretty good using that on the command line, I

Jamie

think, yep. Oh, absolutely. Absolutely. And like I say, you know, I, I mentioned in the intro to the show, you know, I say, sit back, open up a terminal type in dotnet new podcast. And that’s an open source template I have for the show notes. And you can go to GitHub, and pull that that template down, if you really wanted to, is in the old old template format, I know that there’s a bunch of changes that have happened. Because this was like dotnet, core 1.0 when I made it, or maybe 1.1. And you can still pull that template and still instal it and still do dotnet new podcast, and it will create the show notes for you. I do have another one that I’ve created for Rome scaffolded, a, an audition project for editing the show. And I could do dotnet new edit podcast, and all the files are there. Because Why not? Because, you know, we were talking OFF AIR about you can do it in with any, almost any sort of file format you wanted, primarily is for text based files, right for source code. But yeah, I just all I did was I took a pre existing bunch of files, because audition just uses XML, right? So take that through a template or JSON and tell dotnet This is a project and the project is massive. But it’s like to 200 or 300 megabytes, because there’s a bunch of like audio clips in there as well. But when you hit done in dotnet, new audio, it just there it is.

Sayed

Yeah, right. Exactly. So so I think. Yeah, yeah. So a couple comments on that, you know, I think it’s, it’s really kind of great what people are doing with, with with the template engine and, and tools and platforms and frameworks in general. And you know, I’m always kind of surprised the kind of cool innovative things that people come up with. So that was one and then to the Oh, yeah, that’s right. That’s right. That’s right. Yeah. So you mentioned you know, that these are kind of mostly markdown files. So yeah, the template engine is kind of agnostic to the file type. It doesn’t really matter what type of file it is. We can go through and process that. For certain languages, you know, it kind of mentioned about the the transformations and and limitations to syntax. So let’s, let’s say, if you were dealing with a different type of file, you might need to author something, Jason that tells the template engine, you know, what are what are the requirements for tokens that appear in this file. And then from there, the template engine will know how to transform those. So, you know, if you were to go and look at the template engine repository, you would see, you would see Jason definitions for let’s say, C sharp files, or CSS files, JS files, you know, so on and so forth. But But let’s say if there’s a language out there that somebody has created, and, you know, let’s, let’s say it’s called foo, and if you want to get, you know, first class support from that, from the template engine, you would basically go through and create that Jason file. And, and there’s a way to just put that inside your template as well. But you could also even contribute it back to the template engine itself, and then they would consider bringing that in. But But yeah, you know, there, there is no limitation for files here. And we built everything in a very kind of generic fashion. And then, and then I’m pretty sure we can process and modify binary files, in addition to text files. And note, that was something that Mike did, but I’m not sure if that’s ever been tested or not. But I believe it does have that capability. But yeah, it’s it’s really incredible man, really incredible. And, you know, the community, man, they surprised me every day with the kind of cool stuff that they come up with, man, it’s just really wild. You know, like, you know, when we were building template engine, you know, I never kind of envisioned somebody would use it for a dotnet new podcast that was kind of pulling over, you know, audio and video files, and markdown and all that kind of stuff. But you know, that’s, that’s the cool part about creating, you know, kind of more generic tools is, you’re gonna get surprised by the cool stuff people create.

Jamie

That’s it. That’s it, you know. And that was just, you know, I’m sitting around thinking, I want to build something with the template engine, what is something that I’m doing constantly? Oh, wait, I’m copying these files to a new folder, then manually editing a bunch, wait a minute, I can do that. I’m sure I can figure out how to do that. And, lo and behold, it’s through a template dot JSON file in there, do a little bit of wiring up, go into the command line, create a new get package for it. I mean, I self host that nougat package, but even so then dotnet new instal, and it’s there. And then what I’ve actually done is my editor is not a developer, I’ve just gone here is the template when if you want to do a new one, just do dotnet new podcast, and we’ll just be there, right? He’s not a developer, but he knows, I go into the command line and type this in, because it’s faster, like I said, then him going, right, I’ll copy the pre existing template over. Now I’m going to change it, he just makes just makes sense. Right?

Sayed

Yeah. And there’s all sorts of opportunity for human error in there, you know, especially with repetitive tasks, you know, mean, if you’re doing the same thing every week or every day, you know, at some point, you’re gonna make some sort of mistake there for sure. is, there’s no doubt, you know, so yeah, I mean, you want to simplify all that as much as you can.

Jamie

Absolutely. And I mean, that’s, that’s kind of why we do, you know, like, we talked about ci, CD, DevOps II things, because it is so easy to accidentally push the wrong button and push the wrong guy, like, I still remember, right, click Publish to zip file, copy up to an FTP server, and then do it from there. And that was so fraught with danger.

Sayed

Yeah, that’s right. That’s right. Was that an MS deploy package at the zip file that you were creating there?

Jamie

Oh, this this, I mean, this was back in amateur hour day. So this was a project published to zip file, manually, right, click publish, and then open up an FTP drag and drop, share, then take a backup of the previous one. spot, the new one over the top. Hopefully, those are the bad old days, hopefully, if there’s people out there doing that, I’m not gonna try and poopoo on what you’re doing. I’m just saying, Please may be investigating some tools that can do that for you.

Sayed

Yeah, that’s right. Yeah, you know, they’re there. There are people that still do stuff like that. And, and, and, you know, there’s, there’s also definitely people who just kind of publish directly to their production website from Visual Studio, but, you know, you know, my philosophy is, you know, I, you know, it’s my job to to help users achieve their goals. And, and, and also try to steer them in the right direction. But, you know, at that same time, you know, if somebody doesn’t want to go in that direction, you know, it’s my job to try to support them. But you know, I don’t on publishing anymore, but, but I’ll tell you that publishing from Visual Studio to a remote website is a very common operation. And, you know, there’s a certain class of people who believe that nobody does that or that nobody should do that. But, you know, at the end of the day, people that they got there From priorities, and there are different concerns, and, you know, maybe see maybe like an automated publisher is not for them. But, you know, obviously, you know, we try to encourage that, but, but a whatever it is, man, you know, I mean, that’s, that’s how it is, you know if, like, let’s say if somebody buys a steak knife and they want to, you know, cut other things with it besides steaks, you know, a, it’s, it’s, that’s, that’s, that’s what they want to do they have every right to do it, you know,

Jamie

I feel like it loops slightly back around to what I said about earlier on about if you want to use the command line, and you feel more productive with it, please do that. But if you want to use an app and a wizard, and wiziwig, then please do that too. You know, if you’re, if you’re more productive, like you say, if the end goal is ship this to the server now. And don’t worry about if it doesn’t work, because we have some other system, then right click Publish to a server makes total sense. And he gets the job done instantly. Whereas if you have a slightly like you, say you have an Azure DevOps pipeline, you then have to commit the code, you’ve got to wait for the build, you’ve got to wait to to promote, then you got to wait again to promote that, again, to presumably you have multiple staging servers, whereas all you wanted to do was right click publish, regardless of whether you and heck on the bungee cords should? because like you said, in some instances, maybe you should. And some instances, maybe you shouldn’t. But if your goal is right, click publish, then having a right click Publish solves that problem.

Sayed

That’s right. That’s right. Yeah, I mean, we have to we got to meet the users where they’re at, you know, we can’t, you know, I think, you know, Microsoft, in the past has tried to try to force people down certain paths. And I think we figured out, hey, this is not the right approach, you know, we should meet them where they’re at, but at the same time, offer additional paths to best practices are what we consider best practices. Right. You know, and, and, and, and, and I think that’s the right way to do things, you know, if if you have some sort of immediate need, let’s try to solve that need. But then let’s also see, you know, is there is there, is there a better way to meet this need to? And if so, let’s provide that possibility as well. But you know, we shouldn’t force users down certain paths, you know, it’s just not a good, it doesn’t work well, for Microsoft, doing things like that, I think.

Jamie

I mean, that makes sense. If you make it easy to fall into the pit of success, whatever success means, in that instance. And more people are likely to use the tools, which means more people are likely to use the language and likely to do whatever it is that they’re doing. If it’s easier to fall into the pit of success. I’m going to go down that path. But if it’s easier to fall into a pit of failure, I want to avoid that path as much as I can, right. Yeah, there is I don’t want to fail all the time. I want to succeed as easily as possible. And if right, click publish, if dotnet new, then if that helps me to achieve those all file new inside of Visual Studio and get a wiziwig. Then Yeah, fantastic. If that helps me to solve that problem. Well, let’s do it.

Sayed

Yeah, that’s right. That’s right, dude. Yeah, I think we’re kind of on the same page with that, you know?

Jamie

I think so. Yeah. Excellent. Well, what I’ll say, say it, I know that you have, you have a limited amount of time today, you’re a very busy person. And we’re unfortunately running out of time. So I was wondering, I’ve already got some links formed from you for the show notes. And some links that I’ve sort of found, and you’ve sort of added to so thank you very much for that. But I was wondering, where can people go to find out a little bit more maybe, about you, and maybe about the work that you’re doing and things like that? Is this and where people can go? Do you have any recommended resources? I know of obviously, things like Channel Nine and stuff. But is, is that the best place? I’m not sure.

Sayed

I think I think you know, the, let’s say, for people who are interested to try to follow up with what I’ve got going on, probably Twitter is the right place. And you know, I’ve seen that you’ve got the link there for that. And then for folks who are interested in learning more about templates, I think, I think the good I think a good place to start off is, is the aka.ms slash NET Core dash templates. And I see you’ve got that in your notes as well. So that will that will take users to a GitHub repository there. And, and there’s links to how to create a template. But then there’s also a lot of content as to, you know, hey, here’s best practices for altering templates. And also, including, you know, what’s one thing we didn’t talk about is, you know, if you create a template with dotnet, new that it can also start showing up in Visual Studio and that that same thing will happen for Visual Studio for Mac too. So there’s a lot of content over there that says, you know, what, what all what all additions Do you need to make to your template to have a great experience in Visual Studio, right? Like how do I get an icon there and how do I get parameters to show up in Visual Studio so I’ve got all that content there. And and there’s also we like within the past couple months, we recorded, I think it was six or seven videos on dotnet new and it started from you know how to use dotnet. New to how to create templates and how to add parameters and how to troubleshoot those templates. So I think that that playlist or the list of videos is really great for for template authors and and you know if anybody has questions about, you know, how do I do this with templates? Or how do I do that with templates? You know, one area that you can do the you can ask that question is on GitHub, it’s github.com slash dotnet slash templating. You can you can file an issue over there. Or you could reach out to myself and or Kathleen dollard, on Twitter, and we’ll try to direct you to the right place as well. So yeah, so I think that’s, that’s kind of a good way to kind of keep up with everything that’s happening there. And, and, and also, in the show notes, I left a link for a website that I created, that will enable users to to find existing templates that are out there, and, and we’re still working on, you know, what’s going to be the story of how to users search for templates at the command line and, and also working on the experience of how our users going to search and instal templates directly in Visual Studio, but we’re not quite there yet. So yeah, so so that I think that’s really cool, too, you know, this is, you know, we created a we created a system where, you know, you can have a template, and then it can, it can show up in multiple different areas, right, like the command line with dotnet, new or Visual Studio on Windows or Visual Studio for Mac. And then and then also those third party IDs and editors that have support for done, you know, it’s a first class integration, you know, if you look at a, when you’re using Visual Studio, if you create an ASP. NET Core project, you know, that’s using the template engine. But but the majority of the other templates, use vs. template and you know, to user, they can’t tell the difference between one or another. I think we’ve done that in a really kind of first class and a really kind of great way for that. Yeah. Awesome. Yeah,

Jamie

I have to agree. It’s, it’s wonderful to use the the template engine, dollar news recurs. It is seamless in like I said, like you said, you’re in Visual Studio File, New Project, it’s, you’re in the command line. dotnet. New, it’s there. You can’t make it any easier than that. Right? That’s right. That’s where it’s at, man. Excellent. Excellent. Well, thank you so much for taking some time to talk to me today. I really appreciate it. And I think that the listeners are gonna get a lot out of this. Because I do know a lot of people who are dotnet folks using, say, dotnet, five, and they’re not sure about that they can even create a template from a working project. So maybe this will spur them on to go and create some new projects. And then maybe, let you and Kathleen know, hey, I’ve created a project to do like, I don’t know, 3d modelling or something? Who knows? Yeah, that’d

Sayed

be great. You know, I think for I think for those people who are kind of aspiring to create a template, I think those videos are good. So I think it’d be probably 20 to 25 minutes, and they will, they’ll know how to, you know, not only use dotnet new but also create a template from that. And then and then as they want their template to get more and more kind of more and more features. They can kind of watch a few more videos and and then kind of deep dive deeper even beyond those. Yeah.

Jamie

Excellent. Well, like I said, thank you so much say that it’s been an absolute pleasure.

Sayed

Thank you for having me. Same here.

The above is a machine transcription, as such there may be subtle errors. If you would like to help to fix this transcription, please see this GitHub repository

Wrapping Up

That was my interview with sayed Hashimi. Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at dotnetcore.show, and there will be a link directly to them in your podcatcher.

And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to dotnetcore.show/subscribe for ways to do that - and to come back next time for more .NET Core goodness.

I will see you again real soon. See you later folks.

Follow the show

You can find the show on any of these places