<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Scott Hintze</title>
    <description>The latest articles on Forem by Scott Hintze (@shintze).</description>
    <link>https://forem.com/shintze</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F681343%2F6b1d4602-2306-4182-9247-ee70c085c0f0.jpg</url>
      <title>Forem: Scott Hintze</title>
      <link>https://forem.com/shintze</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shintze"/>
    <language>en</language>
    <item>
      <title>Supercharge Your Coding in Visual Studio</title>
      <dc:creator>Scott Hintze</dc:creator>
      <pubDate>Thu, 12 Aug 2021 20:04:36 +0000</pubDate>
      <link>https://forem.com/dealeron/supercharge-your-coding-in-visual-studio-159h</link>
      <guid>https://forem.com/dealeron/supercharge-your-coding-in-visual-studio-159h</guid>
      <description>&lt;h1&gt;
  
  
  Keyboard Shortcuts
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Hold Down Alt when Selecting Text
&lt;/h2&gt;

&lt;p&gt;Let’s say you have a list of variables and you decide to change the scope from public to protected. You could use find and replace on the selected text, or you could just copy/paste over each modifier. Another option is block selecting. Holding down the Alt key while selecting allows you to include multiple lines to the position of the cursor rather than the entire line. The result is that when you type, cut or paste, it applies to every line selected. You could select all the public modifiers and simply type or paste protected to edit them all at once.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvmwbttnay9944knol3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvmwbttnay9944knol3.png" title="Block Selection Image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ctrl + X and Ctrl + V with nothing selected
&lt;/h2&gt;

&lt;p&gt;Cut and paste? What is so special about these? In Visual Studio. If you have nothing selected, the cut command will cut the entire line and paste will insert the entire line above the cursor. When moving lines around, this method is very fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ctrl + K + C (comment) and Ctrl + K + U (uncomment) with nothing selected
&lt;/h2&gt;

&lt;p&gt;These commands will comment and uncomment the entire line when no text is selected. When text is selected, they will comment and uncomment the selection. The uncomment shortcut will uncomment even if no text is selected as long as the cursor is within commented code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Commenting
&lt;/h3&gt;

&lt;p&gt;As nice as the default comment shortcuts are, you still have to use both hands. That can get tedious if you are doing a lot. Here is an easier combo to make it even faster.&lt;br&gt;
Go to Tools&amp;gt;Options, then find the Environment&amp;gt;Keyboard node.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9tsnv9rz77spucehgzo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9tsnv9rz77spucehgzo.png" title="Better comments step 1 image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the “Show commands containing box” enter “comment” (no quotes).&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbc4fg5rkglhx92pfkk8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbc4fg5rkglhx92pfkk8.png" title="Better comments step 2 image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the Edit.ToggleLineComment shortcut and click in the “Press shortcut key” input field. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8gnpg7it2wxj46yhfia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8gnpg7it2wxj46yhfia.png" title="Better comments step 3 image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press Left Ctrl + Left Windows, then click “Assign”&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wm5cmcsus7af2p8vzc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wm5cmcsus7af2p8vzc1.png" title="Better comments step 4 image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repeat the process for Edit.UncommentSelection using Left Alt + Left Windows&lt;/p&gt;

&lt;p&gt;Setting these shortcuts allows you to keep one hand on the mouse or arrow keys to navigate the code and the other to comment and uncomment quickly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Visual Studio has a Back Button?!
&lt;/h1&gt;

&lt;p&gt;Ever feel you are a bit like Alice and falling down the rabbit hole when navigating code? Visual Studio has a back button that tracks a history of where your cursor has been. Just click to go back through and retrace your steps. You can also click the down arrow to see the history list.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnb8iib5uiqx87s9w7euq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnb8iib5uiqx87s9w7euq.png" title="Visual Studio back button image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Tedious Code
&lt;/h1&gt;

&lt;p&gt;Repetitive code, such as mapping database tables to object models, can be a real downer to a good programming groove. Here’s how to use simple Excel formulas to write hundreds of lines of code in seconds.&lt;br&gt;
Get a list of the variable names or database fields without any extra punctuation. Then, paste the list into column A of your blank Excel sheet.&lt;br&gt;
Excel string formulas are fairly straightforward. The basic syntax is =”string literal” &amp;amp; A1 &amp;amp; “string literal”. The quotes indicate literal text. Use ”” to escape a double quote in the string. Let’s say your variable name is Id and is located in the A1 cell of your sheet and you want to create a public string accessor property for it. The formula would be &lt;code&gt;=”public string ” &amp;amp; TRIM(A1)  &amp;amp; “{ get; set; }”&lt;/code&gt; Now, you just use the Excel fill handle and pull it down your list to "write" that line of code for each variable.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxb2w98pzt0fabiit1p2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxb2w98pzt0fabiit1p2.png" title="Excel coding step 1 image" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowjuvdjvogfoug4gkuoi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowjuvdjvogfoug4gkuoi.png" title="Excel coding step 2 image" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
  </channel>
</rss>
