The vast majority of the time, I enjoy working with dependency injection. Sometimes, however, I find myself rolling my eyes at the amount of “ceremony” boilerplate code it takes in order to take advantage of it. Disclaimer: This is more a limitation of C# having been created before DI containers became common than a problem with DI itself.
Read the rest of this entry »
I freely admit it – I have very little talent for creating images. So when I recently needed to add an icon to a website for users to download files, I dreaded the thought of having to create a picture of a download arrow. Then I remembered that Visual Studio comes with images that can be freely used in your applications!
The image library is installed with Visual Studio, but you’ll have to extract the contents yourself. Look in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033 (or just “Program Files” if you still have a 32bit machine) and you’ll find VS2010ImageLibrary.zip.
Read the rest of this entry »
One of the things I like about C#’s delegate types, compared to similar concepts in other languages, is that C#’s take on the concept lets you give a useful name to a family of functions:
public delegate TResult Converter<T, TResult>(T input);
With this definition, all functions that turn one thing into another thing are Converters. Nice.
We also have some generically-named Action<…> and Func<…> delegate types defined for us, and these have become ubiquitous ever since LINQ was introduced. They’re not as communicative, but still extremely useful, and for the most part the naming stays out of the way.
Delegate types allow you to give a name to a family of functions. However, you can run into trouble when you use two different names to refer to the same family of functions:
Read the rest of this entry »
I have the privilege of working with lots of smart people. Sometimes they blog about things that are new, weird, wrong or backwards. Jimmy Bogard posted something the other day that, to me, was weird. If you’re bringing ASP.NET Web API into an existing ASP.NET web site or application, you probably want your API custom errors to match your web app’s custom errors. By default, this isn’t hooked up out of the box. In Jimmy’s post on Los Techies, you’ll notice how he solves this problem.
What is ASP.NET Web API?
I’ve worked with ASP.NET’s take on HTTP for quite some time, but I’m usually the guy that avoids the past opinions of the Microsoft team. I feel like I understand how the web works and bulky .NET classes around it seem heavy handed and usually overkill; I try to avoid them at all costs. This is why ASP.NET Web API appeals to me. It’s a lighter-weight approach to the web with C# and the .NET stack. A few individuals have been paying attention to this for a few months now and I decided to help out a little bit after. Read the rest of this entry »
In a conversation about large software projects, the word “architecture” is bound to come up sooner or later. Most programmers have a gut feeling for what this really means with regard to software, but if you asked 10 programmers to define it, you’d get 10 different answers.
In Who Needs an Architect?, Martin Fowler covers a few definitions which he ultimately boils down to one simple concept: architecture is the decisions that are hard to change.
Read the rest of this entry »
Welcome Number 7941
I’d like for you to take a moment and imagine that today is your first day at a new company. You enter the building wearing the carefully selected slacks and shirt ironed the night before. You’re filled with nervous energy, but confident, because out of the fifty plus candidates, who did they select to write their new custom software solution? That’s right, you.
The friendly HR rep that recruited you shakes your hand and leads you to a large conference room where you attend a new hire orientation. You’re promptly handed an employee handbook the size of a telephone book and sit down. Opening to a random page on Computer/IT Usage policies you learn that it’s against company policies to look at **cough** questionable **cough** images on company computers. Interesting, you think to yourself, I figured that was common knowledge.
Over the next four hours you listen to HR representatives speak about company history, company policies, and benefits. You fill out form after form of information asking for social security numbers, driver’s license number, passport number and other private information. You’re handed a badge with an employee number, 7941. Read the rest of this entry »
There’s something nice about returning to an old design pattern. Comparing it with the pattern you’re currently using gives you new insights about both.
When I was writing ASP.NET WebForms apps, my team organized the UI layer with an MVP (Model View Presenter) pattern, preferring the Passive View variant. This allowed us to write Views that were small and lean, pulling as much logic as possible out of that untestable wasteland of UI markup and code-behind. More recently, I’ve been developing ASP.NET MVC applications (using the MVC (Model View Controller) pattern, naturally), and I like how my Views can be straightforward HTML with a few fill-in-the-blank spots for the data I want to display; much simpler to understand than the old WebForms server controls. But my most recent project, I wrote in WPF (Windows Presentation Foundation) due to some specific needs of the client, and I had to re-open the UI design pattern question. Read the rest of this entry »
We have a lot of different options for data storage and retrieval available today. These options include the traditional relational database, document databases, key value stores, and even flat files. Every option has its benefits over the others, making some options better for some things and other options better for other things. Once the data storage and retrieval option is selected, we then typically have to select a product. Within a solution space, most products offer some distinction from their competitors. Such distinctions make certain products popular choices for a particular technology stack. For example, MySQL is a common choice for the LAMP stack, as is Microsoft SQL Server for the .NET stack.
Why is this so? There are several reasons for this, and their importance varies between administrators, developers, managers, and even executives.
From a developer’s point of view, it comes down to whether or not the product in the solution space makes the work more enjoyable. Read the rest of this entry »
Most of my first job out of college was spent doing desktop development, some of which was in VB6. I didn’t love it, but it was easy to learn. When this button is clicked, that function runs in response to it. Easy.
The controls-and-event-handlers model combined with the language also made it exceptionally easy to create a tangled pile of misplaced responsibilities, but I think you’ve got to experience that kind of pain before you can see that alternatives even exist. Once you’ve felt the pain, you can better-evaluate which guidance is actually going to be helpful.
Read the rest of this entry »
Headspring’s latest new hire is Cedric Yao, Senior Consultant. We’re really excited to have him on board, and I am super excited to get a fresh addition into this series.
Cedric has been in Austin for a few years, and just welcomed his first born son into the family 5 weeks ago! We talked about Austin, why working here is so much fun, and what we really love about technology. As it turns out we share a lot of the same interests in bringing together communities through technology. His experiences are going to be a real help to me with planning and preparation for Headspring’s Central Texas Give Camp in September.
Here’s how the rest of our conversation went: Read the rest of this entry »