Monday, March 31, 2014

Improve productivity using Visual Studio Add-Ins - Free Stuff

Here's the ones that make my life better.

Productivity Power Tools 2013


A set of extensions to Visual Studio Professional (and above) which improves developer productivity.

Summary of features

  1. Peek Help
  2. Solution Explorer Errors
  3. Structure Visualizer
  4. Double click to maximize windows
  5. Timestamp margin
  6. Quick tasks – Edit Present On
  7. Ctrl + Click to Peek Definition
  8. HTML Copy improvements
  9. Recently Closed Documents
  10. Match Margin
  11. Power Commands context menu cleanup
  12. Quick Tasks
  13. Power Commands
  14. Color printing
  15. Middle-Click Scrolling 
  16. Organize Imports for Visual Basic
  17. Custom Document Well
  18. Tools Options Support
  19. HTML Copy
  20. Fix Mixed Tabs
  21. Ctrl + Click Go To Definition
  22. Align Assignments
  23. Column Guides
  24. Colorized Parameter Help 


CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, JavaScript and TypeScript coding.

Summary of features

  1. Code Cleaning
  2. Code Digging
  3. Reorganizing
  4. Formatting
  5. Collapsing
  6. Progressing
  7. Configuring
  8. Switching
  9. Joining
  10. Finding
NuGet Package Manager


A collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project.


Adds many useful features to Visual Studio for web developers.



SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.



Code Compare is an advanced file and folder comparison tool. This programming languages oriented diff tool can be used as a Visual Studio add-in and as a standalone application.



GhostDoc is a Visual Studio extension that automatically generates XML documentation comments for methods and properties based on their type, parameters, name, and other contextual information.

Benefits

  • Save keystrokes and time
  • Simplify documenting your code
  • Benefit of the base class documentation
  • StyleCop compliant documentation templates
  • XML Comment Preview

An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. Extra options are available to control how elements and attributes in XML and MAML files are spell checked.



SQL Server Compact 3.5 and 4.0 Toolbox add-in for Visual Studio. This add-in adds several features to help your SQL Server Compact development efforts: Scripting of tables and data, import from SQL Server and CSV files and much more.


Another must have tool for developers - LINQPad

Wednesday, January 15, 2014

Lazy Initialization

Lazy initialization is an amazing feature which is introduced with .NET 4.0


Lazy initialization means delaying initialization until a object or component is used.

Advantages.
* Improve performance
* Avoid wasteful computations
* Reduce program memory requirements

Real life situations for apply.

Users don't have to pay initialization time for features they will not use. Suppose you were initialize some components of your application up front. This will slowdown the application startup and users would have to wait dozens of seconds or minutes before application is ready to use.They are waiting on initialization of features that they may never use or not use right away.

If you defer initializing those components until its use time, your application will start up much quicker.

Quick demo :-

Classes :

    public class Subject{string id;}

    public class Student
    {
        private readonly Lazy<Subject> lazySubjects;
        private readonly Subject subject;

        public int Id { get; set; }
        public string Name { get; set; }

        public Subject LazySubject
        {
            get { return this.lazySubjects.Value; }
        }

        public Subject Subject
        {
            get { return this.subject; }
        }

        public Student()
        {
            lazySubjects = new Lazy<Subject>();
            subject = new Subject();
        }
    }

Test method :

 public MainWindow()
        {
            //Create Student object as lasy initialization
            Lazy<Student> studentObject = new Lazy<Student>(true);

            //Check whether Student object is actually created or not
            bool isStudentCreated = studentObject.IsValueCreated;

            //Sets the id of the Student
            studentObject.Value.Id = 1;

            //Check whether Student object is actually created after getting the customer Id
            bool isStudentCreatedFinish = studentObject.IsValueCreated;
        }

Here you can see the object is not getting initialized until you are accessing it.

Reference : http://msdn.microsoft.com/en-us/library/dd997286(v=vs.110).aspx