About:Fonts & Customization

DateTime.AfterPost - DateTime.Now = 3 minutes

I’m sure you’ve realized I’m not using one of the default fonts on this blog. Instead, I’m using FiraCode.

FiraCode logo

A few months ago I was introduced to this font by a co-worker.
Actually, it was more than that, I was introduced to the option to change the current font in Visual Studio. Never thought that the font is something I can (or want) to change.
He showed me this font and I’ve decided to give it a try.
It was really good, I really liked it.
FiraCode is a monospaced with programming ligatures font (to quote off their github page).

What’s that?
Monospaced font is a type of font where every character occupies the same space. It doesn’t matter if it’s an “i” or an “o”, both take the same amount of space.

Programming ligatures is when two (or more) letters get combined into a new letter that represents both. For example “>” and “=” gets converted into “>=”.

In the end, you get a source code that is much more readable and consumes less effort (* it took me a few days to get use to it).

And there is more!

Changing the font got me to realize there is much more stuff you can do that I didn’t ever think about.
For example, did you know you can create a field instance from your constructor?
Let’s say you create a constructor for a class Time:

public Time(uint hours, uint minutes, uint seconds) { }

Mostly you’ll want to save those parameters in inner fields.

Instead of creating them yourself, if you “ctrl + .” on one of them, you’ll see this context menu:

Choosing “Create and initialize field ‘hours’ will automagically create the field and initialize it in your constructor.

I hope you knew that (if not, even better, I got to teach you another thing!). But did you know you can change the format of the field being created?
What if I want the field to be named “_hours” and not “hours”?
Visual Studio lets you do that as well!
Go to

Options -> Text Editor -> C# -> Code Style -> Naming

Click on “Manage naming styles”
Click on the green “+” button
Fill the form like this (or however you want the field to be called):

Click on “OK” and then click on “OK” again.
Now click on the green “+” button.
And fill the new row like this:

Restart VS and Voila!

There are endless customizations available in Visual Studio (and I guess that many other IDEs let you do the same)

Comment on what things you customized in your VS!

No Comments

Add your comment