productivity enhencement with visual studio

Post on 13-Jan-2017

20 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Productivity with

Visual Studio~Ahasan Habib

1. Introduction to Visual Studio2. Keyboard Stock VS Mouse click3. Web Analyzer (JSLint, CssCop, StyleCop)4. Regular Expression Tester5. Code Snippet 6. Web Essentials7. Productivity Power tools8. Smart Debugging9. Top 11 Visual Studio Cool Features10.Resharper11.Conclusion

Outline

Introduction to Visual Studio1. Official Site https://www.visualstudio.com/ || https://www.g2crowd.com||

2. IDE (code accuracy, code generation, file structure, , intelligence, code checking, debugging and many more…)

3. IDE Vs Code Editor

4. Visual Studio Version (Community, [Community, Professional, Enterprise, Code]

5. [ VS 2010, VS 2012, VS 2013, VS 2015 ]6. Service Pack

7. Extensions

8. Themes

Visual Studio Version Help > About Microsoft Visual Studio

ExtensionsTools > Extensions and Update...

Themes: Black(Dark) VS Light (White) Tools > Options > General > Color theme:

Hot Key Vs Menu Click● Undo-Redo (ctrl+z, ctrl+y)● Find (ctrl + f)● Go to Line (ctrl + g)● Navigate front/back (ctrl + -, ctrl + shift + - )● Code Selection (ctrl + a, shift+arrow)● Code Commenting/un-comenting (ctrl + k +c, ctrl + k + u)● Code formatting (select code block => ctrl + k + f ● more...

Web Analyzer● JSLint

● CssCop

● StyleCop

JSLintVisual Studio wrapper for Crockford JSLint (Tools > Extensions & Update…)

Continue...● Unreachable code.

● White space

● Variable declared but not use.

● Variable use but not declare.

● Dead code.

● Not to use with statement.

● Define blocks (if (condition) statement; => if (condition){ statement;}

● Semicolon.

● Debugger statement.

Css Cop => It uses Css Lint

Continue...● Don’t use adjoining classes (ex: .foo.bar)

● Remove empty rules (ex: .foo{})

● Use correct properties (ex: display:inline should not use heigh, width, margin,padding,float. Display:inline should not use float, display:block should not use vertical align.

● Do not Use ID as selector.

● Zero values do not need units.

● Avoid selectors that look like regular expressions. (ex: ~=)

● Avoid duplicate property.

Style CopWork in C# code only

Continue...Naming rule (ClassName, Method Name, Parameter Name).Curly Brackets For Multilines Statements Must not Share.Element Must Not Be A Single Line.Elements Must Be Separated By Blank LineCode Must Not Contain Multiple Blank Lines In A Row.Do Not Place Regions With in Elements.Use BuiltIn TypeAlias (Boolean => bool, Byte=>byte)Using Directives Must Be Placed Within Namespace.Constants Must Appear Before Fields.Property Accessors Must Follow Order (first get => next set).

Regex TesterA sequence of characters that define a search pattern.

Code SnippetSmall Block of Reusable code inserted in code file inserted by menu/hot keys.

● Create New● Use Existing● Update Existing

Example:● ctor + tab + tab => constructor creation.● Equals + tab + tab => Equl method creation.● Try +tab/ tryf + tab => try-catch / try-finally block.● prop + tab +tab => property● forr +tab / foreach +tab => for/foreach loop● Ctrl + k + b => snippet manager window

Web EssentialsCSS:

● Remove Duplicate Properties● Generate Vendor Specific => word-wrap● Add Missing Standard => -moz-transform : rotate(10deg)● Keep vendor specific in sync => -moz-border-radius: 50px● Extract to File

HTML:● Loren empsum generate (type lorem +tab)● Zen Coding (div.#id, div.class)● Region support (<!-- #regionName → <!-- #endregion -->

Productivity Power Tool

● Code block identification with light line.

● Solution error visualizer.

● Error filter.

● Ctrl + click for code definition.

● Double click to maximize window.● Power Commands => organize imports, Edit project file, Open command

prompt, copy project reference etc.

Smart DebuggingDebugging is twice as hard as writing the code in the first place. – Brian Kernighan

● What is Debugging? =>Test for errors or help to determine cause of errors. - wikipedia => MS VS Debugger, Attachment, execution suspend.

● Set/Enable/Disable/Toggle BreakPoint, Conditional BreakPoint, Step Into, Step Over, Step Out, Run to cursor, Set next statement, Modify Variables,

● Various Hotkeys(F9, Ctrl + F9)● Various Debug windows

Quick watch, Autos, Local, Thread, Call Stack, Immediate

● System.Diagnostics.Debugger class.

Top 11 Visual Studio Cool Features● Start Page● Bookmarking ( ctrl +k + k, ctrl + k + ctrl + w)● File/Member search from solution text box● Move Lines with keyboard (alt + up-arrow/ alt + down-arrow)● Navigate (ctrl + ,)● .NET Framework source trapping. i)

https://weblogs.asp.net/scottgu/net-framework-library-source-code-now-available ii)https://msdn.microsoft.com/en-us/library/cc667410.aspx

● Task List (//TODO:)● Comment as API documentation (<summary></summary>)● Code Map● Outlining (ctrl +M, ctrl + o)● Nuget Package Manager (www.nuget.org)

Resharper● A developer productivity extension for Visual Studio.

● If is not free. A Jetbrain product.

● Official site: https://www.jetbrains.com/resharper/Feature Category:

● Code Inspector

● Search & Navigation

● Refactoring

● Code Generation

● Code Assistance

Code Inspection● Red color indication when wrong (base class declaration)

● Import all the right namespaces at a time.

● Visual clue for unused namespace

● Object initializer

● Loop => lambda expression

● Null Checking Notification

Search & Navigation● Disassemble then show the code source

● Find reference more powerfull then built-in Visual Studio feature

● Interface implementation search.

● Search file (ctrl + t), Camel Case, weild card

● Search Type/Member

● Search symbol (ctrl + p)

● Current File Selection (ctrl + l)

● Navigate To

RefactoringsEffectively restructure code without changing functionality.

● Rename● Safe Delete● Class Refactoring (Separate class)● Move to File● Extracted method.● Implicit /Explicit Type● Convert to auto property● Identify Unused variable, unreachable code, Redundant else part and quick

fixes.

Code generation● Generate parameterized constructor

● Interface implementation (IEquable<T>)

● INotifyPropertyChanged(thread safe way)

● String interpolation.

● String to Json/ String to xml

● Derived Type.

Code Assistance● Looking all assembly with abbreviation (ex:inpc)

● Automatic add using statement (IDictionary<>)

● Show interface implemented classes (IDictionary<string, int>)

● Auto add assembly reference when type new type name.

● Go to code definition in external file or disassemble.

● Unit test runner

● Code analysis

Conclusion● Visual Studio features Vs Resharper features.

● Think about investment of money (license product).

● Set default hot key selection.

● Hardware checklist (4 GB free, SSD for resharper cache, 1 GM pagefile, 15% free disk).

● Compatibility issue (CodeRush, JustCode, Productivity Power Tool).

THANK YOU ALL!

top related