VB'NET Tips and Tricks - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

VB'NET Tips and Tricks

Description:

Snippets. Very handy way to add often used code. Difficult to build, XML formatted file ... Snippet Designer. http://www.codeplex.com/SnippetDesigner. Yslow ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 23
Provided by: magna8
Category:
Tags: net | snippets | tips | tricks

less

Transcript and Presenter's Notes

Title: VB'NET Tips and Tricks


1
VB.NET Tips and Tricks
Chris Bennett
Crowe Horwath LLP
2
  • Topics
  • Visual Basic.Net Tips Tricks
  • Visual Studio Tips Tricks
  • Tools

3
VB.NET - Tips and Tricks
4
  • Using Statement

Dim dc As DB_LINQDataContext Try dc New
DB_LINQDataContext() ... Finally
dc.Dispose() End Try
Using dc As New DB_LINQDataContext
... End Using
5
  • Why Using Statements?
  • Simplifies Code
  • Automatic Disposing of Classes

6
  • LINQ

Using dc As New DB_LINQDataContext
Dim query From c In dc.Customers _
Select c End Using
7
  • Why LINQ
  • Unified access to SQL Tables, Collections, JSON,
    etc
  • Allows SQL -gt Collection Joins
  • Extremely Flexible

8
  • LINQ breeds bad habits
  • Essentially Inline SQL
  • Build a DAL layer
  • We forget performance since LINQ can just about
    do it all
  • LINQ performs its own optimizations on queries
  • Almost?

9
  • LINQ Short Cut Performance Issues
  • Returns All Rows
  • Searches for match (In Memory)
  • Returns Matches

Using dc As New DB_LINQDataContext dc.Customers
.ToList().Find( ... ) End Using
10
  • LINQ Performance Short Cut
  • Perform SQL Select using Where Clause
  • Returns only those rows from the database

Using dc As New DB_LINQDataContext dc.Customers
.Where( ) End Using
11
  • Implicit Typing
  • Dont use it !
  • (Unavoidable using LINQ)

Dim a 5 Dim s This is a String
12
  • New Object Initializers

Dim myThread As New Thread(AddressOf
MyThreadMethod) With .Name "my thread",
.IsBackground True
13
Visual Studio - Tips and Tricks
14
  • Ghost Doc
  • Rules based engine for documenting function
  • Rules are based upon the name of the function
  • (VB.Net Support is Experimental)

15
Ghost Doc Demo
16
  • Snippets
  • Very handy way to add often used code
  • Difficult to build, XML formatted file
  • New Snippet Designer

17
Snippet Designer Demo
18
Web Tools
19
  • Source Code Converter
  • http//www.developerfusion.com/tools/convert/vb-to
    -csharp/
  • IE Developer Toolbar (Internet Explorer)
  • Firebug (Firefox)
  • YSlow

20
Web Tool Demo
21
  • Additional Information
  • Ghost Doc
  • http//www.roland-weigelt.de/ghostdoc/
  • Snippet Designer
  • http//www.codeplex.com/SnippetDesigner
  • Yslow (Firebug Add-on)
  • https//addons.mozilla.org/en-US/firefox/addon/184
    3
  • http//developer.yahoo.com/yslow/

22
Questions
  • Chris L Bennett
  • chris.bennett_at_crowehorwath.com
  • www.ChrisLBennett.com
Write a Comment
User Comments (0)
About PowerShow.com