In this issue from October 2017: the ideal length of a function is easier to decide than you think; the next major version of C# is bringing some long overdue changes; six approaches to programming that will change the way you think; recovering access to a PC when it has fallen off the domain and you don’t know the admin password; ten of the worst features of C#, as selected by Eric Lippert; and the Myth of the Genius Programmer.

Sharpen the Saw is a somewhat delayed repost of a semi-regular newsletter of information I publish for the professional development of software developers. While targeted primarily at developers working with the Microsoft technology stack, content will cover a wider range of topics.

To subscribe, send me an email and I’ll put you on the list. Membership is moderated.


Always a way to improve the code you write every day.

Function Length

What’s the ideal length for a function? Ask five developers this question and you’ll get at least seven different answers. Martin Fowler suggests that you should extract code into a well-named method whenever that name makes it easier to understand the intent of the code. Sometimes these methods are surprisingly small.

Read more …

Software and Updates

A new or upgraded tool can be a beautiful thing.

3 New C# 8 Features We Are Excited About

While the feature set for C# 8 hasn’t yet been set in stone, the features being considered are well known. Three of them are discussed in this article from Non-nullable reference types, lightweight record types, and default interface method implementations.

The features planned for C# 8, particularly non-nullable reference types, promise to make it easier for developers to avoid creating bugs, writing code that is more obviously (and provably) correct.

Read more …

Being Professional

A great developer does more than just write great code.

Six programming paradigms that will change how you think about coding

There are more ways to write a program that you might expect, particularly if the majority of your experience is in a single framework, language or platform. Here’s an interesting post that lists six alternate approaches to problem-solving.

  • Concurrent by default
  • Dependent Types
  • Concatenative languages
  • Declarative Programming
  • Symbolic programming
  • Knowledge-based programming

Of course, some of these are far from new. Check out the Jupiter Ace for a home computer from the 1980’s that ran Forth as its primary language.

How many of these ideas have you tried out?

Read more …

Staying Secure

Staying safe online and writing secure systems are both harder than we think.

How can I reset a PC if I forgot the administrator password?

In order to stay connected to a Windows Domain, a computer needs to be online and able to update its machine domain password on a regular basis (I think it’s at least once every 45 days). Leave the machine turned off for much longer than that and it won’t be able to connect to the domain. When the machine is in this state, domain users won’t be able to log onto the machine - when it is untrusted, the domain controllers won’t respond to the machine.

If you end up with a machine in this state, you either need to log in using the local Administrator password (if you know it)- or use the technique documented in this post to trigger a full machine reset.

Note that this does a full machine reset, starting over with a fresh installation of windows, so it’s not something to do on a whim.

Read more …


Sometimes the answer is random.

Sharp Regrets: Top 10 Worst C# Features

A former member of the C# design team, Eric Lippert, shares his thoughts on the 10 features that C# got the most wrong. Eric is a great writer and this list is both thought-provoking and well argued. We all have our most (and least) favorite features - are any of yours on Eric’s list?

Read more …

Video of the Week

Take some time to feed your mind.

The Myth of the Genius Programmer

From the 2009 Google I/O conference, Brian Fitzpatrick and Ben Collins-Sussman talk about how there’s a general desire to not look stupid - and how this leads into the myth of the genius programmer.

Length: 55m Audience: All developers

Watch now …


blog comments powered by Disqus
Next Post
Avoid hardcoded wait times  26 May 2018
Prior Post
Guaranteed Progression  19 May 2018
Related Posts
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
May 2018