What were they thinking

As of late I have been spending a lot of time working on a “legacy” system. The term legacy means different things for different groups, in the circle I’m working with these days it means a system that is no longer being actively developed. As has been stated by mean, software isn’t “dead” it’s “done”.

The catalyst for the work I’m doing is security requirements that need to be applied. While applying the updated security polices I’ve also been tasked with migrating the system from our data center to our cloud data center. As I move through the system I’m confronted with implementations that looking at now seem crazy; however, it’s these situations where it is important to apply two mindsets. One is giving others the benefit of the doubt. In a case like this, those that were working on this system used, for the time, the best options the technology stack could offer. For example, the extensive use of WCF seems silly now; however, at the time it was a recommended approach to hooking up independent systems. When reviewing the code in light of this you can really see how those that worked on it were making thoughtful and considerate choices.

The second mindset that is important to apply, and in my mind is more important to adhere to, is to assume good intent. This is important because even if someone did NOT follow the prevailing approach for the time, or use the best in class technology they had a good reason, or good intent for doing what they did. Consider those that came before as doing the best work they could. Perhaps they had constraints that prevented them from making, what would seem like, a better choice. Perhaps their was a time constraint as is so often the case. Perhaps, as we so often assume, they didn’t know any better, but even then, they were trying their best, which is worthy of acknowledgement.

Now how does this help, well often it allows you to see the system in the light of what it does well. It will provide a perspective that can outline what the system can offer and, as I’m finding, it will allow you to find an approach to extend/adjust the system to comply with the new constraints you are tackling.

So the next time you work on a legacy system and you are cursing the fool that came before, stop and think... give them the benefit of the doubt and assume they had good intentions. You will land in a better spot.

Being a good customer means being able to complain in a way that is helpful

BAD SURVEY: Tell us what you think... OK, GREAT, EXCELLENT, AMAZING!!!!I'm often told that I deal with difficult situations in a way that results in getting what I want. To me this is quick an interesting observation because I find that most often what people mean when they say that is, when I receive a poor customer experience I'm able to turn things around so that I obtain a desirable outcome, thus turning a bad experience into a good one.

This manifest itself most often when I'm out and about with my wife. We will be at a retail store, or out to dinner and something will go wrong. Often my wife will turn to me and suggest that I handle it since "I know how to deal with these things". So what is the secret to my taking a bad situation and turning it around... being a good customer.

As it turns out business want to make money. Shocking, I know. The way they make money is by advertising to attract customers to frequent their brick and mortar locations to use their services or purchase their goods. Knowing this puts the customer in wonderful position. How so? Well said business has already spent a measurable amount of money to get you in the door and ideally they would like you to come back without having to spend a lot more money on advertising. If you have had a bad experience and they are made aware of this then the responsible business will train their employees to try and recover the situation by offsetting the bad with good. This can be in the form of a coupon, discount, or even the wonderful freebie.

But there is the human element to these situations that can result in you missing out on ANY benefit. Case in point, let's say you are out for dinner and you have a bad experience and feel you are do some offsetting consideration how can you go about achieving this goal and turning the situation into a benefit.

My tried and true method is to make someone aware and stick to the facts. Often this translates to asking to speak to the person in charge AND being specific. If you are at a retail store and find that you are charged the wrong price don't dispute the matter with the cashier. They won't have access to change a price in the Point of Sale, also they are most often NOT involved in causing the issue so don't waste their time and yours trying to make them fix the price at the register. Ask to have your ticket transferred to the customer service desk. Remember you can always get a refund on the missed price item and thus holding up the line only annoys people and will NOT get you want you want, which should be the price you expected to pay.

When you find a person "in charge" stick to the facts. Can you show them in print the price you expected to pay? If so you almost are guaranteed to be able to buy the item at the price in print. If it's just the price you "thought" you say you have very little ground to stand on. But let's say you HAVE the e-mail or print ad with the price listed and it's less than what was on your receipt. If it's less than 1-2% of the overall purchase then there will probably be little discussion about the difference being refunded; however, more than that and it's possible the company could be losing money on the deal and with margins the way they are it could be a deal breaker.

What to do in those situations? First, align your objective. You want the price listed and the company doesn't want to lose money, sounds like a great time to bargain. If you are committed to buying the item then any discount at all is a win, so.. start big and back down. Ask for the full difference in price, if they don't budge ask for 75% less, then 25%... nothing hurts in asking. Also this is when it helps to be mindful of your surroundings. If you think "making a stink" and drawing attention will get you what you want, along the lines of "give me what I want and I'll stop making trouble" you are slipping into the mindset of being a trouble maker. Let me ask you, do you want to help a troublemaker. Probably not. If you are polite and DO NOT draw undo attention then a person in charge is more inclined to think that they can "make you happy" without others needing to catch wind of the price change and cause a stamped.

At this point once you have a "person in charge" and they realize you are looking for some type of compensation/consideration, it helps to be clear about your problem. What I mean by this is explain your desire to continue to be a customer and that this misinformation about price will make it hard for you to "trust" their advertising; however, you do really like their store and are interested in coming back; otherwise your inclined to just use the online retail which guarantees the price. This last line is the kicker. Retail in particular is very aware that it is at a disadvantage with the online competition so reminding them of this, while sometimes a risk, often results in the push to get the desired consideration.

All of this advice also is mute if you are not a considerate customer. Don't be rude, don't belittle people who are employee's of the company. Be respectful and attempt to avoid making "problems" for others.

I hope my approach helps you complain in a helpful way.

Benefits of Working with .NET ConcurrentQueue<T>

Working with a queue in .NET is an excellent experience and provides a great way to decouple execution paths. Once you start working with in memory queues your just a hope, skip, and a jump away from using "infrastructure" queues such as Service Bus, RabbitMQ, or even MSMQ on Windows Desktop.

While it is quite possible to work with the standard .NET Queue<T> object if you find that you are in need of using a lock to ensure consistent results with putting things in the queue (i.e. Enqueue) and taking things off (i.e Dequeue or Peek) or even just to obtain a consistent reliable count, well then you should probably take a look at ConcurrentQueue<T>.

There is a whole section of the .NET Framework with deals with concurrency concerns by creating specific objects for Dictionaries, Stacks, Queues and more that are considered thread safe.

When I started working with ConcurrentQueues I found it helpful to put my own wrapper around the concurrent queue object and so I've demonstrated that in the following sample which I hope others find useful.

Link to example: https://gist.github.com/briannipper/c861e708874428d4dc6dda5817411c70
*Public Domain, Link

Things I need to remember... IIS Express ports for HTTPS and Configure WCF Rest endpoints for HTTPS

Don't Forget
As I have been writing consistently for a bit now I've already found myself referring back to things I've posted, which has prompted me to try and post items which have taken a bit of time to work out. It seems that the act of "writing it down" causes me to remember information better. Perhaps it's all the thought into attempting to write something useful.

This post includes two details which took me more than a few hours to sort out so I hope to help others who have a similar need. Funny enough it could be me in the future after I've forgotten this information.

First up is a little detail that I know I've forgotten and looked up more than once, and depending on the google/bing results I find sooner or later.

Setting up IIS Express to host a site via HTTPS

When configuring your site to run in IIS Express using Visual Studio it's fairly trivial to set the attribute to use SSL (i.e. HTTP over SSL which is HTTPS) as it's just an "enable" in the drop box for use SSL. Additionally when you do this it will ensure that a local cert is setup as well which should be locally trusted so that the browser doesn't through any warnings; but a detail that could trip you up is you'll need to use a PORT within a specific pre-allocated range as IIS Express grabs the range just for this purposes.

Port range 44300 to 44399

A great troubleshooting at pluralsight that includes this little gem on port ranges along with other tips.

Setup bindings for WCF REST service end-points to use HTTPS be default

I'll be the first to acknowledge that this is really legacy information as WCF REST services have been essentially deprecated by .NET WebAPI technologies, and for that I'm VERY pleased; however, working with legacy technologies has NOT been deprecated so I'll post this here for others benefit.

This nugget of information took me the better part of the morning to dig out of a the Microsoft site on A Developer's Introduction to Windows Communication Foundation 4.

The detail I needed was found under the sub-heading aptly named Default Binding Configurations where it outlines that if you would like a particular binding to be used by default you simply need to create the binding without a name and by this convention all service end-points will, be default utilize this binding. The same is true of a behavior configuration, omit the name property and the binding or behavior is adopted by all services defined in the project.

From the same document they provide the following sample which I've replicated and modified to demonstrate how to enable HTTPS for all your service end-points.

<security mode="Transport" />
</binding> </basicHttpBinding> </bindings>