Scott Hanselman

Announcing the Web Standards Update - HTML5 Support for the Visual Studio 2010 Editor

June 15, '11 Comments [77] Posted in ASP.NET | ASP.NET MVC | HTML5
Sponsored By

vshtml5Folks have been asking "When will VS2010 support HTML5?" I've been saying, jokingly, that the answer is "yesterday" as there's nothing keeping you from creating HTML5 in Visual Studio or ASP.NET today. However, there's no intellisense and there's lots of squiggly lines that make people uncomfortable. Combine all that with the fact that HTML5 is a moving target, and it's unclear. We've said before that the next version of Visual Studio will have better support HTML5, but what about today?

Today, a rogue faction some folks on the Web Platform and Tools team, spearheaded by Mads Kristensen are all pleased to announce the Visual Studio Web Standards Update. This adds better support for HTML5, CSS3 and new JavaScript features to ALL versions of Visual Studio.

Note that this isn't an official Microsoft product release, rather improved support from passionate people done in their spare time.

Download the first Visual Studio Web Standards Update

HTML5 moves fast, and this update will aim to keep up with it. It adds support to Visual Studio and the editor for HTML5, CSS3 and new JavaScript features. The goal is perhaps an update every quarter or so as new features or elements emerge.  We want ASP.NET web developers to always be able to use the latest standards, as well as being able to choose from existing standards. Remember that you can use HTML5 today along with JavaScript libraries like Modernizr that allow you to create pages that work across nearly all browsers, including old crappy ones.

The Visual Studio Web Standards Update provides you with intellisense and validation for:

HTML 5 features

Browser APIs

  • Geo-Location - Location aware websites are a clear, growing trend and now you've got full intellisense and validation within Visual Studio.  For a nice sample, view source on the IE9 test drive demo.
  • Local Storage – IE has been supporting local storage from IE8, so now Visual Studio will provide you with full-fidelity intellisense to create sites which can save state within the browser.  For sample of this, do a view source on HTML5 Demo Site

CSS3

Additionally, if you are trying to make websites which work on a variety of platforms and browsers you will love the fact that Web Standards Update not only supports IE specific prefixes like –ms; but also other vendor prefixes like –webkit and –moz.

HTML5 in Visual Studio

When you start up Visual Studio 2010, you can select what version of HTML you want on a file-by-file basis, or set the defaults.

Side Note: See how IE6 is in there on its own? That's been there since before forever. Hopefully it'll be gone soon. Ignore it.

HTML5 in the HTML Toolbar dropdown

You can also set it as the default in Tools | Options | Text Editor | HTML | Validation. Note the options for errors.

Options (87)

All the new HTML5 semantic tags are there, like section, svg, video, etc. This is just the first release, and while it's REALLY comprehensive, I'm sure it has some bugs. But, it'll be updated regularly, so make sure you report anything you find and look for it to be fixed in the next release.

Adding an Audio Tag

There's even support for important (but under-utilized and under-respected) attributes like the WAI-ARIA (Web Accessibility Initiative - Accessible Rich Internet Applications)

Adding a main role to a nav tag

Also the aria-* attributes appear not only as intellisense enabled attributes, but also their enumerated values:

Adding aria-autocomplete to an IMG tag

Tags are fun, sure, but how about microdata? Bing, Google and Yahoo are all supporting Microdata and more specifically the schema.org vocabularies. This update will therefore add intellisense to the most popular vocabularies including schema.org and data-vocabulary.org.

Adding http://schema.org/ attributes to an article

Seriously, tell me that's NOT the hotness. Awesome for SEO.

CSS3 in Visual Studio

That's just the HTML5 stuff. There's also CSS3 support. Yes, that's 1 better than CSS2.

CSS3 in the dropdown

It includes all the cool new CSS3 stuff like column-full and of course border-radius as well as animations and transforms. There's also lots of details on vendor-specific prefixes like -webkit, -moz and -ms.

Note the informational tooltip in the dropdown here as we pick a -webkit-transform shorthand property.

Some -webkit attributes

JavaScript and HTML5 in Visual Studio

There's a huge number of additions to JavaScript intellisense in this update. Things like geolocation via navigator.geolocation and DOM storage via window.localStorage.

Geolocation in JavaScript in VS

Here's a slightly less trivial snippet of HTML5 and JavaScript using some new local storage features and showing the intellisense.

LocalStorage in the editor

Say what you like about intellisense as a concept or crutch, but I like to think of it as a just-in-time object browser that helps me explore new technologies as well as discover nooks and crannies that I might not see.

We don't know what all will come in the next version of Visual Studio, or the next version of HTML5, but for those of you who are interested, we hope this "living update" of Web Standards support for Visual Studio will help you out!

Enjoy, Dear Reader.

P.S. This is an update for ASP.NET and HTML5 editing people who want to use HTML5, new JavaScript features and CSS3. I didn't mention Silverlight because it has nothing to do with Silverlight. I said once "just because your favorite technology isn't mentioned in a keynote doesn't mean it's dead." Assume that the same rule applies to a Blog Post.

P.P.S. No, that logo to the right isn't official anything and yes, it's fun.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Productivity and Continuous Improvement - Measurement (and RescueTime) makes it happen, both Personally and at Work

June 14, '11 Comments [20] Posted in Productivity
Sponsored By

The RescueTime Dashboard with charts over each hour showing my productive timeI was chatting with a friend recently about my recent diet and she commented that I seemed to measure everything. I realized that measurement and logging was a theme in my lifestyle, specifically as applied to productivity.

As a Type 1 Diabetic logging and measurement as a precursor to success is not just required, it's darn near mandatory if you to live succeed. I check my blood sugar as often as 10 times a day. Now that I'm also on a continuous blood sugar meter as well, I am able to measure hundreds of times a day and make small adjustments.

It's this core idea of measure often combined with small adjustments that I believe is the hallmark of success in nearly anything one does.

I have been dieting of late (I'll do a separate blog post on this soon) using an application called LoseIt and a pedometer/metabolic activity meter called a FitBit. These two small and inexpensive (LoseIt is free so far!) measuring devices have enabled me to lose 21 lbs in a short amount of time with minimal effort.

The old adage is "measure twice, cut once." In the computer age, my new agile adage is "measure often, cut often."

One of my favorite tools for measuring personal productivity (and making adjustments) is called RescueTime. It's a little app that runs in the background and keeps track of the application running in the foreground, as well as if you're interacting with it. You can categorize applications with various levels of productivity. For example, for me, reading CNN.com is not productive, but if you're a journalist, perhaps it is very productive. You can categorize from apps down to websites, as well a ones you want it to ignore. They even have a lovely Data API that you can access programmatically and do whatever you like!

Once you've run RescueTime for a while, maybe a week to a month, things become VERY interesting from a data perspective. You can pivot the data any way you like, focusing on Productivity, Efficiency, or by Category.  If you're an hourly worker or consultant, you can even upgrade and us it as an effective time-tracking tool.

Here's some examples of the kinds of insights you can get when you measure, and what you (or I, in this case) can do about it. I'll pick a random day in May, the 17th.

My daily productivity as logged by RescueTime by hour

There's some uncategorized data in there where I'm using an application or website that RescueTime doesn't recognize. Notice that I don't really hit my stride for Software Dev until lunch time. If I look at the week or month views, I find this to be true consistently. I'm garbage with analytical work (development) until lunch. What can I do about that? Well, I can totally avoid that kind of work in the morning. Did you realize that you can be more productive by actually avoiding work at times when you know you'll be lousy/unfocused/suboptimal? If you rock at a certain kind of work at 11pm, then well, organize your day so you can be successful that those times.

If I dig in on an hour, for example, noon to 1pm on this day, I can see that I was developing software (in Visual Studio) for 35min, using utilities for 10min, and googling around for a few minutes. Other distractions used up only seconds.

My productive time for a single hour in May

I can dig in and categorize my programs and their relative productivity/distractedness (it's like Mint.com, do the work once, and it'll add up over time!) and that makes my reports easier to read at a macro level. You shouldn't need to spend much time doing this.

Categorizing my time by program

Then, once a week, during your Friday afternoon "Reflection," go look at your reports and see if you find patterns. Then, make a list of the 3 things you'll do on Monday to make your week more productive. Repeat this each week and you'll find an LEAST 4-8 hours of wasted time. I'm not saying don't read the news or go on Twitter.

I'm saying this:

  • Be deliberate.
  • Time is finite, treat it as a resource.
  • Know what you're doing.
  • Be aware of what the trade-offs are.
  • Measure everything, otherwise you have NO idea what you're doing.

If you don't profile your program, you don't know where it's spending it's time. If you don't profile yourself, you're just hanging out.

Hope this helps, Dear Reader.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 270 - Nancy, Sinatra and the Explosion of .NET Micro Web Frameworks with Andreas Håkansson

June 14, '11 Comments [4] Posted in ASP.NET | ASP.NET MVC | Open Source | Podcast
Sponsored By

Scott chats with open source developer Andreas Håkansson about his .NET micro web framework called Nancy which is inspired by a Ruby framework called Sinatra. Why do we need frameworks like this? What kinds of sites and services can they support and how do they relate to ASP.NET?

Links from the Show

Hello World Example

public class Module : NancyModule
{
public Module()
{
Get["/greet/{name}"] = x => {
return string.Concat("Hello ", x.name);
};
}
}

Download: MP3 Full Show

NOTE: If you want to download our complete archives as a feed - that's all 270 shows, please subscribe to the Complete MP3 Feed here.

Also, please do take a moment and review the show on iTunes.

Subscribe: Subscribe to Hanselminutes or Subscribe to my Podcast in iTunes or Zune

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface and developer tools, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET AJAX,MVC,Silverlight, Windows Forms and WPF. Enjoy developer tools like .NET Reporting, ORM, Automated Testing Tools, Agile Project Management Tools, and Content Management Solution. And now you can increase your productivity with JustCode, Telerik’s new productivity tool for code analysis and refactoring. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 269 - Community vs. Evangelism vs. Marketing vs. Authenticity with Brandon Watson from Windows Phone

June 14, '11 Comments [3] Posted in Podcast | WinPhone
Sponsored By

Windows Phone 7 from HTCScott sits down with Brandon Watson, a Director on Windows Phone. He works with the Developer Community, but what does that really mean? What is Community vs. Evangelism vs. Marketing vs. Authenticity? Scott pushes on this point to better understand his own job at Microsoft

Download: MP3 Full Show

NOTE: If you want to download our complete archives as a feed - that's all 269 shows, please subscribe to the Complete MP3 Feed here.

Also, please do take a moment and review the show on iTunes.

Subscribe: Subscribe to Hanselminutes or Subscribe to my Podcast in iTunes or Zune

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface and developer tools, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET AJAX,MVC,Silverlight, Windows Forms and WPF. Enjoy developer tools like .NET Reporting, ORM, Automated Testing Tools, Agile Project Management Tools, and Content Management Solution. And now you can increase your productivity with JustCode, Telerik’s new productivity tool for code analysis and refactoring. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Console2 - A Better Windows Command Prompt

June 8, '11 Comments [78] Posted in Tools
Sponsored By

image I was working on my Mac today and while I maintain that the OS X finder is as effective as shooting your hands fill of Novocaine, I remain envious of the simplicity of their Terminal. Not much interesting has happened in the command prompt world in Windows since, well, ever. I actually blogged about text mode as a missed opportunity in 2004. That post is still valid today, I think. Text is fast. I spend lots of time there and I will race anyone with a mouse, any day.

I blogged about Console2 as a better prompt for CMD.exe in 2005. Here we are 6 years later and I hopped over there to see Console2 was still being developed. They were on build 122 then, and they are, magically and to their extreme credit, still around and on build 147. Epic.

Open Source projects may be done, but they are never dead.

I downloaded Console2 at http://sourceforge.net/projects/console/files/ and put it c:\dev\utils which is in my PATH.

Here's how I set it up for my default awesomeness.

  • Right-click in the main console and click Edit | Settings.
  • Under Console, set your default Startup Directory
  • Under Appearance|More, hide the menu, status bar and toolbar.
  • Under Appearance, set the font to Consolas 15. Not 14, not 16. Black background, Kermit green foreground color.
  • Set Window Transparency to a nice conservative 40 for both Active and Inactive. Not too in your face, but enough glassiness to say "I'm a subtle badass."
  • Under Behavior set "Copy on Select"
  • Under Hotkeys, change the New Tab 1 hotkey to Ctrl-T because that's what it should be. You'll have to click on the hotkey, then in the textbox, then type the hot-key you want AND press Assign for it to stick.
  • Under Hotkeys, change Copy Selection to Ctrl-C and Paste to Ctrl-V then rejoice and wonder why Windows doesn't work like this today. At this point, you may want to device if you want "Copy on Select" to happen automatically under Behavior. That'll save you the Control-C if you like.
  • Now, the subtlety. Under Tabs, you (if you are me) want two default tabs, one for CMD.EXE and one for PowerShell because you don't like your peas and carrots to touch on your plate.
    • Set your Console|cmd.exe first tab to this shell if you want it to be a Visual Studio command prompt. Be aware of the PATH if you are not on x64 like I am.
    • Then, make another Tab called PowerShell with this path:
      • %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
      • And I used the vspowershell.ico icon 'cause I'm into flair.

You'll have a nice "New Tab" option where you can make one of either shell. Note the general loveliness of this understated shell. I can open a new Tab with Ctrl-T (or lots) and use Ctrl-Tab to move between them. I took the screenshot with the background so you can see the transparency.

One final reason why Console2 rocks? It's freaking resizable in two directions, unlike the Windows CMD.exe console.

 (36)

Console2 is a great little front-end for your existing shell, no matter what it is. Note that Console2 isn't a shell itself, it's just a face on whatever you are already using. Enjoy.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.