ASP.Net Developers, it is time to change your attitude towards JavaScript. I know you hate it. I used to hate it too. But I’ve come to terms with JavaScript and now actually quite like it! It isn’t my favorite language but I’ve been working hard to understand this important client side technology.

Please don’t be offended by this post. I know I have lumped all ASP.Net developers into one category here. I know many of you are in the same place as I am, moving quickly towards understanding Javascript. I am, however, speaking to a large group of .Net web developers who have not yet started their journey. You know who you are.

I’m a C# MVP and, prior to this past summer, I spent 3 years doing Silverlight development. I truly believe that Microsoft was on to something with the concept of Silverlight. Like many developers, with regard to client side web development, I knew there had to be a better way to do things than JavaScript. Silverlight was a great attempt. It wasn’t perfect but the concept was good. Heck, I thought that anything that saved me from JavaScript was a good thing. I don’t care what anyone says, JavaScript is not the best solution to client side programing. I think we could have had better. Silverlight was a good try but people didn’t embrace it for various reasons (I won’t get into that in this post). Well here we are now and Silverlight is pretty much toast. It seems like Microsoft has thrown in the towel and isn’t trying to replace JavaScript and I doubt anyone else will pick up that fight.

For the past 8 months or so, I’ve been back doing “traditional” web development. I’m quite happy to be in the world of asp.net MVC with HTML, JavaScript, and CSS. In the past few years, a lot has changed. Three and a half years go, when I last did this sort of work as the main part of my job, jQuery was gaining a lot of traction and was becoming widely accepted. But not like it is today. Today, many developers incorrectly use the words JavaScript and jQuery interchangeably (which is actually quite annoying). And as great as jQuery is, there are a ton of other great JavaScript libraries to help us developers. Patterns like MVVM and SPA have gotten quite popular. And I’ve learned that there are some other great patterns that can be applied to JavaScript development that can make the experience much better, especially for a pattern-happy OO developer like me. So I have been reading up on and practicing using closures, the revealing module pattern, prototypes, MVVM, dependency injection, and more. And I haven’t even started with TypeScript which looks very interesting, to say the least. And I should also mention that products like Visual Studio (and many plugins too) have come a long way to finally embrace JavaScript and have started to treat it like a first class citizen.

In addition to the fact that doing client side development is much better these days thanks to frameworks and tooling, our users have come to expect a richer experience from web sites and applications. Users want web pages to be useable and responsive and, dare I say, “nice to use”. And so, fellow ASP.Net developers, the time for faking our way through JavaScript is over. I have put a lot of effort into learning more about JavaScript. I’ve started treating that part of my job as seriously as I do C#. I don’t expect that I’ll become some kind of JavaScript Ninja anytime soon, but I’ve realized that JavaScript enhanced UIs are an important part of my work. I’m giving JavaScript respect and I’ll expect other developers to do the same. No longer will I accept a job candidate’s dismissive answers about their knowledge of JavaScript. “Yeah, I can do a little JavaScript but I don’t like it” is no longer a valid answer to an interview question. JavaScript is an important aspect of our jobs as web developers and it isn’t going anywhere, at least not for a while.

I talk about this story a lot… few years ago in a team meeting the developers were complaining about their struggles in writing JavaScript which was becoming an important aspect of our web solution. Our manager, who is a really smart guy and still a friend of mine, asked a few questions that made a big impact on me. First he asked, “How many books have you guys read about C#?” The response varied across the team but we had all read a bunch of them. He followed that up with the knockout punch… “how many JavaScript books have you read?” The room was pretty quiet. Most of the group had read none. At least I had read one, but I was wasn’t much different than the group. JavaScript programming was part of our job but yet we didn’t take the time to learn it. And through my career I have found that most ASP.Net developer’s (myself included) experience with and towards JavaScript was pretty similar.

The age of treating JavaScript with disrespect is over. It’s a necessary part of our web solutions. And as I said earlier, the frameworks and tooling have gotten much better. So now is the time to learn it, embrace it, use it, and succeed with it.

 

Lately I’ve been speaking at local user groups about many of the exciting new features in Visual Studio 2012. Since there is so much to know and learn about VS 2012, I decided to create a collection of blog posts with many of the tips. This collection of posts will include features that are new to VS 2012 as well as some existing features as well. To view all of the VS 2012 tips posted so far, click here.

This features, as well as a lot of the cool features of VS 2012’s Solution Explorer, was carried forward from a tool called the Solution Navigator that was available as an add-on in VS 2010 as part of the VS Productivity Power Tools download. It was a good feature then but it is even better now.

image

You can see the Solution Explorer in the screenshot showing the Controllers folder and the two source files it contains: AccountController.cs and HomeController.cs. But note the icon that indicates you can drill down further.

 

image

Now you can see that the Solution Explorer is capable of displaying quite a bit more information. You can see all of the class level variables (a private field named _foo and a public property named Foo) as well as a bunch of methods. You can also see the details of two nested classes. Of course, clicking on any of the items will bring up the file location on the code editor. These details can be combined with other features within the Solution Navigator. If you want to see how to search through the class level details, please check out my blog post on that topic. If you want, you can also change the scope of Solution Explorer down to these class level details. For details, please read my post on that topic as well.

 

 

 

 

 

 

 

 

 

I hope you find this tip helpful. To see more VS 2012 Tips, just click here.

 

Lately I’ve been speaking at local user groups about many of the exciting new features in Visual Studio 2012. Since there is so much to know and learn about VS 2012, I decided to create a collection of blog posts with many of the tips. This collection of posts will include features that are new to VS 2012 as well as some existing features as well. To view all of the VS 2012 tips posted so far, click here.

I love the little things that were added to VS 2012. The Image Preview is one of them. It’s one of those things that makes you wonder “That seems so simple, why wasn’t it there before.” But I’m not judging, I’m just glad it is here now. The feature is simple. When looking at a list of images that are included in your solution (in Solution Explorer, of course), just hover an image to get a preview of it. This can be a big time saver when you have a big set of icons that all have similar names.

image

I hope you find this tip helpful. To see more VS 2012 Tips, just click here.

 

Lately I’ve been speaking at local user groups about many of the exciting new features in Visual Studio 2012. Since there is so much to know and learn about VS 2012, I decided to create a collection of blog posts with many of the tips. This collection of posts will include features that are new to VS 2012 as well as some existing features as well. To view all of the VS 2012 tips posted so far, click here.

Did you know that you can have multiple instances of the Solution Explorer open at once? It’s a feature that isn’t so obvious because there isn’t a button for it. It is listed on the Solution Explorer context menu but those menus have so many options it’s hard to notice them all. Here you can see that I’ve got a my Services project selected and I right clicked and chose “New Solution Explorer View”.

image

Now you can see that in Visual Studio I have TWO copies of the Solution Explorer open:

image

You can drag these windows around and dock them on opposite sides of VS or even drag the out or onto a different monitor!

Things can get really interesting here when you are working on really complex solutions. You can combine the various scoping and filtering options with the New Solution Explorer View feature too. In the next screen shot, I’ve got one Solution Explorer with my complete solution and one that is filtered to show only files that are open!

image

 

I hope you find this tip helpful. To see more VS 2012 Tips, just click here.

 

Lately I’ve been speaking at local user groups about many of the exciting new features in Visual Studio 2012. Since there is so much to know and learn about VS 2012, I decided to create a collection of blog posts with many of the tips. This collection of posts will include features that are new to VS 2012 as well as some existing features as well. To view all of the VS 2012 tips posted so far, click here.

In a previous tip I talked about using some of the built in Filters in Visual Studio’s Solution Explorer. This is a similar feature. It’s one of those great ways to get rid of the “clutter” and focus on what is important. If you have a complicated solution, like I typically do, you’ll find this helpful.

In the screenshot you can see Visual Studio 2012’s Solution Explorer loaded up with the solution to my “Unit Testing Made Easy” demo. You’ll note that I’ve selected the Model project and right clicked to see the context menu. I’ve highlighted the option for “Scope to This”.

image

After clicking it, my solution explorer will now have the scope of just that project.

image

Presto… clutter removed. This doesn’t apply to just projects. You can “scope to” just about any item of folder in the solution explorer. As a matter of fact, once you have the Scope set, you can also applies those filters I mentioned before! And if you search (see my post on searching in Solution Explorer) in Solution Explorer, that search will have the new scope as well! There really are a lot of was to keep the solution explorer clean and clutter free.

Of course, the full solution can be brought back quite easily. Just click the home button to the solution explorer menu:

image

I hope you find this tip helpful. To see more VS 2012 Tips, just click here.