Current Project Queue

Like any developer, (who actually likes doing development, anyway) I tend to have some projects outside of work going. Of course, more often than not, they don't always get completed. Some don't even get started! I'd like to change that. This blog (and hopefully all two of you readers) can help keep me accountable. So here are the projects I currently have an idea on doing and what I plan on learning. Don't worry, I'll release the source for this stuff as they get completed.

  • Web app to use the Jamendo API - Wanted to play with the API (which helps me learn to consume JSON) for some time now. Plan on creating an ASP.NET MVC web application and use Angular.JS for the two-way data-binding (of course, mess with the testing and IoC within Angular.JS).
  • Learn more design patterns - I've stayed away from learning design patterns but no longer! I think it's time to learn these and I'll be using PluralSight's Design Pattern Library course to help me out.
  • Something with the Kinect - Not exactly sure what to do with the Kinect just yet, but I wanted to develop an app to interact with some hardware and this seems like a simple yet fun way to do so.
  • More JavaScript - This is the number one thing I need to learn more of, currently. When JavaScript is considered the most dominant language now, it's a good time to learn more of it.

This is just a list of the more important stuff I wanted to do. I'm sure more stuff will definitely be to come.

Random Link Roundup

Apparently, every Sunday seems to be a bit too much of a time constraint to get these links out. Instead, I'll just randomly send some I think are worth reading.

Using TraceSource for Logging

How often have you been in a project and you wanted to create a simple log file to log out errors and, if debugging an annoying error, parameter and variable values? I've wanted to do this a few times but there are a handful of references out there on how best to use TraceSource for logging. Of course you have your best resources of MSDN and StackOverflow, but I figured a bit more of an understandable example would be most helpful to everyone looking on how to easily implement this to their projects.

To get started in the simplest way, all you need to do is to update the config file to include the System.Diagnostics section and then update the code you want to log out the information that you want. Below is a similar example to what is shown on the previously mentioned MSDN article.

You may have noticed that I'm calling the Flush() and Close() methods on the TraceSource object. This is done to make sure the file gets written to and is closed properly. If you aren't getting everything written to your listener, these calls may be all that's needed. However, I've seen cases where it's not always required.

TraceSource can be used across layers of the application as well and you can create a source for each of the layers to do a bit of a separated logging. So if you have a wrapper class you wouldn't want to log as much as you might a business class that has all your business logic.

Of course, if you push to production and don't want all this logging until you need it, you can turn it off per the switch inside of the specific source.

To show how it's used for different classes, I'll use a standard Person/Employee class hierarchy. So below we have our two new classes:

Fairly basic classes here with some similarly basic methods. As you can tell with the methods, I’m logging some fairly verbose information out. So if there any problems with certain data, I can just look at the logs to see what the methods are using and their return value. This can be crucial in debugging a certain item when you have a decent sized data set. If this wasn’t available you’d then have to go through each item in the data set by hand.

To separate out the log for each class or even a whole layer in your app, just create a new source for each layer you want to be logged separately. I’m using the same listener so they’ll all go to the same place, but you’re free to have each source have it’s own listener.

 

And now you have your information logged: 

PersonLog Information: 0 : Is John Doe valid - True
EmployeeLog Information: 0 : Is the IT department valid - True

This is just a basic use of TraceSource for logging information. I used a file to log out because I feel that it’s fairly easy to use and you have one location for all your log statements. If you’re used to log4net with the different additional appenders (listeners in terms of using TraceSource), then the Essential Diagnostics library will be a great addition to the project to further enhance using TraceSource for logging.

The full source for this example can be viewed on GitHub – TraceSourceLogging.

 

Watch How Your Users Use Your App

If you develop applications at your company and another group there uses it to do the actual business of the company, have you actually seen how they use the software? Seems a bit crazy, right? You developed it, so of course you know how it works! Not quite so. The people who use your applications all day every day at work will find little nuances about it that you never would have dreamed of. They'll take six clicks to get something done when you thought it only would take two.

You won't really know how they use it until you sit with them and watch them for a few minutes. Requesting this to your boss should show that you care enough about the business to help out the productivity of the users and the quality of the software you give to them. To get an even better idea is to see if you can actually do a little bit of what they do to get the full effect. Then take notes...anything that comes to mind. How do you think this can be improved? What issues were you having to accomplish a certain task? Were there any performance problems that had you waiting for a task to complete? Could something be done simpler to minimize the user (in this case, you) from having to think about what should be done on the page?

I actually propose the whole team to do this. Then once everyone has finished, compare notes and even have a small meeting on all the things that can be improved.

I just did this today and saw massive productivity improvements and you can bet I'll share them with the team as soon as I review my notes.

Sunday Link Roundup

What's a Sunday without some links? Here's a couple of stuff I found interesting this past week.

Why You Should Use OneNote

Very rarely will I push a piece of software that I believe people should use. Of course, what software you do use is quite a personal choice. However, there are pure gems out there that I just can't let it stay unknown for much longer to everyone I believe can benefit from it. Microsoft OneNote is the one I consider a true gem. What can you do with it, exactly? Well, you can use it to write/draw/screen cap anything you'd like! It's a blank canvas for you to use however you wish. Why would you use it? It basically gives you a virtual notebook and you can organize it how you would like, though it keeps with the traditional notebook organizational hierarchy such as tabs (or sections) and pages. There are even some templates to help get you started such as to-do lists, travel plans, shopping lists, etc. However, I use it to literally take notes. Whether it's for studying, notes from various readings, or just random thoughts that go through my head.

As you can tell from above screenshot, I just break my notebooks out by general category and break the sections and their pages up to be more specific. You may also notice that you can nest pages to create a bit of a hierarchy.

Of course, what's the use of all these notes if you can't get to them easily. OneNote has a great search feature. You can either search throughout the one page or through the whole notebook. If you have a Windows 8 tablet with a pen, you can download the Windows RT OneNote app and you can take handwritten notes and OneNote will search those as well!

There is also a mobile app regardless of what type of phone you have. So you can have all your notes available to you at any time. One great way to use this is to have an easy access to a page you have set up for random thoughts, idea, or something you'd like to take a further look at later.

The only downside I have about OneNote is that it's not the best for clipping web articles. Sure it's nice to be able to save links, but I believe it's best to be able to clip the entire article into OneNote. That way you won't be dependent on if that article or even the site is still available. For web clippings I do use Evernote and their web clipper. Hopefully in a future update this can be done straight through OneNote itself.

If you want to get more organized with your notes or random findings, I suggest giving OneNote a try. Who knows, you may find it as useful as I do.