C# constructors naming convention -


i new c# , i've seen different styles use constructor. of tutorials on year old. best practice today?

class book {     //class properties     private string title;     private int pages; 

variation 1:

    public book(string title, int pages)     {         this.title = title;         this.pages = pages;     } 

variation 2:

    public book(string _title, int _pages)     {         title = _title;         pages = _pages;     } 

variation 3:

    public book(string booktitle, int numberofpages)     {         title = booktitle;         pages = numberofpages;     } } 

this popular way

class book {     //class properties     private string _title;     private int _pages;      public book(string title, int pages)     {         _title = title;         _pages = pages;     } } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -