0

In a Microsoft ecosystem (i.e. WebForms/MVC/WebAPI VisualStudio projects) why should I rely on an external task runner for JavaScript files like Grunt if I already have MSBuild at my disposal as the default building/task running system?

When I first saw grunt in action I wondered why it was even being used, as it seemed to me that I could do what it was doing by relying directly on MSBuild tasks. I usually favor centralized tools for doing the same type of job, and I assume both MSBuild and Grunt are doing basically similar types of actions: running tasks against/using files as input. All the javascript files for these web projects are already referenced in the csproj anyway, so they are automatically part of the build process. Using MSBuild to process them seems much more natural to me than injecting a new framework in the middle to do that.

I believe that using another framework to perform the same type of work you already do with an existing framework is a bad decision since it adds new unnecessary dependencies that have to be learned/mastered by the team. Additionally, we all know that more moving parts equals more chances for stuff to fail in general. I also argue that MSBuild already integrates nicely with Visual Studio, while grunt requires extensions or manual command line work to run.

Is there a specific reason why MSBuild was not leveraged for the kind of work Grunt does nowadays?

I understand they are completely different ecosystems and would totally understand someone using Grunt on a non-Microsoft open source type of project, but it doesn't make sense to me that it has become a standard for .Net applications seeing that we already have a tool to do just the types of tasks it does.

Don't get me wrong, I understand the "there are many plugins available" argument, but that to me is similar to saying we should all stop using TFSBuild and migrate to Jenkins because it has more plugins readily available. It is a valid argument, but not so much as to completely dismiss TFSBuild's strengths in some situations.

julealgon
  • 277
  • 1
  • 9
  • Well, is MSBuild has everything you need ? JS minificaiton ? HTML minification ? Livereload server ? you may consider some of them are not needed for you it's up to you. The basic thing is that if you don't need to move on and have something working with technologies you master, don't move. – Walfrat Dec 29 '16 at 21:14
  • @Walfrat I don't even know if MSBuild does have all of those tasks (I know some of them do exist), but they could be created. My point is that folks are moving to Grunt because it processes "JavaScript files" but MSBuild can do that too with no apparent problems. Why have a separate task runner? – julealgon Dec 29 '16 at 21:21
  • Because it already exists, and why reinvent the wheel? – Robert Harvey Dec 29 '16 at 21:26
  • @RobertHarvey not sure what you mean there. Isn't MSBuild much older than Grunt? Grunt is the one reinventing the wheel then right? – julealgon Dec 29 '16 at 21:34
  • @RobertHarvey because it might not be enough to justify to add a new set of technologies and it seems it's possible it already exists in MSBuild – Walfrat Dec 29 '16 at 21:34
  • 1
    @julealgon don't forget, there are lot of folks that just move to new things because of the "hype". If MSBuild is enough for you and work, don't change it. If you search on workplace.SE you can find a lot of questions about "I'm coming from school and I want to change all the technos to get the flashy new one and seniors don't want" – Walfrat Dec 29 '16 at 21:38
  • 1
    Comparing Grunt to MSBuild is like comparing Java to MS Visual C++. Voting to close, since language comparisons are off-topic on this site. – Doc Brown Dec 29 '16 at 22:08
  • @DocBrown I disagree slightly because my question can be reduced to "why move away from a standard tool X in favor of external tool Y?" (notice that it has the "standard Microsoft environment" restriction), but I appreciate the feedback. In case it is confirmed to be offtopic, do you have any suggestions of a more appropriate stackexchange forum where the question could be moved to? – julealgon Dec 29 '16 at 23:44
  • 1
    @julealgon: Tool comparisons are off-topic for this site as well. I am afraid for this type of questions there is probably no SE site. You can try on quora instead. – Doc Brown Dec 30 '16 at 08:51
  • @DocBrown I see, i saw a few very similar questions on softwareengeneering and thought this one would qualify as valid question. I'll take a look at Quora for sure, thanks for the suggestion ;) – julealgon Dec 30 '16 at 21:21

1 Answers1

1

Here are the advantages:

  • The error messaging is generally more specific
  • The stack traces are more readable
  • The turnaround time for supporting new JavaScript specifications is usually faster

References

Paul Sweatte
  • 382
  • 2
  • 15