My Essential .NET, C#, VB.NET, and Web Dev Tools and Frameworks

Here is my (mostly) comprehensive list of tools I use for development, either at home or work.  It’s like Scott Hanselman’s, but focused almost purely on development, with a couple of extras.  While you’re at it, go check his out.  All opinions are my own and are not bought or sold.

The Main Stuff

Visual Studio – king of IDEs and the essential tool for .NET devs everywhere. Not much else to say except that it has a great starting toolset for any developer and amazing plugin support.  The Community edition gives the masses the power of the Professional SKU, for free.  Simply amazing and getting better with every release.

Visual Studio Code – Microsoft's cross-platform IDE has taken the lightweight-yet-extensible text editor world by storm. I use this on my Mac for developing ASP.NET Core apps, writing Markdown files, and just editing plain text files. Has almost totally replaced my use of Notepad++. The plugin system and rapid development turnaround is going to threaten the paid alternatives in a big way (Sublime, I'm looking at you).

Node Package Manager - best tool for installing your command-line dev tools and front-end frameworks. I use it in conjunction with Visual Studio and Visual Studio Code to do development across several stacks, including WebForms apps that I support.

SQL Server Management Studio – it ranges from a useful IDE for SQL to a huge time saver for things like table creation and script generation.  The DROP and CREATE tools are awesome for generating scripts for tables, stored procs and more.

LINQPad – the best .NET code scratchpad on the market. It's not just for writing LINQ queries - it's   It’s not a complete replacement for SQL Management Studio, but for complex queries with lots of data, it’s my first choice.  The Premium edition is a steal and makes this essential tool 5 times more useful with C# autocomplete, NuGet, cross-database query support, and debugging.

NimbleText – thanks to Scott Hanselman, I have found this program – and my new favorite way to write repetitive code or handle small or large data transformation tasks.  I’ve used it from everything from writing HTML to generating SQL insert scripts.  Its time-saving power cannot be overstated.  And, it’s FREE!

Fiddler – the essential tool for viewing and diagnosing HTTP requests that are happening on your machine.  Turn on SSL decryption and see previously-unknown HTTPS requests decrypted before your eyes.  Use it to view incoming and outgoing HTTP requests in real time.  Turn it into a proxy and send a device’s HTTP requests through it to test devices within your network.  Replay captured HTTP requests with its Composer system.  Fiddler’s amazing abilities cannot be overstated.  It’s helped me diagnose and fix more problems with HTTP services than any other tool.

dotPeek – my favorite way to decompile .NET code, free from JetBrains.  It even has the ability to break a .NET DLL/EXE down into a fully-structured Visual Studio project!

Postman (Chrome extension) – my second-favorite way to test HTTP services is Postman.  Postman has an easy-to-use interface and provides a straightforward way to make HTTP requests.

Google Chrome – I used to use Firefox exclusively, but stopped after it started feeling bloated, buggy, and crash-happy.  Chrome’s dev tools are better than Firebug, which I also found to be frustrating and slow.  Plus, it has much better plugin and app support.

PowerShell - easily the best scripting language on the Windows platform. Great scripting plus the power of the .NET Framework at your disposal when you need those extra awesome features. Also, recently made cross-platform!

Webpac  - bundle all of your JS, CSS, TS, etc files together for delivery to your local friendly web app. I use this on new and old projects alike. Powerful and simple to configure.

Visual Studio add-ins

ReSharper – perhaps the most essential tool for .NET devs around the world.  Amazing refactoring that puts Visual Studio’s default refactoring capabilities to shame.  Code generation that makes writing constructors, methods, or pretty much anything a snap.  Search tools that makes navigation through code effortless.  A built-in test runner that makes running and viewing tests a breeze.  A code analysis tool to help you find mistakes and potential pitfalls in your code.  Built-in added support and intellisense for common frameworks such as ASP.NET MVC.  It is truly the god of all Visual Studio plugins.  Go download it and tell your friends.

OzCode – if you’re a C# developer, you need OzCode.  It turns debugging from a necessary chore to a borderline delight.  Break down code expressions, highlight the most needed data in an object, compare data between two objects, find all objects of a given type in memory, and exceptional exception handling make OzCode a star – and that’s just the tip of the iceberg.

Web Essentials – a great tool by Mads Kristensen of Microsoft – it’s his personal testbed for new web-based Visual Studio features.  Features things like quick HTML typing using ZenCoding, a link between the browser and Visual Studio for seeing immediate changes to your changed HTML/CSS, better Intellisense for CSS/HTML/JavaScript/Angular, and so much more.  Install it and watch your productivity in web development go to 10.

GhostDoc - best way to quickly write your XML code comments. Makes it so easy to annotate your code with comments about the code you're writing.

Source control

Git - the favorite source control solution for tons of developers. So prevalent that all recent Microsoft open source code is published to GitHub instead of their own internal SCM, Team Foundation Server. Most powerful learned with the command line or using tools such as...

SourceTree – a great visual tool for Git users.  Not perfect, but very helpful.

Languages

C# - my preferred backend language since the start of my career. So much power and ease in the language and in the .NET Framework. Made even more relevant with the recent introduction of .NET Core.

JavaScript - famously called the machine language of the web, it's the most critical language for any software engineer of all disciples and skill levels to master if you're doing web work of any kind.

TypeScript - my preferred language for all JavaScript development I do. Embraces the weirdness of JavaScript while adding awesome features like a better type system, interfaces, and all of the features of any flavor of ECMAScript.

F# - simply the best .NET language in existence, F# is one of the best functional languages for any programmer to learn. Learning this will make you a better programmer no matter if you stick with object-oriented for the rest of your career.

Hosting

Microsoft Azure - the no-brainer hosting solution for .NET developers and, well, any developers for that matter. Runs Windows as well as it runs Linux, Unix, you name it. Amazing interface and tons of power - even has a RESTful API that you can use to spin up and maintain servers.

Frameworks

Web

ASP.NET Web API – built on top of MVC, Web API makes spinning up an RESTful API a breeze.  Host it in IIS or self-host on top of OWIN (this works great with Topshelf.)  Use it to power everything from your mobile app to your single-page application, powered by your favorite JavaScript frontend framework.  Versatile and fun to use.

React - amazing view library which has gotten a ton of love in the last couple of years. Combine it with your tooling of choice to create awesome web apps that scale well from a codebase perspective. Write your views in JavaScript using JSX and put the power of your HTML into your JS, as opposed to the other way around with Angular.

Angular 2 – Faster than Angular 1. Simpler… that’s debatable! Very batteries included compared to React. Get started quickly and create awesome web apps around components using an easy-to-learn templating system. Combine with TypeScript for an awesome development experience.

Redux - the Redux state container has emerged as the pattern/framework of choice for creating web apps using React. Extremely simple to understand and with a low API surface area, which means you can get started really quickly. Combine with Angular 2 using ngrx, a framework designed around the Redux pattern.

SignalR – the easiest and most powerful way to create an excellent realtime experience for the web or anything that can connect over HTTP.  I personally used it to power realtime text message communications between a Xamarin-powered mobile app as well as a desktop app.

Mobile

Xamarin – I don't do mobile anymore, but this was my personal favorite way to create an awesome mobile experience using the C# dev stack.  Completely free from Microsoft.  Use Xamarin.Forms to create mobile views for all major mobile platforms and share a 90% common codebase.

Data access

Entity Framework – my favorite way to access a database, period.  Use LINQ to communicate with your database, create your data views using attributed POCOs and easily update your model with Migrations.  It’s not for everyone, but it’s fast enough for most use cases and getting better every day.

Dapper – when I want a way to quickly access a database using SQL, Dapper has my back.  Deceptively simple API for what turns out to be a very fast way to access data.  Powers the data access layer behind StackExchange, one of the highest traffic websites on the planet.

General

Newtonsoft.JSON – the standard for JSON serializing and deserializing in .NET.  Used everywhere.  Go and buy him a beer – James Newton-King has made all of our lives easier.

AutoMapper — used to map properties in objects together. One of my favorite libraries in .NET. I combine it with AutoMapper.Attributes to create self-documenting type definitions.

TopShelf – when spinning up a Windows service using .NET, nothing is faster and easier than TopShelf.  Utilize its Fluent API to quickly and painlessly create a Window service, fast, in a manner that’s self-documenting.

RabbitMQ – when you need a reliable messaging queue for your suite of applications, RabbitMQ is a strong choice.  If using .NET,EasyNetQ makes the experience that much easier – it abstracts the most difficult parts away into message passing via POCOs.

Underscore.JS – my favorite JavaScript framework for object manipulation and collection traversing/ transformation.  It’s not as nice as LINQ, but it has a decent chaining syntax and is very feature-complete.  Lodash is another alternative that is drop-in compatible with some extra functions.

Moment.js – Dates in JavaScript are harder than they need to be.  Moment.js makes it that much less difficult by providing a simple and powerful date API.  Usually my second web project add-in (first being Underscore, of course.)

Little stuff

F.lux – changes the color temperature of your monitors at night.  A small thing but makes night programming much easier on the eyes.

Paint.NET – a fast, free paint tool written using .NET.

WinRAR – my choice for compression.  Yeah, I know Scott Hanselman recommends 7Zip, but 7Zip’s context menu requires two clicks – WinRAR’s only requires one I'm codger-y and like WinRAR. (Thanks for all those who pointed out that, in fact, you can configure 7Zip's context menu to require one click.)

Treesize Free – a great cleanup tool for those who have constrained hard drive space.

LastPass – a wonderful password manager that makes managing logins a much easier endeavor.  When you’re in IT, you know how crucial it is to keep track of passwords and LastPass makes that much much easier. 

Reddit– I subscribe to r/programming, r/dotnet and a handful of other useful programming-related subreddits.  Useful for a quick mid-day browse when you need to look away from Visual Studio for 5 minutes.

Hacker News – not necessarily programming focused, but it has some interesting tech-related topics.  I just started reading this recently.  Clearly, I’ve missed the party for a long time.

StackExchange– if StackExchange doesn’t have an answer to your programming question or problem, then you’re probably on your own.  Learn from the wisdom of others’ mistakes and find quick, elegant solutions to your programming problems.  Chase down those obscure exceptions.  If you haven’t used it, then you’ve never used Google to solve a problem.

Scott Hanselman’s Blog – Scott Hanselman is my main man.  His blog posts are always interesting and valuable and his contributions to the Microsoft dev world cannot be overstated.

Dew Drop – my favorite link aggregation site.  It’s my daily morning check.  (Morning Brew isn’t as comprehensive, but is still a decent resource.)

Communication slash speaking slash branding tools

Twitter - the best way to communicate with other professionals in your industry in a meaningful way.

Ghost (blogging platform) - recently replaced WordPress in my life. Ghost focuses on one thing and one thing well - creating a great blogging experience. I love the use of Markdown over a WYSIWIG editor. I love its pure speed over Wordpress.

GitPitch — I use this to create presentations. Write simple slides in Markdown and commit to a GitHub repo, and voila — instant great looking slides. Used to be PowerPoint or Keynote, but GitPitch takes a lot less time, and my code slides look great since GitPitch uses GitHub Flavored Markdown.

Trello - helps me keep track of all of my speaker submissions, my current talks, and any conferences I want to submit to. Useful for so much more.

Camtasia Studio - my favorite tool for recording screencasts and demonstrations. Expensive, but worth it if you do this kind of thing a lot. Open Broadcaster Software (OBS) is a free alternative.

Introducing the TypeScript Cookbook

Do you use TypeScript? Ever wanted to know how to get the return type of a function? How about rolling your own nameof operator?

I've started a GitBook I'm calling TypeScript Cookbook. It's a place for all of my favorite TypeScript recipes, from real-world best practices to esoteric tricks I've picked up along the way. Hot, fresh and guaranteed to please!

It's still very much a work in progress, so please feel free to check it out early and often!

By the way, I'm looking for contributors! If you have any awesome TypeScript recipes to share, please get on GitBook and contribute! The book is fully open source!

Click here and check it out!

Reviewing GitPitch and Spectacle, two presentation solutions for developers

GitPitch is a recent discovery of mine. For someone used to writing code in PowerPoint/Keynote, it's very nice - write your slides in Markdown, post to GitHub, and GitPitch will construct a nice looking presentation for you, hosted on their website. The only steps involved are: add a file called PITCHME.md to your GitHub repo, point GitPitch to it, and off you go.

I found GitPitch to be appealing as I rarely do code demos except in very controlled circumstances, so my slides are extremely code-heavy. I don't know if you know this, but writing code directly in PowerPoint or Keynote sucks. Everything wants to help you with autocorrect or by formatting my punctuation. Plus I have to do all code highlighting myself, and I think proper code highlighting is essential to getting your point across when you're presenting any kind of code.

I did a talk at Chicago Code Camp on TypeScript's type system. I had written an outline for it before my trip and planned to write the slides on the train ride up. Originally, I was going to use Ken Wheeler's Spectacle, but I gave GitPitch a shot since I already knew Markdown and had a lot of slides to write. (You can see the final result here - the repo with the presentation markdown is here.)

Without further ado, here's my brief review on both.

Re: GitPitch only
  • GitPitch supports embedding code blocks in either Markdown code blocks or Gists. I opted for code blocks as Gists will not show up if your presentation is offline (did I mention you can export your presentation and run it offline? This is a critical feature for me as I never count on conference Internet working right.)

  • Speaking of code - it uses Github Flavored Markdown so you get syntax highlighting for free. This was another critical feature for me as my code has to look like it's in an IDE. Something something suspension of disbelief.

  • You can add your own styles to GitPitch, which ended up being critical for me. I don't think the margin on the code blocks is enough (text is not separated from the body enough IMO) and I didn't like the fact that it did full-caps on code lines created by backticks (e.g. this), so I tweaked those and was happy with the final result.

  • GitPitch caches the presentation on the master branch for 180 seconds. For feature branches, it's 20 seconds. I knew that it was probably cached (this makes sense) but at first it was pretty confusing when I was making changes and they weren't reflecting. Lesson: RTFM.

Re: GitPitch vs Spectacle
  • Spectacle is written in React, so you have to know at least something about React to use it. GitPitch uses Markdown, which means it has a very small learning curve (comparatively speaking).

  • Out of the box, Spectacle makes very nice looking slides with lots of options to tweak them. If I wanted to deeply customize my slides, I'd go with Spectacle hands down. There's no comparing a full view framework (React) with Markdown. However, what you get out of the box with GitPitch is nice too.

  • In Spectacle, code has to be in a separate file or inline inside of your HTML attribute, e.g. code="var yourCode = 'here'". I liked doing it inline inside of the Markdown personally - it's just one less step.

  • Spectacle threw errors when I set my code formatting to TypeScript. I don't think the highlighter (prism.js) supported TypeScript at that version, so I updated it... but it still didn't work. I could have used JavaScript code highlighting, but with something like TypeScript with lots of different syntax, I wanted to make sure everything that should be highlighted was highlighted. Ultimately, this and a couple of other small issues prevented me from using Spectacle for my TypeScript presentation. I wanted to write slides, not debug a web app. This was more of a timing choice than anything - it's what I get for waiting to construct my deck at the last minute. :)

  • Spectacle features a presenter mode that shows you the time plus what your next slide will be. I couldn't find a presenter mode for GitPitch. Needless to say, this feature would be invaluable. UPDATE: GitPitch released a presenter mode on the same day as my presentation... might be why I missed it.

  • This extension for Spectacle is the number 1 reason I would use it. You simply can't do this in Markdown. Stepping thru code line-by-line without using an IDE is just... well take a look at the result for yourself. It's awesome. Shoutout to James Kyle for an excellent plugin.

Stepping through code using Spectacle

  • Because GitPitch uses Markdown + GitHub, the slides are a lot easier for others to download and mess around with. I don't know how important this is, but the fact that I don't need someone to run an entire web app to see my slides is kind of nice.

  • Nitpicky, but I wish GitPitch would change the URL based on what slide I'm on. With GitPitch, you have to define custom navigation points to go to different slides. Spectacle just does this out of the box.

Bottom line

Would I use GitPitch again? Definitely.
Would I use Spectacle ever? Definitely.
Will I ever use PowerPoint/Keynote again? Probably not.

Both are awesome presentation choices that solve similar problems. I personally will probably use GitPitch more frequently for not-code-heavy presentations - it's very easy to make really nice looking presentations. That said, I will likely convert my TypeScript types talk to Spectacle for that awesome stepping-thru-code thing when I give that talk again at Detroit.Code() and Kansas City Developer Conference.

Emojis and String.Length

Are you using String.Length to compute the length of a string that might include emojis?

If you compute String.Length for such a string, you may not get back exactly what you expect:

This will write 12 to the screen. What were YOU expecting?

String.Length with emojis will not do what you expect

This happens because C# strings are UTF-16 by default and Unicode characters that fall outside of these 16-bit lengths are stored as surrogate pairs, or two chars that represent one 32-bit character.

However, you may be wanting the number of Unicode characters, not the actual length of the char array, in which case you should use System.Globalization.StringInfo to compute the length of your strings. Like so:

This will yield what you're looking for:

StringInfo will give you the actual number of characters in a string

Want more reading? Check out Joel Spolsky's very excellent article on strings and encoding. Remember, there is NO such thing as plain text!

VIDEO - Discussing React and Angular 2 with Adam Morgan

TL;DR: I've gotten really excited about React as a web framework since starting with Angular and then Angular 2. The combination of JSX + easy-to-understand component model have made React a winner to me.

I've been tweeting a lot recently about React recently. After doing a lot of Angular 2 work for the majority of 2016 including a successful workshop at a few conferences, I started learning React early this year and was instantly hooked. A friend of mine wanted me to show him what all the excitement was about, and, well:

...which caught the attention of a Twitter friend of mine, Adam Morgan. He asked to see a repo - I said, let's do one better and make a video, which you can find here:

In the video, I walk through the three things that really make React stand out to me over Angular 2, with questions and commentary from Adam. The long and the short of it:

  1. JSX is awesome. As Cory House wrote: "it’s more logical to enhance JavaScript to support markup than to enhance HTML to support logic." Plus, compile time checking of your views makes writing components a much easier process.
  2. It's just JavaScript. No need to learn any framework-specific DSLs like with Angular/Angular 2/Aurelia/etc. You only need to know JavaScript and HTML to write React apps.
  3. Low API surface and learning curve. Fewer moving parts means it's easier to understand and become productive with quickly.

Here are some of the resources I've used to get started.

Building Applications with React and Redux using ES6 - Pluralsight course by Cory House
Presentational vs Container components by Dan Abramov Getting Started with Redux - course by Dan Abramov, creator of Redux
React Slingshot - React starter kit by Cory House
ASP.NET Core SPA Generator/Starter Kits, which includes templates for React and React with Redux.