Showing posts with label Ramblings. Show all posts
Showing posts with label Ramblings. Show all posts

Tuesday, November 5, 2013

Tricky LINQ ToDictionary Where Action is the Value

This is going to be a quick one, but something I wanted to jot down before I forgot it. I needed a Dictionary<MyEnum, Action> and figured I would use LINQ's awesome ToDictionary<,>() method. I've used this plenty of times before and so I figured this would be a snap:

    private readonly Dictionary<MyEnum, Action> _actions;

    public Keyboard()
    {
        _actions = Enum.GetValues(typeof(MyEnum))
                       .Cast<MyEnum>()
                       .ToDictionary(x => x, x => () => { });
    }

Feeling good about my awesome LINQ statement, I went to move on when I noticed that my precious had red squigglies under it. Ah, probably just a typo or something. I mean, I am susceptible to those sometimes, I suppose. Upon further inspection, it was not a typo but a fun little error:

Cannot convert lambda expression to type 'System.Collections.Generic.IEqualityComparer<Foo.Bar.MyEnum>' because it is not a delegate type

Even more fun, this method was insisting I was trying to create a Dictionary<MyEnum, MyEnum>. No I'm not! What the heck!

Just Breathe...

Ah yes, it is easy to forget that there are four overloads for ToDictionary. Three of which are ToDictionary<TSource, TKey>, all of which an Action perfectly conflicts, and fourth which is ToDictionary<TSource, TKey, TElement>. So, my implementation, above, caused the compiler to become confused since it thought I was trying to pull off passing in an Action as an IEqualityComparer. So, we need to force the compiler to pick the last overload by specifying all the Ts:

        _actions = Enum.GetValues(typeof(MyEnum))
                       .Cast<MyEnum>()
                       .ToDictionary<MyEnum, MyEnum, Action>(x => x, x => () => { });

Simple really.

Thursday, October 31, 2013

I Hate Null References. I Hate Them!

I have been thinking hard about how to introduce my hatred for "null" references without sounding like it was just complaining. We'll see how this goes.

Null references, for the (lucky) unacquainted, occur when one dereferences a pointer that does not point to anything. Instead of swallowing the "error" or providing some default behavior, we get an exception. When not caught and handled, this will cause big problems. The fun part (for various definitions of fun) is that these exceptions are a pain to hunt down. So, most of the time, we do checks at the beginning of code blocks to check for null references. Thus, our code is sprinkled with things like:

void Foo(Bar bar, Baz baz)
{
    if(bar == null) throw new ArgumentNullException("bar");
    if(baz == null) throw new ArgumentNullException("baz");
    // if we get here, we're ok.
}

which doesn't remove the exception. Ugh. I really wish C# would implement non-nullables or something like C++'s references. There has been some talk about how to introduce this into C# but, as of today, we do not have this capability. I'm really looking forward to any sort of implementation!

Doing some learning

After digging around some (and being heavily inspired by Eric Lippert's posts on monads), I have been using the Maybe "pattern" and decided to share my implementation. As an aside, there are 13 posts to that link, but they are all great reads and I highly recommend checking them out. I am, in no way, an expert on Monads, but felt like sharing what I have learned up to this point. Before we move on, here is the code.

public struct Maybe<T>
{
    public static readonly Maybe<T> Nothing = new Maybe<T>();

    public readonly bool HasValue;
    public readonly T Value;

    public override string ToString()
    {
        return ToString(string.Empty);
    }

    public string ToString(string nothing)
    {
        return HasValue ? Value.ToString() : nothing;
    }

    public static implicit operator Maybe<T>(T value)
    {
     return new Maybe<T>(value);
    }

    public Maybe(T value)
    {
        Value = value;
        HasValue = ReferenceEquals(null, value);
    }
}

There is nothing really fancy going on here, but using a struct for the wrapper ensures that we won't have to worry about null references. I have allowed for the implicit conversion from "T" to Maybe<T> so we can keep the "Maybe"s contained.

public class Foo
{
    public static void Bar(Maybe<string> baz)
    {
        // Use baz
    }
}

public void Main()
{
    var myString = "Some string, not a maybe.";
    Foo.Bar(myString); // No explicit cast required.
}

Let's make it better

This helps with arguments, but we can take this a step further and use some LINQ trickery to allow some short-circuiting logic to (appear to) dereference the maybe safely and any properties it may have. Let's say we have a (poorly) written object graph that looks like this:

public class X { }
public class Y { public X X { get; set; } }
public class Z { public Y Y { get; set; } }

and we need to use the properties in a method. Without our special maybe, we might have something like this:

public class Foo(Z z)
{
    if(z == null) throw ArgumentNullException("z");

    if(z.Y != null)
    {
        if(z.Y.X != null)
        {
            var x = z.Y.X; // finally...
        }
    }
}

What if the idea of nothing (null, in this case) is ok? We're throwing an exception but might not mean it. And then we have the nested if-statements to finally get to the value we're after. For fun, we can use some extension methods to get some LINQ goodness and remove the explicit null checks. (This portion was greatly inspired by this post by Mike Hadlow.)

public static class MaybeExtensions
{
    public static Maybe<T> ToMaybe<T>(this T value)
    {
        return value;
    }

    public static Maybe<R> Select<T, R>(this T value, Func<T, Maybe<R>> func)
    {
        Maybe<T> maybe = value;
        return maybe.HasValue ? func(value) : Maybe<R>.Nothing;
    }

    public static Maybe<R> Select<T, R>(this T value, Func<T, R> func)
    {
        Maybe<T> maybe = value;
        return maybe.HasValue ? func(value) : Maybe<R>.Nothing;
    }

    public static Maybe<R> Select<T, R>(this Maybe<T> value, Func<T, R> func)
    {
        return value.HasValue ? func(value.Value) : Maybe<R>.Nothing;
    }

    public static Maybe<V> SelectMany<T, U, V>(this Maybe<T> maybe, Func<T, Maybe<U>> k, Func<T, U, V> s)
    {
        // This could be cleaned up with a "Bind" method, but I wanted to leave it off for now
        if(value.HasValue == false) return Maybe<Vgt;.Nothing;
        var kMaybe = k(value.Value);
        return kMaybe.HasValue ?
            s(value.Value, kMaybe.Value) :
            Maybe<V>.Nothing;
    }
}

We can now chain the maybes, using LINQ, without fear of a null references exception.

class X { }
class Y { public X X { get; set; } }
class Z { public Y Y { get; set; } }

void Foo(Z z)
{
    var x = from z in z.ToMaybe()
            from y in z.Y.ToMaybe()
            from x in y.X.ToMaybe()
            select x;

    // Or

    x = z.ToMaybe()
         .Select(z => z.Y)
         .Select(y => y.X); // Same thing as above
}

No matter if Z, Y, or X is null, we will get a Maybe<X> from this. Other than having to invoke the extension method ToMaybe(), I like this code much better than a bunch of null checks. Maybe that's just me. This means we can either keep the Maybe<T> internal and use the ToMaybe() extension method, or we can take in a Maybe<T>. As long as this doesn't turn into a check on HasValue that requires us to throw an exception, it seems ok. Of course, there are times when a null reference just is not an acceptable "pre-condition" and an exception is (because our hands are tied) acceptable. What are your thoughts?

Tuesday, October 15, 2013

EStroids - An Entity System Game

After having stumbled upon entity systems, I have been a little bit infatuated with the design concept. I decided to spike out a little game for fun and brush off my math skills; thus EStroids was born. It is just a quick and dirty little game, doesn't have all the defensive programming checks that would normally go into an app or game, but was pretty fun to write. (It also has things that will make a mathematician cry, such as multiplying a 4✗4 matrix and a vector3.)

I have the little project hosted on GitHub in case I decide to poke around it some more. Overall, it was just fun and nice to see how easily it is to put little games together. I have absolutely no real-world experience that tells me this sort of approach is scalable, but I do see merits to the approach.

And without further ado, the link: https://github.com/jjvdangelo/EStroids

Systems

Each of the systems inherit from SystemBase that just takes in a manager. (Like I said, just quick and dirty.)

public abstract class SystemBase
{
    private readonly EntityManager _manager;
    protected EntityManager Manager { get { return _manager; } }

    public virtual void Initialize() { }
    public virtual void Shutdown() { }
    public abstract void Frame(double dt);

    protected SystemBase(EntityManager manager)
    {
        _manager = manager;
    }
}

Here's the "lifetime" system that manages objects that have a timed lifespan:

public class LifetimeSystem : SystemBase
{
    public override void Frame(double dt)
    {
        var toDestroy = new List();
        foreach (var entity in Manager.GetEntitiesWithComponent())
        {
            var expiration = entity.GetComponent();
            expiration.TimeAlive += dt;

            if (expiration.TimeAlive < expiration.MaxLifetime) continue;

            toDestroy.Add(entity);
        }

        toDestroy.ForEach(x => Manager.DestroyEntity(x));
    }

    public LifetimeSystem(EntityManager manager)
        : base(manager) { }
}

So much cleaner than trying to shove this into some base class and figure out where this behavior should live within an object oriented hierarchy.

Components

And this is a simple component (the Expiration component) used by the LifetimeSystem:

public class Expiration
{
    public double TimeAlive { get; set; }
    public double MaxLifetime { get; set; }
}

Basically, we work to separate the data away from the behavior and away from the entities themselves. This the complete opposite type of work that I've done for so many years trying to efficiently pull all of these things together. It is almost always a code smell when you have "Manager" objects, quickly leading to an anemic object model.

Make Sense?

For anybody who may experience with entity systems, does this make sense? Am I interpreting the intention of entity systems? I feel like I'm picking up the idea but it's always good to have a sanity check here and there!

Monday, September 30, 2013

Exploring Entity Systems

I am always interested in exploring ways of writing code. Lately, I have been trying to break the monotony of writing "business apps" and decided to take a look at writing a few games. It has been a long time since I have written a non-web app so I started up by doing a little research. Since I am a fan of CQRS/DDD/event sourcing/etc, I wanted to learn more about writing systems that do not require giant object graphs and "god objects." My previous exposure to game systems (a long time ago) seemed to run on magic, duct tape, and a lot of luck. But, maybe that was just programming in general.

In my research, what I have come across has been pretty interesting. I ran across a way of developing using "Entity Systems." It is like an OOP-less way of writing applications with the added benefit of built-in Aspect Oriented Programming (AOP). There are plenty of blog posts covering introductory information, so I won't rehash it here. (I may leave that to another blog post later.)

One of my favorite ways of exploring new ideas is to write up a quick spike. In that fashion, I have written a simple little test app that throws around some colored dots on the screen. It's not perfect, doesn't do everything I would want in a real system, but was fun to write. Entity systems will definitely remain on my radar for a while. Well, without further ado, here is my quick little app (in C#).

Links

For a nice overview of entity systems, check out the following links:

(While these are "old," they still contain some really good information.)

Wednesday, May 8, 2013

Asynchronous Command Handlers, Object Identity, and CQRS

I have been working on a (closed-source, unfortunately) project in my spare time and have been using the Command Query Responsibility Separation (CQRS) pattern. In most places, it is pretty easy to utilize asynchronous command handlers, but there was one part that tripped me up a little bit. When a user creates a new aggregate root via, say, a web page, how do we handle the asynchronous nature of the command handler?

At one point, I thought about making these creation-type command handlers synchronous so the user could be warned if the creation has failed or if there were errors. I was not very happy with this because it meant that I couldn't just place the command on a bus and move on. It meant I cannot offload that work somewhere else and the user has to sit and wait for this thing to go on. Basically, an all around uncomfortable situation.

Why?

So, what made me care about this? Why is it important to think about? Well, it has some implications. First off, it makes one consider how an object's identity is created. If we have the domain create the id, then we have to sit around and wait for it to complete. (Hence, my dilemma.) Overall, this could work, but I was not satisfied with it. After all, my goal was to allow the web application to do as little processing as possible, other than serving up pages and communicating with the service bus.

Were do we go from here? I was a bit stumped and almost gave in to the idea that I would have to accept this band-aid fix as a permanent solution. Luckily, after some thought, and drawing some pictures, I realized I was looking at the problem from the wrong point of view. Shifting my thinking, the answer seemed pretty obvious and I wasn't sure why I didn't see it in the first place!

The First Step

The first step to my clarity was deciding that the domain did not need to be in charge of creating an identity. Instead, why can't we pass in, say a globally unique id (GUID) and tell the domain that we expect something to be created with this id? Now, we don't have to sit around and wait on some database to assign and id and filter it back to the user. So, as part of our command, we can create a new identity and pass it into the domain from the web server. Now, since the server has the targeted identity, we can forward the user to a "Success!" page with the new identity as a hidden field. We can either set a timer to forward the user to the read only model or provide a link on which the user can click.

But, what if it fails?

What if the creation fails? Well? Who cares? What does that actually mean in the domain? For me, in my current project, it didn't matter. We can display an "Oops! We screwed up!" page with a link back the creation page. We could go so far as to reload the creation page with the data passed in (since we have the command, after all). Even if the user cheats the system and tries to re-use an identity to create an aggregate to maybe cheat the system, we can detect it (the aggregate cannot be created when it has already been created!) and show the user an error page.

Wait, create what was already created?

Let's say a malicious user wants to try to trick the system into recreating an aggregate in hopes to gaining access to it. Well, we have to be careful here. In my solution, aggregates are made by newing up the target type, loading the event stream from the backing store, re-running the events, and then calling some method on the aggregate. This include "create" methods. The constructor doesn't actually put the object in a created state. So, instead, we have something like:

public abstract class Aggregate
{
    public void ReplayEvents(EventStream stream) { ... }
    protected void PlayEvent(Event target) { ... }
}

public class Foo : Aggregate
{
    private bool _created;

    public Foo()
    {
        // Just get the underlying code ready,
        // but don't set the state to created.
    }

    public void Create(FooCreateParams params)
    {
        // Validate the params and all that fun stuff
        // and, if all is well, fire a created event.
        // If this has already been created, throw an
        // exception or, maybe, fire an error event.

        if (_created) { /* Blow up! */ }

        PlayEvent(new CreatedEvent(params.Id)); // You get the gist.
    }

    private void PlayEvent(CreatedEvent target)
    {
        // React to the event here.
        _created = true;
    }
}

So, if the object has already been created, we don't want to mess with the state. Depending on your domain and the context of your application, you could either fail silently, fire an error event, or even throw an exception. No matter what you do, though, if a user somehow messes with the system (or you happen to have an identity clash) and tries to execute a Create on an already created object, we do not want to hint that the user actually hit upon an actual id.

Conclusion

With a little bit of thought, we are able to clear up a seemingly complex operation down to a pretty easy solution that allows us to keep our asynchronous operations. Now we have a pretty clean set of operations: User hits submit, we load the command on the bus with a new id, redirect the user to a "success" page with some way of referencing the new object, and then let the user move from there. On error, regardless of why, we let the user know an error happened, and provide them with some information to make a decision on how to move forward.

Tuesday, May 7, 2013

Refactoring? Or Rewriting?

I was recently asked in an interview what it meant to refactor code and what the prerequisite was to refactoring. I have to admit, I was a bit thrown off being asked what the "prerequisite" is, since it seems to me to be reflexive software development nowadays. To me, refactoring is an interesting concept in software development that a lot of other engineering-type professions don't get to leverage as freely as we do. But, I think it has become (incorrectly) synonymous with rewriting code. (Or maybe refactoring is instead used as a guise to rewrite.)

Refactoring is very simple and is akin to rewording the language in your code to express the same idea, or original intent, in a different statement. Rewriting your code is changing the intended behavior of the code—the opposite of refactoring. I have spent a lot of time refactoring some code on my current project lately, and I have run across a the following code a lot.

public List<Foo> GetFoos(SomethingElse[] somethingElses)
{
    var retval = new List<Foo>();

    foreach(var else in somethingElses)
    {
        retval.Add(new Foo() { Bar = else.Bar });
    }

    return retval;
}

So, this is a pretty trivial sample of code, but it is really easy to see what is going on and what the intent of the code is. Basically, it is mapping a collection of one type of object to a collection of another type. We create a list and then iterate through the original collection, appending a new instance of Foo, and then return it. Using LINQ, we can actually simplify this just a tad and even type less code to get the same effect. (Refactor it.)

using System.Linq;

public List<Foo> GetFoos(SomethingElse[] somethingElses)
{
    return somethingElses
        .Select(x => new Foo() { Bar = x.Bar })
        .ToList();
}

Again, this is a trivial example, but it shows how we can refactor our code, keep in tact the original desired behavior, but use different syntactic sugars to clean it up. (I prefer using LINQ, personally, over foreach, especially in nested situations.) But, besides this being a trivial situation, what confidence do we have that we did not silently introduce a bug into our system? What assurance do we have? Well, before refactoring our code, we should put barriers in place to help us reason about our code. In the simplest sense, we should have a unit test, in place, before we make our changes to assert that we did not introduce a bug. Of course, if we're good TDDers we would have this unit test in place already, and have a nice regression test to fall back on. If not, it would behoove us to get one in place, quickly.

[Test]
public void given_an_array_of_something_elses_it_should_return_a_list_of_foos()
{
    var somethingElses = Enumerable.Range(0, 5)
        .Select(i => new SomethingElse() { Bar = i })
        .ToArray()

    // Let's assume GetFoos is defined as a static method on Baz
    var result = Baz.GetFoos(somethingElses);

    for (int i = somethingElses.Length - 1; i >= 0; --i)
    {
        Assert.That(result[i].Bar, Is.EqualTo(somethingElses.ElementAt(i).Bar));
    }
}

Well, that's refactoring, but what about rewriting? If we look at our simple method, what happens when we pass in a null array of SomethingElse? At this point, our method doesn't care and will attempt to iterate over it anyway. This, of course, results in a null reference exception and we have to track down how this happened. But, let's say we decide to change the behavior of this method. We, instead, will throw an exception if the array is null because we the precondition has not been met. Since we are changing the method's behavior, we are rewriting our code. One hint that this is a rewrite is the fact that we need to introduce a new unit test.

[Test]
public void given_a_null_array_it_should_throw_an_argument_null_exception()
{
    var exception = Assert.Throws<ArgumentNullException>(() => Baz.GetFoos(null));
    Assert.That(exception.ParamName, Is.EqualTo("somethingElses"));
}

I have used NUnit-style syntax in this post, but it should be fairly clear what is being tested.

Now, why is this important? Well, as we're writing our code, we tend to learn a lot about it. We see new ways to implement things that allow us to, later, extend the behavior of something without changing the original meaning. It also allows us to nicely execute test driven development: "Red –> Green –> Refactor."

Monday, April 29, 2013

Pits of Success

The Pit of Success: in stark contrast to a summit, a peak, or a journey across a desert to find victory through many trials and surprises, we want our customers to simply fall into winning practices by using our platform and frameworks. To the extent that we make it easy to get into trouble we fail.

—Rico Mariani, MS Research MindSwap Oct 2003.

For anybody who has designed a system, it can get really annoying when users turn around and do really dumb things with our designs. It can be frustrating, especially when we have made our design perfectly clear (in our minds). I often overhear arguments between some of the programmers around me and our customer about this very thing. (Programmers arguing with the customer—topic for another post.)

One of my big pushes at work is to change the way we view our software. It is very easy to put blinders on and just get the job done. We deal with a lot of very pertinent aircraft data and messing that data up has major consequences. As this system was started in the 70s using COBOL, there was not a lot of screen real estate. As such, there are times when a field on the screen serves double duty, but only has a label for one of its jobs. An example is a date field on one of our screens. It can house a date, or the user can input a command to increment the count in a field next to it. Needless to say, if I find the whole thing confusing and I have access to the programmers and source, I can't imagine how hard it is to be a user.

I have getting into the "Lean Startup" movement and found a term used in Toyota's Lean Manufacturing process: Poka-yoke. It exactly describes my argument for making user screens easier to use and more intuitive. Gone are the days of needing 500 disparate fields on the screen because it is easier than creating a new screen altogether. Much like in writing code, our user interaction points need to have low coupling and high cohesion. I am, by no means, a user experience expert, but if the same situations arise where users are incorrectly using our systems, it is usually because of poor design, not stupid users. We should aim to develop our systems such that users find themselves walking in the pit of success rather than walking a tightrope trying to avoid our mistakes.

Sunday, April 28, 2013

Opening Worlds, Sharing, Teaching, Learning

I'm probably late to the game here, but I saw this Code.org short video a few days ago and wanted to share it.

Great coders are today's rap stars.

— will i. am

I personally think everybody should learn how to code. Or at least learn about how a computer operates. I am not a fan of using "magic" to explain things and I do not think that technology is so unapproachable that it has to be explained away as being magic. I was lucky enough to be taught how to code at a very young age and believe it opened up my world so much more than if I had been robbed of that time.

Tuesday, April 9, 2013

Agile Software Development

As I am currently in a transition phase out of my current job, I have been looking at my résumé a lot. I noticed that I do not have the word "Agile" on it at all. This is interesting to me because it was something that I tried to promote just a few years ago. I think that has a lot to do with how I view software development now. While listening to a .NET Rocks round-table podcast a few months back, the question, "Is agile dead?" was posed. The answers were pretty interesting, but the one that stuck out to me the most was something along the lines that agile isn't dead, it is just the way we do software development now.

On the shows's page, a listener, "bashmohandes," made a comment that I have been thinking about for a very long time:

I don't think Agile is dead, but I think it got ruined by companies that think they are doing it but they are just fooling themselves, or using it as an excuse to keep changing requirements on the poor developers.

Most of the places I worked at, have some remnants of agile methods, like daily scrums, but pretty much nothing more, no fixed size sprints, or spring planning meetings, or retrospective meetings at the end of the sprint, or pair programming.

Specifically, that companies are "using it as an excuse to keep changing requirements." While I am leaving my current position, this is something that I have been struggling to keep from affecting my team. There are a few people in place who could fix this—but they don't. In fact, I don't think they know how to. It was recently told to me that we develop software in "a more waterfall approach." This made me laugh a bit as we don't even follow waterfall. That whole requirements gathering thing is a joke. The developers are currently expected to read the customer's ever changing mind and it is difficult to pin them down.

My current project has been around since the 70s and supports a major command of the USAF. The failure of the application means that troops and supplies are halted and commanders can lose situational awareness of their fleets. But, even with how critical this application is, there is hardly any structure when it comes to defining requirements and paving a path forward. Listening to the podcast really hit home. So many managers seem to want a "spray on agile" solution as if it is some sort of magic. Well, it isn't and "spray on solutions" don't work. In fact, they make things worse.

On the web development side of the shop, I have been able to focus everybody's attention on unit testing, pair programming, and actually talking with the stake holders. Unfortunately, the planning portion is still lacking. Our side of the house has been strategically made void of information silos. Unfortunately, on the COBOL side of things, they still exist. Each COBOL programmer works at their own pace, makes changes, and throws them at the web team to handle. Cause we're agile.

While I believe that true agile is the way to go in software development, I also take a pragmatic approach to things. When initially implementing an agile methodology, it is usually very difficult to get everybody on board, up front, and willing to make all the changes necessary to truly support the change. But, it is important to keep going, keep adding things, keep changing, keep growing, keep learning. It really takes a substantial commitment from management, the customer, and the development team, to realize that they are all in it together.

Thursday, April 4, 2013

Personal Brand - Part 2

In part one, I gave a little back story about myself and how, by failing to manage my "personal brand," I set myself up for a really rough transition out of my current job. One of the great things about owning up to your own mistakes is that you can then do something about it. It is yours to own, it is yours to fix.

I have resolved myself to doing a few things this year to both help promote myself and showcase my capabilities, but to also give back to those who have helped me. I have used a lot of open source, but I have failed, miserably, to give back. That is really wrong and something I want to turn around this year. Really, without thinking, it is easy to pull down everybody else's hard work, through NuGet, and have an app up and running so quickly these days. It is very easy to forget that you're being a heavy consumer, even when you're producing.

Well, I would love to get involved in open source and actually contribute something. My hesitation has been mostly driven by my current employment situation. If something I wrote in open source looked like something I used at work, it would cause some issues. Well, I am on my way out, starting a new chapter, and to hell with it. I want to give back to the community and, hopefully, help somebody out there on the interwebz have a better development experience.

Something else that I have failed to do was keep some sort of blog. It is a bit narcissistic to have one and so I have always had trouble with the idea of putting my random thoughts out on the wire and expecting people to want to read it. But, I realized, this is for me. I am writing to keep track of my own personal progress. It is a way for me to measure my personal growth, keep track of things I'd otherwise forget, and, again, hopefully give back to somebody out there.

While I would love for this experience to produce some magical employment opportunity in the future, that's not really what it is about.

So, I will be working to blog more, tweet more, get involved in open source, and be an all around more giving person on the internet (and IRL). If you have a project on which you want help, post a comment, send me an email, hit me up on Twitter, something. For the time being, I will probably troll around GitHub and look around some more. I really like what Mark Rendle is doing with Simple.Web, so I might fiddle with that a bit until I settle down on a project or two.

I realize that my "lack of experience" on my résumé is going to haunt me for a while. I could, technically, have skipped the Air Force and just focused solely on me and what I want, but that wouldn't have been any good either. So, here I am, taking my first steps to being a better person, managing my own personal brand, and expecting to make a change—somewhere.

Wednesday, April 3, 2013

Personal Brand - Part 1

I have been using computers, programming, and enjoying technology since I was a very little kid. I recently started to look for a new job and realized, very quickly, that I have failed to "manage my personal brand." Here's a little story on how I came to realize it, and, in part two, what I plan to do to fix it.

After having successfully built up a customer base, while serving in the US Air Force, and later transition from military to civilian life on this same clientele, I have found it extremely difficult to explain to employers why I am not a "Junior Programmer." Looking at my résumé, it would appear that I only have three years of development experience. Which is really hard to explain. Really hard.

I successfully built up a great customer base that supported me as I transitioned out of military life to civilian life. Upon deciding to have a child, my wife and I found it prudent for her to come home and me to "get a job." We really wanted a few stable things like healthcare and the ability for me to work a normal 40-hour work week. Had we held off on expanding our family, I would probably still be growing my consultant work and building up a product to bring to market.

Back to work...

Upon posting my résumé online, I received about 20 phone calls from recruiters and had a new job lined up within less than 24 hours. I found myself working back on a military base working on an application that supports a major command (MAJCOM) in the Air Force. I joined the team in their rush to complete a website written using ASP.NET Web Forms with three months left in their year long development cycle. It was a pretty nasty beast with no structure—but it was a "job."

After hitting the release date (which was actually considered a miracle) we went into maintenance mode. The team started to fall apart and, eventually, everybody quit a few months later. Well, everybody except me, the new guy, and a federal employee we worked with. Unfortunately for us, the work load didn't change and the customer still expected the continued support of the application. I became the "lead," as a contractor with the recommendation and support of the "big boss."

Over the next year, I was able to build up a new team and actually competed for, and was hired as, a federal employee. This gave the team some stability, and me the opportunity to change things. I was able to untangle the ball of mud into a pretty elegant ASP.NET Web API and MVC3 solution. My new team was very supportive and open to my guidance. Together we created a composable system that obfuscated the 30+ year old COBOL code and started to drag functionality out of the legacy monolith into C#.

Needless to say, I have been working heavily in .NET for a long time and using, almost exclusively, C#. I know it very well and use my own personal time to research and increase my knowledge. I write code, even when I know I'm going to throw it away, just to practice and learn something new. I explore open source, non-Microsoft frameworks, along with the stuff Microsoft hands us developers. I do not believe that Microsoft has all of the answers and am not a developer that follows them blindly (when able).

Transition

I am now going on a combined two years on this project and was always a bit leery of writing a blog or exposing too much about what I do. My project is not accessible to the public, but it is used world-wide by people from "wrench-turners" to executives in the military. If my application were to suddenly stop, it can keep aircraft from flying, personnel from being moved, and people from working—all over the world. But now I'm leaving.

I decided to stay in the private sector a bit more before jumping back out to form my own company, again. And, after having successfully managed the development and life-cycle of a multi-million dollar application, I am having to answer questions about the difference between a class and an interface. The interviews feel like I won a spot as a player on a very poor C# quiz show. They are very shallow, at best. But I have pushed on through them.

Rejection

Today, I received a rejection notice for a "Software Engineer III" position, from a recruiter:

Hi Jim,

We got feedback from your submission at [redacted]. The hiring manger said that from his perspective you are a little light on the C/.NET development side. He broke it down a little more for us, citing the COBOL application interface, VB6 and independent front end web application work and that he has worked with many engineers in this type of environment for many years. That being said, he needs someone with a more development heavy C/.NET background.

I'll keep looking and will let you know the next time I have a position that suites your skillset. [sic]

I don't even write COBOL! Or VB6 for that matter. Oi! But it is enough to motivate me to manage my personal brand.