A Dozen Programmer Utilities

Two years ago, I made a list of my indispensable tools. Here is a quick updated version:

Lists are always subjective, but it is helpful, I think, to exchange favorites now and again. Feel free to add yours to the comments. Here’s my list in no particular order

  1. Visual Studio 2022 – goes without saying that this is the world’s best IDE for .NET developers. I use it 8-12 hours a day, it just keeps getting better, especially with CoPilot.
  2. Copilot – AI done right. Integrated with Visual Studio, this add-on is the most powerful and useful tool I have. It can get in the way a little, but when it does its stuff, watch out. Point it at a class and ask for documentation and/or unit tests and watch it go! But kids, don’t try this at home — it needs adult supervision.
  3. ExamDiffPro – there are lots of comparison/merge utilities. Get a good one.
  4. Tweaks by Mads Kristensen — small but very valuable addition to VS
  5. Viasfora – I can not believe how useful this is. Matches braces by color and in any “real” application, this can save a lot of time.
  6. Evernote: I use it to log everything I do, including every fix for recurring issues. It is quick, powerful, and easy to use. Although it has limitations, overall, I’ve found it helpful and reliable.
  7. LastPass – my password manager. I’d be lost without it. (1Password may be better, our mileage may vary)
  8. Git Diff Margin – if you use Git you’ll want to Git this. See what changed in the margin
  9. DB Browser for SQLite – If you are using SQLite, this is a must-have.
  10. BlueSky – the single best social media site for .NET programmers

Note that nearly all of these are free. I do remember the days when a program like Lotus 123 cost something in the hundreds of dollars. It makes me laugh when I see people look at an app and say, “$4, naah, too expensive.”

I am not affiliated with any of these.

As I say, grab these, and if there are others that you use, please note them in the comments.

Thanks

Posted in Essentials | 10 Comments

Where’d it go?

Apparently I have maxed out the number of files I can have! Rather than give up, I’ve decided to upgrade. Unfortunately, before doing so I deleted a lot of files trying to make room, and I over did it, deleting many of the images.

Once things settle down, I plan to try a restore and recover all my old files and images. Stay tuned.

Posted in Essentials | 1 Comment

API #9 – Tables

An important part of creating APIs is interacting with data storage. While you can use any number of database programs, a common way to store simple data is in data tables. This is particularly useful when you are recording API calls as part of your telemetry.

Storage tables are not inherently relational. The goal is to keep storage tables simple. This makes them ideal for keeping lists, logging, creating progress entries, and so forth.In this demo, we’ll create a storage table that tracks exceptions thrown during execution of our program. Let’s create a console app that just throws exceptions every few seconds.

Continue reading
Posted in Essentials | 3 Comments

1,000,000 Views!

jesseliberty.com just crossed 1MM views (lifetime). So pleased you’ve stuck with me. See find me in menu to continue the dialog.

Posted in Essentials | Leave a comment

Programming APIs Book

End of November, 2024.

Posted in Essentials | 10 Comments

Mads Torgersen and C# 13

Mads Torgersen, lead designer of C# joins me to talk about what’s new in C# 13 and much more

Posted in Essentials | Tagged | 2 Comments

Creating APIs Part 8: Validation

Performance is king (well, after accuracy) in APIs. Sending a request to the Database only to discover that the request is invalid is a waste of resources. Thus, we want to validate the request as soon as it hits the endpoint.

FluentValidation is a great tool for creating validators. It installs as a NuGet package. Also grab the version for ASP.Net.

To get going, add a using statement. 

Using FluentValidation 

Next, create a class that derives from AbstractValidator. 

public class CarNotDeletedValidator : AbstractValidator<Car> 

This example uses the Car class from my forthcoming book Creating .NET APIs with C#.

Put your validation rules in the constructor. Each rule is created by using the keyword RuleFor and a lambda expression that indicates which property you want to validate and the validation rule.

using Cars.Data.DTOs; 
using FluentValidation;
namespace Cars.Validators
{ 
    public class CarNotDeletedValidator : AbstractValidator<CarDto> 
    { 
        public CarNotDeletedValidator() 
        { 
            RuleFor(x => x.Is_Deleted).Equal("0"); 
        } 
    } 
}
The Equal operator is one of many that you can find at the FluentValidation documentation page: https://docs.fluentvalidation.net/en/latest/built-in-validators.html

We’ll test the data and then either compare it to what is valid and return an error if appropriate, or, more commonly, we’ll throw an exception if the data fails validation. 

Assuming that it passes validation we can continue to the Database. If however it fails, we can return a meaningful error to the sender.

Posted in Essentials | 3 Comments

Reboot!

This site has been quiet for a few months while I finish up my book (.NET APIs with C#). I’m happy to reboot both the blog and Yet Another Podcast, starting soon with an interview of Mads Torgerson (lead designer of C#)!

To get things rolling, I’m going to pick up my series on creating APIs, based on my forthcoming book (scheduled to be in bookstores mid-November).

I will be speaking at Boston Code Camp this November as well. In fact, once the election is passed (I’m spending 10+ hours/week on campaigning) I expect to be putting in a lot of time on this blog.

I hope you will join me as I get back to work providing (hopefully useful) information to the community.

As always, you can reach me at jesseliberty@gmail.com

Posted in Essentials | 6 Comments

NDepend

A dive into an amazing program for developers: NDepend

Posted in Essentials | Tagged , | 11 Comments

Scott Hunter – Aspire and more

Photo Scott Hunter

Scott Hunter (VP Microsoft) joins Yet Another Podcast’s reboot to talk about Aspire, Azure and much more. Do not miss this episode… Aspire will blow you away!

Links to follow.

Posted in Essentials | Tagged , | 2 Comments

API Part 7 – Swagger Comments

In the previous post, I introduced Swagger and showed how to set up your project for Swagger. In this post I will show how to add Swagger comments to annotate your program.

In earlier posts we looked at the database of cars and the Get method that retrieves the entire list. That can be quite a lot of data going over the wire. What we want instead is to send pages. I’ll show that briefly and then we’ll annotate that code.

In the CarController we’ll have a Get method that takes three parameters: showDeleted, pageNumber and pageSize. The first we’ve seen before, it determines whether the list returned to the caller will include our deleted records. The second, pageNumber, will designate which page of data we want to return (zero based). The third parameter, pageSize, will designate how many records to return per page.

Thus, if we were to write

Get(false,3,4)

we would expect to get back records 17, 18, 19 and 20, because page 0 would have records 1-4, page 1 would have 5-8, etc.

Continue reading
Posted in API, C#, Essentials | Tagged | 9 Comments

.NET APIs Part 6 – Swagger

This is part 6 in a series about building APIs in .NET using C#. The previous (part 5) entry is here, and the series starts here.

As you know, an API sits between a client and the back end. It is imperative for the client programmer to know not only what an API does, but what the URL is, what verbs it supports and what parameters are available.

Fortunately, there is an open standard and free server: Open API and Swashbuckle. You install these once for each project and then you can just use them, as we’ll see.

This post will show you how to install them, using Visual Studio. You’ll obtain the bits you need using NuGet. Start by installing Swashbuckle.AspNetCore.

Go to your project’s properties and choose Application and Console Application. Then choose Output under Build and scroll down to where you can check “Generate a file containing API documentation”

Continue reading
Posted in API, C# | Tagged | 4 Comments