Thursday, February 28, 2013

Typescript interface syntax

Typescript offers two distinct flavours for declaring the same syntax. Both of these interfaces are identical:

The reason for providing these two ways is because :
C# / classic languages people would like the first syntax as that is how they would most likely use the interface:

The JavaScript folk might prefer the second syntax for it resembles JSON object syntax:

Since types are structural in typescript instace1 can be used anyplace where instance2 can be used.

Friday, February 8, 2013

ReSharper tip: Moving lines up and down

A friend of mine once said "I wouldn't touch visual studio unless i has ReSharper Installed" This convinced me to try it out for myself and have been hooked since then.

Here is one of the ways it makes my life easier, Holding down the ctrl+alt+shift keys (thinking of this as the holy trinity helps remember this key combination, term from ctrl+alt+shift+s used for web export in adobe creative suite) simultaneously changes the view from :


And you can quickly move the text around, e.g up: 

You can also select multiple lines and works in your C# / Javascript code editors as well. Really useful and absolutely love it. 

Tip: For C# code make sure you have a complete line selected otherwise you will not get the tooltip type heads up display (which basically means it will not work).