Skip to main content

From PHP to ASP.net - Tooling & Workflows

Probably the first thing to be remarked when coming from any environment to .net is going to be the tightly integrated tooling.

When I used to do PHP in the late 90s early 00s, it was pretty much whatever text editor I could get my hands on.  There were some non-free IDEs, but none that were easily obtained or as impressive as Visual Studio, which also wasn't free until around 2006.

Despite the differences though, Visual Studio has always been first class.  When the same people making the languages are also making the tools, you can expect a lot of extra convenience.  One thing that's kept my interest is that despite the tight coupling, most everything is still quite generalized, unlike 4GL environments like Delphi.
Contrast .net with PHP where all you get the language and are responsible for building your stack upwards from there.  Not that our favourite friends LAMP and LEPP aren't just as mature.  Things like PHPstorm have come along to give that first class feeling but it hasn't always been that way and not everyone in the PHP ecosystem affords themselves these conveniences.

So, that's the obvious tooling stuff out of the way.  The next thing that I think I notice right away is the state of the basic ASP.net MVC 5 project structure and APIs.  I know that ASP.net Core is coming and I'm excitedly staying up to date on everything to do with it.  But when I look at the still current gen scenarios, it's obvious to me what prompted the changes.

Something they've got in Visual Studio that not everyone would necessarily have expected to see is fully integrated support for node package dependencies, gulpfiles and other equivalents.  With Task Runner Explorer, you can even have Visual Studio hook certain build and project events all without having to get involved with MSBuild.  This is a great way to introduce Microsoft developers to the sometimes bewildering but all the same amazing universe of npm and static front end build flows.

That brings me to some of the standards of expectations that .net and Java developers have compared to PHP and other FOSS languages.  There are a lot of things about how front-end concerns are handled in .net projects that feel very circa 2010.  I think this is one space where even despite not being a front end developer, I can see that the FOSS ecosystems are considerably more advanced.  This is something I find odd because .net developers wrangle with some extremely complex designs sometimes and yet tooling outside of what ships with defaults is rarely explored!

Another thing - which thanks to Roslyn is changing - is how you have to compile your project prior to being able to run it.  Out of everything, I'd say this has added a measurable amount of time to my development flow.  It makes sense obviously, but it's just so foreign to have to explicitly tell my tooling to build my web site before I can go to the browser and refresh the page, or re-trigger the XHR.  Looking forward to ASP.net Core which in so many ways will close the gap there.

Next up worth covering is the tight integration with the web serving environment IIS and database, SQL server.  By default everything comes ready to run with both.  You're always a quick configuration change away from telling your application to run in IIS.  I also really like how there's a first-class IDE specifically made for SQL server.

Last but not least, it has to be said: Strong typing, generics, a proper collections library and LINQ.  If I had to make a list of absolutely essential functionality in a language, these would rate quite high.  I'd say if there's anything that's got me just loving the environment, it's these.

Anyway, that's it for this lighthearted entry.  Like all my posts in this series, if something really interesting comes up, I'll come back and edit it into this post.  At least up until a certain point!

Comments

Popular posts from this blog

Laravel Project Architecture: The Missing Guide

At my job, we've been doing a lot of learning and development using Taylor Otwell 's Laravel 4 PHP framework.  As we've become more familiar with it, we've had to come up with better ways to structure our projects outside of what the documentation indicates and the default distribution that is provided. If you've been working with Laravel 4 for any amount of time or come with experience from another framework and are just getting started, you've probably noticed that there are a lot of different ways to cut up your projects. Choice is nice, but sometimes it can be paralysing or misleading. Concrete Advice This post is done in such a way that you can just skim the headings, but if you want a detailed explanation in each section, feel free to read in where necessary. While I can't say the entirety of my advice is in practice throughout the community, I can say that we are starting to use it, and to very good effect at my job.  Especially consider...

Building .NET Core Nuget Packages

My last blog post was on building and publishing npm packages, specifically for typescript projects. In my opinion, packages are an important fundamental unit in software development. They sit at the confluence of technical competence and collaboration, and represent something the software community should be proud of. Most of the time, you're going to be creating software packages once you're comfortable with some essential pillars: Coding Project structure Software architecture Building Delivery Community Licensing After I got my npm package up and running, my next task was to do the same thing with my C# libraries. Similar to protoculture, I have made a library called praxis .  This is done by leveraging the services and tooling known in the .NET ecosystem as nuget. In this case, praxis abstracts many of the concepts and functionality I require when producing server projects. It builds on top of ASP.NET Core, so in that sense you can almost think of it as ...

Laravel is Good, Facades Aren't

I've been working on some Laravel 4 based packages lately which inevitably results in me also looking at other packages. I've noticed sometimes that people use facades at times that give me pause. The most troubling being from inside their model classes. A quick google turned up this video which assures people "there's still an instance behind everything, we're fine" .  Everything mentioned in the video is true except that there is a very glaring omission. Scope What usually goes out the door at the start of a long series of mishaps in software design is scope . When the desire to obtain a solution is stronger than the desire to consider the implications of a firm approach, mistakes are sure to follow.  Sacrifices like this are made due to the assumption of a high cost to developing carefully. What really is happening however is a false dilemma , being responded to with a convenience decision . It's very easy to write model code like ...