The WinForms Notepad Project (2022): Fork Me (Premium)

When I made the C#/Windows Forms version of .NETpad available on GitHub in late January, I wasn’t sure what to expect. To my surprise, outsiders have proposed some useful fixes and changes, and I’ve even approved a few of them, adding them into the master repository. And to my horror, I belatedly realized that this version of .NETpad is a bit rough from a code quality standpoint, and that I should have spent some time cleaning that up before it went live.

Ah well. You live, you learn.  Here’s where we’re at.
Mistakes
This is an astonishing thing to admit, but I didn’t really look at the code for this version of the app too closely before I made it available to the public on GitHub. That was a mistake. I had created this version quickly, and I never documented it on Thurrott.com, and it would have benefitted from a few days of code review.

There are issues, some of which I find embarrassing. The code is rarely commented in any way, mostly because it was a quick and dirty port of the original Visual Basic version to C#. And I originally intended to add some new features to this C# version, to differentiate it a bit from the VB original. (That may be why it still uses a RichTextBox instead of a TextBox: I do recall considering adding a rich text mode and perhaps making it more like WordPad.) Ultimately, I ended up moving on to the Windows Presentation Foundation (WPF) version of the app. And that version is indeed more sophisticated.

Anyway. It is what it is. I’ll be more careful with the next version. And I may still spend some time cleaning up the code for this version regardless.
Pull requests
As noted, I wasn’t sure what to expect when I posted this version of .NETpad on GitHub. But to my horror and delight, a small number of GitHub users have forked .NETpad, creating their own local versions to play with. And some have even submitted pull requests, which are code changes they’ve made that they’re requesting be added to the master repository.

There have been 6 pull requests so far, and I’ve accepted two of them, meaning that those changes were merged into the master repository. Anyone who uses Visual Studio to clone this repository now will get the updated version of the apps with the new pull requests integrated. And anyone who cloned it previously can update their code via Visual Studio too: just open the Git Changes tab in the Solution Explorer and choose “Pull.” (It’s the downward-facing arrow.)

The two pull requests I’ve accepted are:

The FileOk event had lost its handler. This fixes a bug in my Save As code.

Remove the annoying beep from the text box when navigating past it's … This one fixes an interesting problem: if you use the arrow keys to navigate around the text in the app’s TextBox and try to navigate past the end of the text, you’ll hear a “bong” error sound. With this change, that sound no longer plays. What makes it interesting is that this bug is present...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC