Creating Code Snippets in C# - Customize Visual Studio for Efficiency

preview_player
Показать описание
Code snippets in Visual Studio can make you much more efficient. In this video, we are going to look at how easy it is to create our own code snippets to make our development even faster. We will learn how to optimize our environment to become faster and more consistent in our coding. We will create snippets for C# and for HTML and we will see how easy it is to create snippets for other languages such as XAML, CSS, and more.

0:00 - Intro
1:41 - Creating demo application
3:00 - Code snippets: few built in snippets, ease of use
6:00 - Creating a code snippet in VSCode
14:18 - Import code snippet in Visual Studio
17:31 - Creating a code snippet: quick recap
22:40 - HTML snippet
28:30 - Advanced snippets
30:38 - Creating advanced snippet
34:35 - Creating advanced snippet: Declarations - variables in the code snippet
43:46 - Conclusions and concluding remarks
Рекомендации по теме
Комментарии
Автор

Thanks, Tim!
Another advantage of snippets is that they help me stay focused on what I want to do, rather than trying to remember the "how".

jimsmith
Автор

0:00 - Intro
1:41 - Creating demo application
3:00 - Code snippets: few built in snippets, ease of use
6:00 - Creating a code snippet in VSCode
14:18 - Import code snippet in Visual Studio
17:31 - Creating a code snippet: quick recap
22:40 - HTML snippet
28:30 - Advanced snippets
30:38 - Creating advanced snippet
34:35 - Creating advanced snippet: Declarations - variables in the code snippet
43:46 - Conclusions and concluding remarks

RalfsBalodis
Автор

Another great in-depth tutorial! Wasn‘t even aware of using such a cool feature, thx!

mantisk
Автор

Really appreciate your work Tim! One of the best (probably the best) C# tutorials available on the internet!

heshanlk
Автор

This video deserves receiving more likes !
Thank you Tim for the effort

ShawkyShamy
Автор

Great video. I can now layout regions in my classes, add methods, and specify fields and local variables by simply typing a couple of characters and tabbing twice. It really saves a lot of time. Thanks alot.

jameslacey
Автор

You are a legend! For every topic that i needed some instructions so far regarding C# you had a tutorial.

aleksandarmatejic
Автор

This is great! Thanks for the video. I'll be using this, plus whatever I can learn about debugging to make my life easier.

xhephergaming
Автор

Thanks Tim. Very well produced video, great content, and very helpful.

PaulFWatts
Автор

Man, you're just awesome. This is epic 🙌

DrWambua
Автор

It's a so wonderful course. I ensure I can speed my coding a lot. Thank Tim Corey for his elaborative course!

bohuang
Автор

Awesome stuff! Thankyou, already speeding things up!

eldonpreston
Автор

Created a custom snippet based on video and code samples. Thank you Tim!

garyfirzon
Автор

Ingenious. Just saved me 2 hours/day :)
Made a snippet for xUnit [Fact] block. Jeez, things are going great now and way faster

alevsoft
Автор

This is a huge time saver. Thanks for sharing.

caseyspaulding
Автор

I like to separate my classes into regions. It just makes it easy for me. So i made a snippet for that. The one im proud of is my method snippet. Just specify the return, name, and params and done!
This inspired me to make a console app that copies my snippets into the VS folder for me because of how annoying the snippet manager can be.
I got on the struggle bus about 3 months ago and figured it out, eventually. Im glad you made this. No more headaches. Thank you for basically teaching me everything I know. I cant be more thankful.

nynjalantz
Автор

Great in-depth tutorial. It really save my time and defiantly increase productivity. Thank you so much sir.

nandkishorsonwale
Автор

Hi Tim,

I’ve been using code snippets since VS 2005 and in my opinion, they are the single greatest thing that Microsoft has added to Visual Studio. I’ve written code snippets to outline entire UI pages (search, view, add, edit, and audit pages), my code behind (yes, I still use WebForms) and business logic classes. Because these snippets are large, I found that putting a comment at the beginning of the snippet that includes all of the parameters contained within the snippet very useful. I include several TODO: comments and commented out examples to remind me of tasks I need to complete and the syntax I need to use when working with certain objects/methods. Since my snippets references other classes/methods outside of the snippet, establishing a consistent coding pattern and naming convention is critical as it allows me to make certain assumptions when creating my snippets.


Snippets have greatly reduced my coding time and made my applications a lot more consistent than it would be if I had to create everything from scratch each time I added a class.


Thank you for all of your videos. I have found them very helpful.

JasonWynn
Автор

Thank you for the awesome video. In the end you talk about time saving, but I would like to add another (possibly even more important than time) benefit: it reduces decision fatigue. So in addition to saving time, it can add more productive coding time into your day because you have more mental energy left for the important stuff.

peckdec
Автор

Lol I was at 22:30 wondering to myself if I could use this for HTML and you were right there with me.

mrterrbl