You Are Good Enough

"I don't think I'm a good developer." 

I think a lot of developers out there think this or something similar at one point in their career. Mainly during the first few years when they started out. Maybe they just started their first job or even thinking of moving to a second job.

Here's my advice if you're one of those who think this...just relax.

Yes, I definitely have done this myself. All through college, when interviewing for my first job, during my first job, interviewing for my second, and during the first couple of months of my second. Seems like a lot of times worrying and doubting yourself, doesn't it? 

It's kind of nice that you worry about this stuff. It means you actually care, right? But just think, if you weren't as good as you may think, how would you have gotten the job you do now? How would you have been able to stay there for as long as you have? 

If you still feel the same about your skill, take this opportunity to learn new stuff. The internet has tons of stuff online to get you started. One tutorial doesn't make sense? Go to the next one.

So go on, challenge yourself. After doing that you'll become better than good enough.

Learning Python Using IronPython

Not too long ago when browsing the Coursera courses I found an interesting one about learning to program using the Python programming language. Once I saw this I jumped right on it and installed IronPython, a .NET library that lets you use Python to interact with .NET applications. Unfortunately, I never really finished all the assignments. I got a bit stuck with converting a .NET List object to a Python List object. I believe I finally got the program to actually do the conversion, but my test would still fail for some reason (any insights on this would be awesome).

The code for IronPython that really does the work in my project is in the PythonEngine class.

As you can see, it’s taking in a parameter for the location of the Python script file for it to execute. From there the engine compiles the file and executes it. I get the variable (or method in this case) by the name and then I send it the list of parameters and invoke it getting back the results that are returned as a dynamic type.

One of the cool things you can do with IronPython and using the dynamic keyword is that, if your app has a different set of rules, you can create the rules within the Python script and use the C# to invoke them. This way only the Python script will need to be updated for the logic of the rules and no compiling of the C# is needed to execute the new rule set.

This course was a fairly easy introduction to the Python language and I believe it’ll be offered again fairly soon on the Coursera site, if you’re interested in taking it. Using it with IronPython also shows how powerful it can be in enterprise applications as well as how much power using the dynamic keyword can be.

Podcasts Are Back...For Me, At Least

I still remember back at around 2006 or so while still getting over the breakup of the best television network ever created, TechTV, I find out about this fairly new thing call podcasts. This was big back then, especially since the people I loved watching on TechTV came together for their own podcast, This Week in Tech (TWiT). I believe this is still one of the most popular podcasts still around. While I think the TWiT network has some of the best podcast shows out there I have a few others that I get excited to see to have new episodes.

  • HanselminutesScott Hanselman is one of the guys to follow if you’re doing any kind of development using the Microsoft technology stack and his podcast is just as good. Usually Scott has a guest on to talk about a certain topic and it’s always informative.
  • Get Up and Code – A fairly recent addition, this is a good one for anyone who wants to get more into fitness and nutrition, and it's not just for developers as the name suggests.
  • Lifehacker – The popular life hacking blog has their own podcast that highlights the popular posts of the week.
  • This American Life – Probably the biggest podcast currently still going on that has a theme for each show and true stories based on thattheme.

Speaking of the TWiT network, they do have quite a library of shows. Here are my current favorites.

  • This Week in Tech – The podcast that started it all. This is still the popular one of tech podcasts and definitely a fan favorite of many TechTV fans.
  • Tech News Today – What better way to get tech news than a daily podcast?
  • The Tech GuyLeo Laporte’s weekend radio show where he helps callers with their tech questions.
  • This Week in Law – I've always had an interest in law and this show plugs that gap in for me in an easily digestible format.
  • Triangulation – An interview type show that lets you get to know people in tech.
  • Windows Weekly – A weekly show about all things Microsoft!

That’s quite a lot of shows. They usually come out once a week so that’s basically a week’s worth of entertainment right there. I’m sure there’s tons of other awesome shows out there that I have yet to discover and I can’t wait until I do get to discover them.

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.