Monitoring Changes of Individual Objects Inside ObservableCollection

I needed to monitor individual objects of a collection in order to make a function available only when one of them did not match its initial state. Here’s how I decided to do it.

Continue reading “Monitoring Changes of Individual Objects Inside ObservableCollection”

git reset

Git serves a few purposes in your project. One of those purposes is a safety net. It allows you to make experimental changes to your code, and not have to worry about paying much attention to the state it was in when you changed it. That state is already available through one of your commits if you need it. There are three primary ways I turn back the clock in Git: reset; checkout; and revert. Let’s take a look at the reset command.

Continue reading “git reset”

WPF Window Exercise

I had a situation here where I was trying to figure out how to create a WPF window from a console application. I couldn’t use the application class, and found it to be a nice little exercise. As it’s an extremely rare case, I don’t expect it to be useful again, but I found it interesting, and decided to document it, and write it here. Enjoy.

Continue reading “WPF Window Exercise”

git diff

Overview

There are times when you need to know what was changed between two points. Examples are: your last commit, and your working tree; two commits; two tags; two branches; a tag and a commit.. and on. Mostly, you’ll need to know how your working tree differs, or how your staging area differs from the last commit made. For this, as you have undoubtedly already guessed, is what the git diff command is for. Let’s look at common uses of this command.

Continue reading “git diff”

C# Interfaces

What are interfaces?

An interface is functionally equivalent to having an abstract class with only public abstract members being events, getters, setters, and methods.

So, why not abstract classes then?

Interfaces can do one thing that abstract classes cannot. Interfaces can inherit from multiple interfaces whereas abstract classes can only inherit from one class.

So, why ever use abstract classes?

Well, abstract classes are still useful. You can place code needed by all subclasses in the abstract class. Sometimes, I will create my inheritance model using interfaces, and then use an abstract class to set the table for the classes that will inherit from it. This helps to adhere to the DRY principle. Don’t repeat yourself!

Well, okay… but which is better

What’s a better hand tool? A hammer or screwdriver? The answer is neither. They both have their uses, and both can be horribly misused. The same thing goes for interfaces, and abstract classes.

Design Patterns

Very rarely do you come across a problem that no one has seen before, and solved. This is a fortunate truth. This means you can stand on the shoulders of giants. One of the ways you can do this is by learning design patterns. Problems these design patterns solve pop up everyday, and by learning the patterns, you’ll learn to recognize them. Happy coding.

Git — Initializing a Repository, and Tracking Basics

Let’s dive in. We’re going to look at some of the things you need to know to use Git. Before long, you’ll be using it comfortably, and will start the journey down the long winding road of version control philosophy. You’ll be thinking about things like when to commit, what to commit, and the story your branch history tells. Before that though, we need to take our baby steps.

 

Who is this for?

If you know anything about Git, skip me. You’ll be bored to tears. If you have no idea what version control is, and are getting started programming, this is for you.

Continue reading “Git — Initializing a Repository, and Tracking Basics”