Adam Bright

Christian, husband, dad, software developer, aspiring entrepreneur

Page 2


An ode to C#

When I first met you, you seemed awkward and cumbersome with your strict rules on types. My first love was Python which seemed much more approachable with its duck typing and care-free way of solving problems. Then as I got to know you better I began to discover the joys of avoiding many headache inducing bugs with your wonderful type system. Even more to your credit you make your types even more explicit than your older brother Java with the ? suffix on your types to quickly let me know if a variable can be null or not (yes, if the type starts with a capital letter in Java it can be null but C gives you the option).

Now that I am devoted nearly full-time to Java (Android) development I long for your company even more. Simple things like joining a list of strings simply are not possible without downloading external code which means messing with one of Java’s hellish build systems...

Continue reading →


Go with the flow

FluxCapacitor.jpg
I recently completed the major components of a large project at work where I was refactoring an internal messaging system. Being a typical business-driven software shop (yes I know every software shop is business driven but I may go into that in another post) our code is a bit of a mess and there is a large mixture of architectures and styles present within various features of our relatively large web application. Currently, most pages are written using ASP.NET Web Forms which I have come to despise greatly due to the extreme reliance on postbacks to the page. For the refactor I was involved in I was given the green light to try and bring our development practices into the 2010’s. This meant a host of new JSON services written with MVC since we don’t currently use Web API which depresses me a bit but it’s not the end of the world it just takes a bit longer to develop. The exciting...

Continue reading →


I, programmer

I, Robot
I, Robot - Digital Domain

Today my brother-in-law asked for advice on whether he should fill a general elective with an introduction to computer programming course. I admit, I’m a bit biased towards the subject considering that I spend around 45 hours a week programming professionally in addition to another 5-10 hours on my own personal programming projects. But, I wouldn’t spend this much of my time on something I didn’t think was worthwhile. Why do I devote so much of my time staring at a computer making pixels dance how I want them to?

Computer Problems
Computer Problems - XKCD

I love to solve problems, and programming is all about solving problems. Little problems, big problems, weird problems, ordinary problems I love them all. Why do I love problems? Because every problem is an opportunity, an invitation to learn, to conquer, and to make the world a better place. The transition between...

Continue reading →


Threes!

Threes!

I just spent a good chunk of the day playing a browser port of the iOS exclusive game Threes! (port that I’ve been playing).

The concept is familiar and the execution is excellent. At first everything seems easy enough. Put 1’s and 2’s and matching multiples of threes together to create larger numbers. With every shift of the board a new number gets pushed onto the board and any pairs that are lined up in the direction of the shift merge to a single tile of their sum. With every shift you see the next number that is queued up to move onto the board with the next shift.

So simple and yet so addictive. It’s easy to pick up, but difficult to master. All with the clean Apple-esque aesthetic. I love it.

There is only one problem, it’s not available for Android. This may or may not be a good thing considering how much time I have already burned on the browser version in just...

Continue reading →


Interfaces in Python

In the middle of building a web app template with the Tornado web framework I started thinking about how I was including a lot of code dealing with database access in my controller classes. The code is still in a prototype/proof of concept phase but I don’t like egregious cases of mixing concerns so I started thinking about how I could easily swap out providers for my persistence needs.

Now I’m sure I’m not the first person to think of this but I realized that Python makes it really easy to create classes that act like interfaces.

First we will create our class to be used as an interface.

class IPerson:
    def __init__(self, provider_instance):
        self.provider = provider_instance
        self.say_hello = self.provider.say_hello
        self.say_goodbye = self.provider.say_goodbye

We route everything through the provider instance so that the provider can implement helper...

Continue reading →