Wednesday, December 31, 2014

2014 Retrospective

Blog

This was the first year where I wrote four blog posts every month, and the unintended side effect was that the posts become smaller. I'm not sure how much I liked that; on the one hand I got to write more quick articles with little helpful information, but to be honest I did not enjoy writing those little posts as much.

Next year I will be reducing this to only three medium length posts per month. I am hoping this will be a good compromise between quantity and quality.

QQ Cast

I absolutely loved doing the QQ-Cast with my friend, Jordan. We started out the year strong, averaging three hour long episodes a month. Unfortunately as the year continued "life got in the way" and we only recorded two episodes in the last three months of the year.

Next year Jordan and I will be following a release cadence of three times a month, but shorter half hour episodes. Obviously this is similar to the blog schedule.

Professional

It has been a crazy year for me professionally. Without going into detail, I switched teams at work and now have a completely different set of responsibilities. I made this change to in order to get out of my comfort zone and, as is a core value for my company, to learn and grow.

It has been very challenging, but very rewarding. I would highly encourage all software engineers who have been in the same roll for three years or more to consider changing positions. What you learn in the first three months of a new job is often more than you will learn the rest of the year.

Personal

I got married. I bought an FZ-09. I, as mentioned above, changed positions at work. That really sums up 2014. Next year I clearly need to focus more on having a better work / personal life balance...maybe I should take more vacations?

Happy New Year,
Tom

Sunday, December 28, 2014

Why you should use more HTTP.

I am a big fan of Ayende Rahien. He leads Hibernating Rhinos, develops RavenDB, and contributes to NHibernate. Oh, and he is an avid blogger that puts my release schedule to shame.

Ayende recently blogged about over the wire protocol design, and I wanted to echo opinion on this subject!

How to actually send it?

As applications become more complicated they frequently need to communicate with remote resources. So how should your applications talk to each other? If you had not figured it out already: I suggest HTTP!

Why use HTTP?

Here are just a few very small reasons that I love working with HTTP:

  • It is supported by every language.
  • It is supported by every platform.
  • It is supported by every device.
  • It has standards for authorization.
  • It has standards for encryption.
  • It has standard response codes.
  • There are amazing tools for it.
  • There are more amazing tools for it.
  • There are still more amazing tools for it.

...need I go on?

Why NOT use HTTP?

I always look to successful companies for inspiration with technology. If you are making a store front, I suggest you look at Amazon or Newegg. If you are creating social media features, I suggest you look at Facebook or Twitter. If you are designing APIs, I suggest you look at Google. Do you know what Larry Page did not say after Google made it big? "Man, I really wish that we hadn't invested so heavily in all of that web stuff!"

Okay seriously, depending on your application there may be reasons not to use HTTP as your communication protocol. However for the vast majority of applications I think it will do the job, and I strongly urge you to consider using it instead of reinventing the wheel again.

Just my two cents,
Tom

Wednesday, December 24, 2014

How to use Entity Framework and SQLite

SQLite is the definition of a lightweight database. Using SQLite you can run an entire database with only a 304 KB executable and a database file. It's fast, stable, and very easy to use. Entity Framework is Microsoft's official ORM, and it has support for SQLite!

SQLite Tools

To run SQLite you need only to download the precompiled SQLite binaries for windows:

You can easily manipulate the database via command line. However, if you would prefer to use a GUI, there is a wonderful Firefox plugin for managing your SQLite databases.

Entity Framework Setup

To get stated using Entity Framework you will need to add two NuGet packages to your solution:

  1. EntityFramework
  2. System.Data.SQLite (x86/x64)

After that you will need to make sure that your app.config file has properly registered the both a System.Data.SQLite provider and provider factory.

Sunday, December 14, 2014

How much does RegexOptions.Compiled improve performance in .NET?

Just how much does the RegexOptions.Compiled flag improve regular expression performance in .NET? The answer: a lot! People have spoken about this before, but below are some more numbers to how you just how much it matters!

Performance Stats

Character Count Regex Pattern
1
[a-z]
3
[b-y].[1-8]
5
[b-y].[c-x].[1-8].[2-7]
7
[b-y].[c-x].[d-w].[1-8].[2-7].[3-6]
9
[b-y].[c-x].[d-w].[e-v].[1-8].[2-7].[3-6].[4-5]

RegexOptions 1 3 5 7 9
None 234176 285067 653016 690282 687343
Compiled 193945 235213 430609 452483 454625
Percent Gain 17% 17% 34% 34% 34%

Real Time Web Analytics