Updates from January, 2014 Toggle Comment Threads | Keyboard Shortcuts

  • Richard 10:29 am on January 21, 2014 Permalink |  

    Node.js + Visual Studio 

    One of the things that attracted me to Node.js in the first place was the opportunity to break away from the development stack I have been using for years (C#, .NET and Visual Studio) and use something completely different. Something that was fast, lightweight, productive, cross platform and fun.

    I quickly found Sublime text was the most productive place to develop Node. I’m not a hardcore VIM/Emacs person (much as I’d like to be) and Sublime gave me some autocompletion, and I can add in things like JSHint. I was happy.

    Then Microsoft released their Node.js tools for Visual Studio.

    I was sceptical. There was nothing wrong with my development workflow, and I was enjoying my life without Visual Studio. However, after watching the video I got interested.

    There are a number of really powerful features in these tools, but for me it’s the debugging that makes the biggest difference to my productivity. Here are a few screen shots.

    1. Press F5 to Run, automatic Git integration, and package inspection.

    screenshot4

    You can have a solution file which contains multiple projects. You can choose which file in the project is the one for Node to run when you press F5. This saves you the break in development workflow of going to the console and starting your app manually. Yes you do have to add a new ‘project’ file, and a ‘solution’ file too, but Visual Studio doesn’t pollute your filesystem beyond that.

    2. Automatically break into the debugger on an Error.

    screenshot1

    If an error is thrown Visual Studio breaks at the line in question, and give you a nice summary of the problem. For me, this is much quicker than reading the error reported by node, and going and looking up the line. At this point you are debugging, so you can go and inspect the variables and the stack trace as shown below.

    3. Set breakpoints and debug

    screenshot3

    You can set a break point to launch the debugger. When debugging you can hover over any variable and inspect it’s value. You can drill into the objects and arrays. I normally solve this kind of problem with lots of calls to console.log. I have also used node-inspector, but this is better and easier to use.

    4. Get the stack trace

    screenshot2

    When you debugging the code you get a stack trace, which you can go and explore.

    Summary

    None of these features give you anything that you can’t already do in one way or another, but what they do it bring everything together into one integrated environment. This is what Visual Studio has always been good at, some would say that historically Visual Studio has attempted to do too much. The real test is to ask yourself whether using these tools is saving you time and increasing the quality of your code. I have developed software with Visual Studio for years, so for me the answer is yes.

    Advertisement
     
  • Richard 10:02 am on January 9, 2014 Permalink |  

    Publishing a Node.js Website to Azure in under 2 minutes using only the browser 

    A while ago I recorded a screen cast showing how you can publish a Web Site to Windows Azure using a Raspberry Pi. It took 3 minutes.

    With the recent launch of Visual Studio ‘Monaco’ and it’s integration with Window Azure Web Sites I thought it would be interesting to try again. Instead of the Pi, I’d use only my web browser.

    It took 1 minute 25 seconds (it would be quicker if I could type faster!).

    I have been really impressed by Monaco. I probably wouldn’t use it as my default IDE, but for hacking together something quickly from a random web browser, it’s just the ticket.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel