Script References in Visual Studio 2013

Script References in Visual Studio 2013

Editor’s Note: In partnership with Microsoft Press, now celebrating their 30th year, MVPs have been contributing to an ongoing guest series on their official team blog. Today’s article is from ASP.NET/IIS MVP James Chambers which is the 32nd in the series.

Some of the gems that make Visual Studio the best development environment are so humble that you’re likely to miss them. The updates to script references, in my opinion, fall into that category while still improving on an already great feature of the product: IntelliSense for JavaScript.

A Little Background on IntelliSense

IntelliSense has been featured for nearly two decades now in Visual Studio’s lineage, dating back to 1996. Developers have become so accustomed to using it that when you spend any time in a different development environment you immediately feel impaired.


IntelliSense is great for learning APIs, object exploration and, when used well, can dramatically speed up the time it takes to write code. It also has the nice side benefit of allowing us to write appropriate and descriptive property and method names without having to worry about how long it would take later to access those members by typing them out L-E-T-T-E-R-B-Y-L-E-T-T-E-R.

When feature phones started introducing autocomplete, I was like, “Pfft! I’ve had autocomplete for years!”

IntelliSense for JavaScript

Let’s be honest here, the web’s kinda caught on now, almost to the point where it might stick around. More and more of the code we write has gotten closer to the client, especially in web development where we strive to create rich and interactive experiences for our users. It became increasingly painful to have to flip from a .Net language to JavaScript and lose our ability to navigate across objects. Where, in C#, we could dot-type into our objects, we’d always have to jump out to a separate JS file or spin up a browser to find out more about the methods in a JavaScript library.

Thankfully, Visual Studio 2008 introduced the first bits that really helped us gain some IntelliSense over our JavaScript, however the context was limited to pages and scripts where references were located, and the scripts they referenced and so on. This breaks down pretty quickly when you have partial pages that don’t reference the scripts you’re using or when you’re working on your own JS libraries that don’t immediately load a library but still depend on it (such as a jQuery plugin).

Visual Studio 2010 helped out by pseudo-executing our code, improving performance, and adding type inference on JavaScript objects and variables. Then Visual Studio 2012 came along and upped the game by introducing the Chakra runtime from IE, further improving performance and shipping with an editor that supported the _references.js global references file.

So what was left for Visual Studio 2013? To continue reading the full article click here

About the author

James Chambers is a husband, father, speaker, author and Senior Software Developer in Canada, where he once made a snowblower out of three electric toothbrushes, a shovel and duct tape, all while fighting off an angry pack of polar bears. His development passions are fueled by new tech, new tools and mentoring others. Outside of geeking, James is driven to help find a cure for Juvenile Diabetes, ensure children world-wide have access to clean drinking water and to find ways to better distribute the world’s food supply. Follow his coding adventures and other exploits at

About MVP Mondays

The MVP Monday Series is created by Melissa Travers. In this series we work to provide readers with a guest post from an MVP every Monday. Melissa is a Community Program Manager, formerly known as MVP Lead, for Messaging and Collaboration (Exchange, Lync, Office 365 and SharePoint) and Microsoft Dynamics in the US. She began her career at Microsoft as an Exchange Support Engineer and has been working with the technical community in some capacity for almost a decade. In her spare time she enjoys going to the gym, shopping for handbags, watching period and fantasy dramas, and spending time with her children and miniature Dachshund. Melissa lives in North Carolina and works out of the Microsoft Charlotte office.

Posted in Blogs | Leave a comment

Why it Itches when mosquitoes bites us?

Why it Itches when mosquitoes bites us?

When female mosquitoes poke their proboscis through your skin so they can suck some of your blood to be later used to make eggs, they inject you with some of their saliva. This saliva helps them to drink your blood more quickly, because it contains a cocktail of anticoagulants. Once the female mosquito is full up of your blood or is disturbed, she flies away, leaving some of her saliva behind. Your body then kicks your immune system in gear as a response to the presence of this saliva. It produces various antibodies which in turn bind to the antigens in the mosquito’s saliva. This then triggers the release of histamine.

Histamine is a nitrogen compound that, among other things, triggers an inflammatory response. It also helps white blood cells and other proteins to engage invaders in your body by making the capillaries of these cells more permeable. Bottom line, the histamine ends up making the blood vessels near the bite swell up. This produces a pink, itchy bump where the mosquito poked you.

Scratching the bump only makes this worse because it causes more irritation and inflammation of the sight, resulting in your immune system thinking it needs more antibodies to get rid of the foreign protein. So the more you scratch, the more it will swell; the itchier it will get; and the longer it will last.

Posted in Blogs | Leave a comment



Model–view–controller (MVC) is a software architecture pattern which separates the representation of information from the user’s interaction with it.[1][2] The model consists of application data, business rules, logic, and functions. A view can be any output representation of data, such as a chart or a diagram. Multiple views of the same data are possible, such as a bar chart for management and a tabular view for accountants. The controller mediates input, converting it to commands for the model or view.[3]

Component interactions

A typical collaboration of the MVC components

In addition to dividing the application into three kinds of components, the Model–view–controller (MVC) design defines the interactions between them.[4]

  • A controller can send commands to the model to update the model’s state (e.g., editing a document). It can also send commands to its associated view to change the view’s presentation of the model (e.g., by scrolling through a document).
  • A model notifies its associated views and controllers when there has been a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. A passive implementation of MVC omits these notifications, because the application does not require them or the software platform does not support them.[5]
  • A view requests information from the model that it needs for generating an output representation to the user

Use in web applications

Although originally developed for personal computing, Model View Controller has been widely adopted as an architecture for World Wide Web applications in all major programming languages. Several commercial and noncommercial application frameworks have been created that enforce the pattern. These frameworks vary in their interpretations, mainly in the way that the MVC responsibilities are divided between the client and server.[6]

Early web MVC frameworks took a thin client approach that placed almost the entire model, view and controller logic on the server. In this approach, the client sends either hyperlink requests or form input to the controller and then receives a complete and updated web page (or other document) from the view; the model exists entirely on the server.[6] As client technologies have matured, frameworks such as JavaScriptMVC and Backbone have been created that allow the MVC components to execute partly on the client (see also AJAX).


MVC was one of the seminal insights of the early field of graphical user interfaces, and one of the first works to describe and implement software constructs in terms of their responsibilities.[7]

Trygve Reenskaug introduced MVC into Smalltalk-76 while visiting Xerox Parc, in the 1970s; next, in the 1980s, Jim Althoff and others implemented a version of MVC for the Smalltalk-80class library. Only later MVC was expressed as a general concept, in a 1988 article.

This first MVC concept defined Controller as "the module that deals with input" (similarly to how the View deals with output).

The Controller, in modern applications of the 2000s, is a module, or an intermediary section of code, that mediates communication (between the Model and View) and unifies validation, using either direct calls or the Observer — to decouple the Model from the View in the active Model.[11]

Other aspects of the MVC also evolved, but as a variant of the original concept, and because "parts of classic MVC don’t really make sense for rich clients these days":[12]HMVC, MVA, MVP,MVVM, and others that adapted MVC to different contexts.

Source from Wikipedia

Posted in Blogs | Leave a comment

The Benefits of MVC

What Are The Benefits of MVC?

9 December 2008 by Ian Davis

Since there’s a rather nice discussion going on around my weekend post on RMR and MVC I thought I’d dig out the description of MVC from the Gang of Four book to remind us all what we’re actually talking about. Often people forget that the GOF book didn’t include MVC as a design pattern but as a usage scenario that they decomposed into constituent patterns, most notably Observer, Strategy and Composite.

Here’s the relevant section from the book:

The Model/View/Controller (MVC) triad of classes [first described by Krasner and Pope in 1988] is used to build user interfaces in Smalltalk-80. Looking at the design patterns inside MVC should help you see what we mean by the term “pattern.” MVC consists of three kinds of objects. The Model is the application object, the View is its screen presentation, and the Controller defines the way the user interface reacts to user input. Before MVC, user interface designs tended to lump these objects together. MVC decouples them to increase flexibility and reuse.

MVC decouples views and models by establishing a subscribe/notify protocol between them. A view must ensure that its appearance reflects the state of the model. Whenever the model’s data changes, the model notifies views that depend on it. In response, each view gets an opportunity to update itself. This approach lets you attach multiple views to a model to provide different presentations. You can also create new views for a model without rewriting it.

[…reference to diagram elided…]

Taken at face value, this example reflects a design that decouples views from models. But the design is applicable to a more general problem: decoupling objects so that changes to one can affect any number of others without requiring the changed object to know details of the others. This more general design is described by the Observer design pattern.

Another feature of MVC is that views can be nested. For example, a control panel of buttons might be implemented as a complex view containing
nested button views. The user interface for an object inspector can consist of nested views that may be reused in a debugger. MVC supports nested views with the CompositeView class, a subclass of View. CompositeView objects act just like View objects; a composite view can be used wherever a view can be used, but it also contains and manages nested views.

Again, we could think of this as a design that lets us treat a composite view just like we treat one of its components. But the design is applicable to a more general problem, which occurs whenever we want to group objects and treat the group like an individual object. This more general design is described by theComposite design pattern. It lets you create a class hierarchy in which some subclasses define primitive objects (e.g., Button) and other classes define composite objects (CompositeView) that assemble the primitives into more complex objects.

MVC also lets you change the way a view responds to user input without changing its visual presentation. You might want to change the way it responds to the keyboard, for example, or have it use a pop-up menu instead of command keys. MVC encapsulates the response mechanism in a Controller object. There is a class hierarchy of controllers, making it easy to create a new controller as a variation on an existing one.

A view uses an instance of a Controller subclass to implement a particular response strategy; to implement a different strategy, simply replace the instance with a different kind of controller. It’s even possible to change a view’s controller at run-time to let the view change the way it responds to user input. For example, a view can be disabled so that it doesn’t accept input simply by giving it a controller that ignores input events.

The View-Controller relationship is an example of the Strategy design pattern. A Strategy is an object that represents an algorithm. It’s useful when you want to replace the algorithm either statically or dynamically, when you have a lot of variants of the algorithm, or when the algorithm has complex data structures that you want to encapsulate.

MVC uses other design patterns, such as Factory Method to specify the default controller class for a view and Decorator to add scrolling to a view. But the main relationships in MVC are given by the Observer, Composite, and Strategy design patterns.

From this text the two key benefits of MVC are that it allows you to:

  • “attach multiple views to a model to provide different presentations” (view/model decoupling)
  • “change the way a view responds to user input without changing its visual presentation” (view/controller decoupling)

Unexpectedly (for me, anyway) it says nothing about decoupling models and controllers. Anyway, my observation is that if you need the above flexibility then MVC is your best bet. However, if you don’t need those particular decouplings then you are adopting needless complexity and you’ll be paying for it in the long run.

Posted in Blogs | Leave a comment

The origin of Tea Bags was an accident

The origin of Tea Bags was an accident

The tea bag was accidentally invented by a tea importer named Thomas Sullivan in 1908. To minimize the cost of transporting tea samples to customers, Sullivan sent the tea in small silk bags instead of the more expensive tin cans. The recipients mistakenly believed they were meant to be dunked and soon Sullivan was inundated with orders for his Tea Bags.

This method of brewing tea soon became popular, and by the 1920s, tea bags were being mass produced in the United States. Silk was replaced with gauze, then later paper.

Posted in Blogs | Leave a comment

Water Clock at Osaka Station City complex

Water Clock at Osaka Station City complex

Located in the South Gate Building of the new Osaka Station City complex, is a large rectangular water display created by local firm Koei Industry, this water display emits illuminated water droplets in carefully controlled patterns to reproduce images such as time readout, scrolling patterns and text. Watch and behold the awesome water display.

Posted in Blogs | Leave a comment

When I replaced with We

When I replaced with We

Posted in Blogs | Leave a comment