Don’t Miss Mads Torgersen on C# 8 and 9

A few weeks back we had Mads Torgersen on Yet Another Podcast. It is too good and too important to miss.

Posted in Essentials | Tagged | Comments Off on Don’t Miss Mads Torgersen on C# 8 and 9

Interactive Rebase

Following along from my previous blog post on rebasing, this post will cover interactive rebasing.

The first thing to know about interactive rebasing is that as far as the programmer is concerned it has nothing to do with rebasing. The principal purpose of Interactive Rebase is to clean up your commits before you push them to the server.

To see this at work, let’s create the world’s dumbest C# program. For this purpose I assume you have git installed along with Visual Studio 2019 and that you have an account on GitHub. If not, they are all free, so go get ’em and I’ll wait here.

All set? OK, let’s create a C# Console app called dumbApp on GitHub

Continue reading
Posted in Essentials | Comments Off on Interactive Rebase

You Already Know Git

In celebration of my newest book: Git For Programmers I’m starting a short series of blog posts on some of the more interesting features of Git.

You already know Git

These posts assume you know what Version Control is and why you want it. I even assume you’ve been exposed to Git because Stack Overflow says 93% of programmers have. So these posts will be the fun stuff.

Let’s dive in to one of the most confusing aspect of Git for many programmers: Rebasing. When you say rebasing, many programmers run from the room pulling their hair and crying.

But Rebasing is really not that bad. In fact, it is pretty straight forward.

Rebasing

Let’s say you are working on a branch (you do your work on a branch, right??) and you want to merge the main into your branch to reduce the probability of conflicts later.

If your feature branch branched off of the latest commit from main, no problem, you do the merge, and Git will do a fast forward for you…

Continue reading
Posted in Essentials | Tagged | Comments Off on You Already Know Git

Jeff Fritz on Blazor, Azure & Much More

Much is in .NET 5, much more is coming in .Net 6. Jeff and I explore all the new goodies.

Links will be posted soon.

Posted in Essentials | Tagged | Comments Off on Jeff Fritz on Blazor, Azure & Much More

Mark Price on C#9 and .NET 6

Mark Price, author of C# 9 and .NET 5 – Modern Cross Platform Development comes on to talk about, well…C# 9 and .NET 5, and also modern cross Platform Development

Posted in .NET 5, .Net 6, C#, C# 9, Essentials | Tagged , | Comments Off on Mark Price on C#9 and .NET 6

C# 9 Series

In case you missed it, here is an aggregation of the five podcasts we’ve done on C# 9 recently.

Posted in Essentials | Comments Off on C# 9 Series

.NET Documentation & C# 9

Bill Wagner of the C# 9 Documentation team at Microsoft talks about changes and improvements to the Microsoft documentation as well as key features in C# 9

What’s new in C# 9:  https://docs.microsoft.com/dotnet/csharp/whats-new/
Explore Record types: https://docs.microsoft.com/dotnet/csharp/whats-new/tutorials/records
Records reference: https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/record
Explore Pattern matching: https://docs.microsoft.com/dotnet/csharp/whats-new/tutorials/patterns-objects
Pattern matching tutorial: https://docs.microsoft.com/dotnet/csharp/tutorials/pattern-matching
Patterns reference: https://docs.microsoft.com/dotnet/csharp/language-reference/operators/patterns

Posted in C# 9 | Tagged , | Comments Off on .NET Documentation & C# 9

.NET Maui Preview 3

Is here! Read David Ortinau’s blogpost

Posted in Essentials | Comments Off on .NET Maui Preview 3

C For Fun

Old but gold…

/*
* find the important things in Life, the Universe, and Everything
*/

typedef short some; /* some things are short */
typedef some very; /* some things are very short */

#define A /* The first letter of the English Alphabet */
#define LINE 2 /* 2 points define a line */

#define TRUTH BEAUTY /* truth is beauty */
#define BEAUTY 10 /* and beauty is a 10 */

#define bad char /* burnt on both sides */
#define old char /* the great Chicago Fire */

#define get strlen /* during your life, try to get some sterling */
#define youmake float /* you make it, I’ll drink it */

Continue reading
Posted in C, Essentials | Tagged | Comments Off on C For Fun

Jon Galloway on Visual Studio Mac

Jon joins us again, this time to talk about Visual Studio Mac and Maui!

Posted in Essentials, Mac, Maui, Visual Studio | Tagged | Comments Off on Jon Galloway on Visual Studio Mac

Xamarin Best Practices

In a recent blog post, I showed the C# best practices we use at my current placement. Today, the Xamarin best practices:

Xamarin 🐒 Best Practices

The Do’s 🙌

👍 Catch XAML Errors Early

Add the following attribute to code behind in order to improve performance and catch xaml errors early.

[assembly: XamlCompilation (XamlCompilationOptions.Compile)]

Why: https://stackoverflow.com/questions/46338575/bad-xaml-still-compiles-with-no-error-then-runtime-error-occurs-in-xamarin-form/46338664 

Continue reading
Posted in Essentials | Comments Off on Xamarin Best Practices

C# Coding Standards – Updated

Let’s face it, most coding standards are arbitrary. The key to a successful project, however, is not which standards you follow, but that you are consistent.

Here is a partial list of the C# coding standards my team uses and advocates, updated by what we’ve learned in the past year.

Most of these are industry-wide conventions and thus using them will ensure that your code is easily readable by people who are not you. (Many thanks to Adam for letting me post this here)

👍 use PascalCasing for class names and method names.

public class ClientActivity 
{ 
    public void ClearStatistics() 
    { 
        //... 
    } 

    public void CalculateStatistics() 
    { 
        //... 
    } 
} 

Why: consistent with the Microsoft’s .NET Framework and easy to read.

👍 use camelCasing for method arguments and local variables.

public class UserLog 
{ 
   public void Add(LogEvent logEvent) 
   { 
    var itemCount = logEvent.Items.Count; 

    // ... 
   } 
} 

Why: consistent with the Microsoft’s .NET Framework and easy to read.

Continue reading
Posted in C#, C# 8, C# 9 | Comments Off on C# Coding Standards – Updated