SlideShare uma empresa Scribd logo
1 de 35
Microsoft Visual Studio 2012|Code Tips
Usman ur Rehman Ahmed
Audience Marketing Manager (AMM), Microsoft Pakistan
Code Pointers
NAMED
REGIONS
DRAG & DROP
CODE
INTELLISENSE CTRL + SPACE
QUICK LAUNCH
Ctrl + Q
PREVIEW
TAB
SEARCH AND
SYNC
CODE CLONE
ANALYSIS
AUTO –
IMPLEMENTED
PROPERTIES
GO TO
DEFINITION
CODE
MAP
SURROUND
WITH
LINES OF
CODE
DISPLAY NUMER
OF LINES
ALL IN ONE
CODE
FRAMEWORK
GO TO SPECIFIC
LINE NUMBER
PASCAL CASE
TYPING
METHOD
NAMING
METHOD
CHAINING
OFFLINE
HELP
ALT +
HIGHLIGHT
COMMENT
CODE BLOCK
USE PHYSICAL
KEYBOARD ON
EMULATOR
Equals(object);
GetHashCode();
GetType();
ToString();
# region
# endregion
– lets you specify a block of code that
you can expand or collapse
– #region name
– name is the name you want to give to
the region
– The region block must be terminated
with a #endregion directive
NAMED
REGIONS
Paste Code Blocks in Toolbox
– You can reuse the code without having
to type over and over again
– Place it in a toolbox under one of the
sections or create your own one
– Drag and drop as required
– It will now be available in all your
projects
DRAG & DROP
CODE
Select a code block (highlight it)
Drag and Drop to Toolbox (recommended: rename)
Ctrl Key
– IntelliSense provides
an array of options
that make language
references easily
accessible.
– Auto - suggestions
– Hold down the Ctrl key
to see through the
code hidden behind
the IntelliSense
INTELLISENSE
CTRL + SPACE
Display IntelliSense
QUICK LAUNCH
Ctrl + Q
Ctrl + Q
Menus
@menu
Most Recently
Used
@mru
Options
@opt
Open
Document
@doc
Solution Explorer -> Preview Selected Items
PREVIEW
TAB
Solutions Explorer -> Search & Sync
– Enter keyword to Search for
results within the project
SEARCH AND
SYNC
– Sync Solutions Explorer to
the currently active tab
Similar fragments of code
– Separate fragments of code
that are very similar
– Find clones and refactor them
– Find clones of a specific
fragment or find all clones in
your solution
CODE CLONE
ANALYSIS
Double Click a Clone Entry
Code Clones in Entire Solution
– "Analyze solution for Code Clones" is only available in Ultimate
and Premium editions of Visual Studio 2012
What is Found?
• Renamed Identifiers
• Insert and delete
statements added
• Rearranged statements
What is Not Found?
• Type declarations are not
compared
• Analyze Solution for Code
Clones will not find clones
that are less than 10
statements long. However,
you can apply Find matching
clones in solution to shorter
fragments
• InitializeComponent
methods
PROP / PROPFULL
– prop
• public string Name{get; set;}
– propfull
• private string _Name;
public string Name
{
get { return _Name; }
set { _Name=value; }
}
AUTO –
IMPLEMENTED
PROPERTIES
GO TO
DEFINITION
Seeing is Believing
– Visualize Code
– Point and click your way through
complex code hierarchy
CODE
MAP
Ctrl + K,S
SURROUND
WITH
One Job for One Method
– There should be only one job for one
method
– Ideally, seven to thirty lines of code in
one method
LINES OF
CODE
Tools -> Options -> Text Editor ->
All Languages -> Line Numbers
DISPLAY NUMER
OF LINES
Group related code together
– Code related to one
instance should be
together
– E.g. properties related
to one TextBlock
should be together
ALL IN ONE
CODE
FRAMEWORK
Ctrl + g
– Specify the line number
– You will be jumped to that line
automatically
GO TO SPECIFIC
LINE NUMBER
Pascal Case Methods
– Type initials of every pascal case
methods
– E.g. BookAnotherFlight will be
accessible by BAF
PASCAL CASE
TYPING
Noun-Verb Convention
– Use verbs or verb cases to name
methods
– Verbs describe the action
– Use Pascal Case
• RemoveAll()
• GetCharArray()
• GroupedItem()
METHOD
NAMING
Invoke Multiple Method Calls
– Core concept behind it is to allow for
better readability
– Reduces the amount of code
METHOD
CHAINING
Offline Help Content
– Help ->
– Set Help Preferences ->
– Launch in Help Viewer
– Help -> View Help
OFFLINE
HELP
Highlight text vertically
ALT +
HIGHLIGHT
Comment Chunks of Code
–COMMENT:
• Ctrl + KC
–UNCOMMENT:
• Ctrl + KU
–/// <summary>
COMMENT
CODE BLOCK
Page up / page
down Key
USE PHYSICAL
KEYBOARD ON
EMULATOR
OBJECT Class
– Ultimate base class of all classes, all classes derived from it
(parent class of every other class)
– Inheritance not required to be declared as it is implicit.
– FOUR methods of OBJECT class available by default in a class’s
object
• Equals(Object) – Determines whether the specified object is
equal to the current object.
• GetHashCode() – Generates a number corresponding to the
value of the object to support the use of a hash table.
• GetType() – Gets the Type of the current instance.
• ToString() – Returns a string that represents the current
object.
Equals(object);
GetHashCode();
GetType();
ToString();
Visual studio2012 tipsandtricks

Mais conteúdo relacionado

Mais procurados

Mais procurados (9)

What is new in J2SE 5
What is new in J2SE 5What is new in J2SE 5
What is new in J2SE 5
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Flow or Type - how to React to that?
Flow or Type - how to React to that?Flow or Type - how to React to that?
Flow or Type - how to React to that?
 
Clean code: meaningful Name
Clean code: meaningful NameClean code: meaningful Name
Clean code: meaningful Name
 
Standards For Java Coding
Standards For Java CodingStandards For Java Coding
Standards For Java Coding
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
 
Common Programming Paradigms
Common Programming ParadigmsCommon Programming Paradigms
Common Programming Paradigms
 
XKE - Programming Paradigms & Constructs
XKE - Programming Paradigms & ConstructsXKE - Programming Paradigms & Constructs
XKE - Programming Paradigms & Constructs
 
Algorithms&flowcharts
Algorithms&flowchartsAlgorithms&flowcharts
Algorithms&flowcharts
 

Destaque

UI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowUI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowTung Nguyen Thanh
 
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.iotviet
 
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]leduyk11
 
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...MasterCode.vn
 
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoBài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoMasterCode.vn
 

Destaque (7)

UI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowUI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flow
 
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
 
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
 
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise ViettinsoftTài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
 
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoBài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
 

Semelhante a Visual studio2012 tipsandtricks

Writing Good Code
Writing Good CodeWriting Good Code
Writing Good CodeLeo Liang
 
Advanced Debugging in XCode
Advanced Debugging in XCodeAdvanced Debugging in XCode
Advanced Debugging in XCodeMichelBueno10
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptxStefan Oprea
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)Concentrated Technology
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOEPatil Shreyas
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - RefactoringDiaa Al-Salehi
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
SF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSebastian Wagner
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean CodingMetin Ogurlu
 
Programming in Java: Getting Started
Programming in Java: Getting StartedProgramming in Java: Getting Started
Programming in Java: Getting StartedMartin Chapman
 
Writing maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeWriting maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeDonald Bales
 

Semelhante a Visual studio2012 tipsandtricks (20)

Writing Good Code
Writing Good CodeWriting Good Code
Writing Good Code
 
Code quality
Code qualityCode quality
Code quality
 
Advanced Debugging in XCode
Advanced Debugging in XCodeAdvanced Debugging in XCode
Advanced Debugging in XCode
 
Code Quality
Code QualityCode Quality
Code Quality
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
L05 Design Patterns
L05 Design PatternsL05 Design Patterns
L05 Design Patterns
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOE
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Ma3696 Lecture 3
Ma3696 Lecture 3Ma3696 Lecture 3
Ma3696 Lecture 3
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
SF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSF1 - Apex Development Best Practises
SF1 - Apex Development Best Practises
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean Coding
 
Programming in Java: Getting Started
Programming in Java: Getting StartedProgramming in Java: Getting Started
Programming in Java: Getting Started
 
Writing maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeWriting maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL code
 

Mais de Tung Nguyen Thanh

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developerTung Nguyen Thanh
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design IntroductionTung Nguyen Thanh
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Tung Nguyen Thanh
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationTung Nguyen Thanh
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabaseTung Nguyen Thanh
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group IntroductionTung Nguyen Thanh
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic websiteTung Nguyen Thanh
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new featuresTung Nguyen Thanh
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integrationTung Nguyen Thanh
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit testTung Nguyen Thanh
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightTung Nguyen Thanh
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTung Nguyen Thanh
 

Mais de Tung Nguyen Thanh (20)

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developer
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group Introduction
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic website
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Refactoring code in .net
Refactoring code in .netRefactoring code in .net
Refactoring code in .net
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new features
 
Whatmakesoftwareflexible
WhatmakesoftwareflexibleWhatmakesoftwareflexible
Whatmakesoftwareflexible
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integration
 
Xp not windows xp
Xp not windows xpXp not windows xp
Xp not windows xp
 
Is xp still extreme
Is xp still extremeIs xp still extreme
Is xp still extreme
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit test
 
Windows Phone Introduction
Windows Phone IntroductionWindows Phone Introduction
Windows Phone Introduction
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlight
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
 

Último

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Último (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Visual studio2012 tipsandtricks

  • 1. Microsoft Visual Studio 2012|Code Tips Usman ur Rehman Ahmed Audience Marketing Manager (AMM), Microsoft Pakistan
  • 2. Code Pointers NAMED REGIONS DRAG & DROP CODE INTELLISENSE CTRL + SPACE QUICK LAUNCH Ctrl + Q PREVIEW TAB SEARCH AND SYNC CODE CLONE ANALYSIS AUTO – IMPLEMENTED PROPERTIES GO TO DEFINITION CODE MAP SURROUND WITH
  • 3. LINES OF CODE DISPLAY NUMER OF LINES ALL IN ONE CODE FRAMEWORK GO TO SPECIFIC LINE NUMBER PASCAL CASE TYPING METHOD NAMING METHOD CHAINING OFFLINE HELP ALT + HIGHLIGHT COMMENT CODE BLOCK USE PHYSICAL KEYBOARD ON EMULATOR Equals(object); GetHashCode(); GetType(); ToString();
  • 4. # region # endregion – lets you specify a block of code that you can expand or collapse – #region name – name is the name you want to give to the region – The region block must be terminated with a #endregion directive NAMED REGIONS
  • 5. Paste Code Blocks in Toolbox – You can reuse the code without having to type over and over again – Place it in a toolbox under one of the sections or create your own one – Drag and drop as required – It will now be available in all your projects DRAG & DROP CODE
  • 6. Select a code block (highlight it) Drag and Drop to Toolbox (recommended: rename)
  • 7. Ctrl Key – IntelliSense provides an array of options that make language references easily accessible. – Auto - suggestions – Hold down the Ctrl key to see through the code hidden behind the IntelliSense INTELLISENSE
  • 8. CTRL + SPACE Display IntelliSense
  • 9. QUICK LAUNCH Ctrl + Q Ctrl + Q Menus @menu Most Recently Used @mru Options @opt Open Document @doc
  • 10. Solution Explorer -> Preview Selected Items PREVIEW TAB
  • 11. Solutions Explorer -> Search & Sync – Enter keyword to Search for results within the project SEARCH AND SYNC – Sync Solutions Explorer to the currently active tab
  • 12.
  • 13.
  • 14. Similar fragments of code – Separate fragments of code that are very similar – Find clones and refactor them – Find clones of a specific fragment or find all clones in your solution CODE CLONE ANALYSIS
  • 15. Double Click a Clone Entry
  • 16. Code Clones in Entire Solution – "Analyze solution for Code Clones" is only available in Ultimate and Premium editions of Visual Studio 2012
  • 17. What is Found? • Renamed Identifiers • Insert and delete statements added • Rearranged statements What is Not Found? • Type declarations are not compared • Analyze Solution for Code Clones will not find clones that are less than 10 statements long. However, you can apply Find matching clones in solution to shorter fragments • InitializeComponent methods
  • 18. PROP / PROPFULL – prop • public string Name{get; set;} – propfull • private string _Name; public string Name { get { return _Name; } set { _Name=value; } } AUTO – IMPLEMENTED PROPERTIES
  • 20. Seeing is Believing – Visualize Code – Point and click your way through complex code hierarchy CODE MAP
  • 22. One Job for One Method – There should be only one job for one method – Ideally, seven to thirty lines of code in one method LINES OF CODE
  • 23. Tools -> Options -> Text Editor -> All Languages -> Line Numbers DISPLAY NUMER OF LINES
  • 24. Group related code together – Code related to one instance should be together – E.g. properties related to one TextBlock should be together ALL IN ONE CODE FRAMEWORK
  • 25. Ctrl + g – Specify the line number – You will be jumped to that line automatically GO TO SPECIFIC LINE NUMBER
  • 26. Pascal Case Methods – Type initials of every pascal case methods – E.g. BookAnotherFlight will be accessible by BAF PASCAL CASE TYPING
  • 27. Noun-Verb Convention – Use verbs or verb cases to name methods – Verbs describe the action – Use Pascal Case • RemoveAll() • GetCharArray() • GroupedItem() METHOD NAMING
  • 28. Invoke Multiple Method Calls – Core concept behind it is to allow for better readability – Reduces the amount of code METHOD CHAINING
  • 29. Offline Help Content – Help -> – Set Help Preferences -> – Launch in Help Viewer – Help -> View Help OFFLINE HELP
  • 30.
  • 32. Comment Chunks of Code –COMMENT: • Ctrl + KC –UNCOMMENT: • Ctrl + KU –/// <summary> COMMENT CODE BLOCK
  • 33. Page up / page down Key USE PHYSICAL KEYBOARD ON EMULATOR
  • 34. OBJECT Class – Ultimate base class of all classes, all classes derived from it (parent class of every other class) – Inheritance not required to be declared as it is implicit. – FOUR methods of OBJECT class available by default in a class’s object • Equals(Object) – Determines whether the specified object is equal to the current object. • GetHashCode() – Generates a number corresponding to the value of the object to support the use of a hash table. • GetType() – Gets the Type of the current instance. • ToString() – Returns a string that represents the current object. Equals(object); GetHashCode(); GetType(); ToString();

Notas do Editor

  1. The green highlighting shows the last items that were added to the map. The green arrow shows your cursor’s position in the code. Arrows between items represent different relationships. You can get more info about items on the map by examining their tooltips.the Visual Studio suite of products utilizes an XML language called Directed Graph Markup Language (DGML) to describe and define graphs. DGML is used to generate Code Maps in Visual Studio 2012.