The Complexity of Design

I think we tend to take design for granted. Sure, when we use a product that is particularly well designed, like the Windows Phone operating system, we’ll take special notice. But generally speaking we just expect things to work well and look pretty. This applies as much to software as any other product. But it doesn’t just apply to the look of applications, it also applies to the code used to build them.

I am currently working on a number base converter for Windows Phone. It is the second application I have ever built. What I’ve learned is that building functionality is one thing, but design is a completely unique animal and can be just as difficult, if not more so. After all, what good is a method to convert one number to a bunch of other bases without a user interface to make it easy to use and to look pretty doing it? I know, obvious, but for a beginner it’s not that simple. I/you don’t have the experience yet to make it easy.

So I thought I’d share a few things I’ve learned so far that may help you along:

  • Think through your design before you start coding: You don’t build a house without a blueprint, so don’t build your applications without one. Layout how would you like the user interface to look, what functionality you want your app to have, etc. You won’t think of everything during the design phase, but laying out what you think you want will save you tons of time in the end. Use whatever design tools you want, pencil and paper, Sketch, Illustrator, it doesn’t matter. Use what you’re comfortable using. And make the design process appropriate for the complexity of your app. Don’t spend 4 weeks laying out an app that does nothing more than hyperlink to your Facebook page. At some point you just have to start coding.
  • Design is an iterative process: For my base converter, I thought I had figured everything out during the design phase. But as I started building I realized there were quite a few things I had never even considered. For example, I have a pop-up keyboard that allows the user to easily enter the base of the number they want to convert to another base. When this keyboard pops up the primary keyboard is hidden to give focus to the task at hand, entering a base. The “base” keyboard only disappears after the user has selected a base to convert from, which seems logical. But what if they decide not to enter a base and just want to close the keyboard? Do I add a Close button? That would disrupt the look of the keyboard. Plus, the natural thing to do in most cases with Windows Phone is to use the back key to get out of something. Users would likely press the back key before they tried anything else. Ok, fine, no problem. But my app is a single page app and pressing the back key exits the app. That’s not good. So I instead need to reprogram the back key to close the base keyboard when it is visible. Seems simple now I have thought of it, but it never even crossed my mind before. It’s likely you’ll come across all kinds of little nuances you never thought about until you go through the testing phase. “Ok, press this, that works. Press this, nope that’s not what I want. Fix that. Ok fixed. Press this. Nope, it should do this instead. You know, I think if we made this change colors instead of doing this other thing that would be better. Hmmm…which color?” You get the idea. Oh…TEST OFTEN!!!!! Don’t wait until you think you’ve finished your app to start testing. Test along the way. Build a new method, test it. Add some buttons, test them. It’s easier to build and test in pieces than it is to slap it all together and hope everything works.
  • Well designed code is just as important as a well designed UI: Writing code is an interative process just like design, particularly for new programmers. Oftentimes what I do is write a method or put together a design element using my current knowledge just to see if I can get everything to work. Once I get things like I want them, then I go back and try and learn a better way to put it all together. For example, if I want 10 buttons on a screen, I might start by building a button in XAML and then duplicating that XAML code 9 times. Hmmm…but I see that all 10 buttons have the same font, and the same margins, and the same background color, etc. There has to be a better way to do this to reduce the amount of code duplication. I wonder if you can create a button template? Bing search. Yep, you can. Sweet. So then I create a style template, apply that style template to each button, and delete all of the duplicate XAML code. Hmmm…this is a pretty simple layout, I wonder if I could create these 10 buttons using a for loop in C# rather than doing all of this XAML stuff? Yep, apparently I can. So let’s try that. Awesome. Instead of having 100 lines of XAML, I now have 15 lines of C#.You’ll also want to spend time commenting your code. Yes, I know, it’s your code, you know how it works. Yeah, but by next week you’ll have forgotten. Why not spend a few minutes now making notes of how and why you did something rather than have to guess later? Certainly at some point you’ll update your app, so make things easy on yourself and use comments liberally. I don’t care if you have to write a paragraph to help you remember how a function works, just do it.

There have been hundreds, if not thousands, of books written on user interface and code design. And I can tell you to go read them all. But I just wanted to share with you a few experiences I’ve had as a beginner, demonstrating to you that, at least for a beginner, application development is a dirty, iterative process. I want you to understand that a simple, pretty end product can be a complete pain in the ass during the design and development stage. And I most importantly want you to understand that the more you design, the more you code, the easier everything will become.

Keep your chin up and happy coding!

More Good Tips on Developing Windows Phone Apps

Here’s another good blog post from the Windows Phone Developer Blog, with 8 on designing Windows Phone apps. Check out the post for all of the details, but here are the highlights to whet your appetite:

  1. Focus: what makes your app unique and what is your mission statement for your app.
  2. Plan: do some upfront leg work on your app’s layout and flow to make sure it makes sense and to save time later.
  3. Love the grid: the Windows Phone emulator grid is your friend when it comes to design, use it in Visual Studio and in Blend (Expression Blend). It’ll save you tons of time putting together your layouts.
  4. Theme it: take advantage of the built in themes of Windows Phone to style your apps.
  5. It’s alive: use Live Tiles to kept your app in focus even when it’s not open.
  6. Let content breathe, never fear the scroll: don’t cram, this isn’t a final exam, give your content room.
  7. Be inspired: embrace Windows Phone’s simple and clear design language.
  8. Sell it: designing and coding are one thing, getting people to use your app is another. Present yourself well in the Windows Phone Store.


ABAP: First Steps…Where the hell do I start?

Generally, when someone expresses interest in programming they are told to take a programming course. “Bob, why don’t you take a Java class at the local community college? Sounds great Sam, thanks for the suggestion.” Java 101…

Week 1: “This is a computer, here’s how you turn it on, it has pieces, and they are all connected together and they do stuff. If you hit the little keys on the keyboard you can make the computer do things, like crash just when you’re writing your term paper that you forgot to save.”

Week 2: “Java is a programming language, it runs on computers, you can write programs with it to do things. Java was created by some people that are a lot smarter than you. Ok, let’s start with primitives.” But wait, I thought we were an advanced species? And it continues for an entire semester. You learn how little pieces work, but no idea what to do with them, how to put them together into a cohesive whole, into a program that someone might want to use.

I’m not going to pretend to be an expert on any programming related topic. I can only tell you what I’ve experienced during my attempt to learn programming. And the traditional structured education path doesn’t work for me, or at least it hasn’t so far. All classes have been about the same. They start by focusing on little pieces, but give you little sense of the bigger picture. You learn just enough along the way to keep you from failing. But unless programming comes naturally to you, by the time the class is over you’ve forgotten everything you learned and you’re back at square one.

It seems to me a better approach would be to focus on a goal. This semester we are going to write a program that does XYZ, and we are going to be using the ABC programming language. Don’t worry, it’s going to be confusing at first, but we are going to break apart this program, piece by piece, focusing on each piece one at a time. Each piece is going to teach us important concepts about programming and programming languages in general, but also about the specific syntax of ABC. But you should understand that you could probably write this program in 20 other languages. Doesn’t that sound better than, “this is an int, you use it to store numbers”, “this is a string, you use it for text”, “this is a class, you make objects with it”, etc.?

So, let’s do that. Let’s start with the big picture and then drill down into the details. We can use my first Windows Phone program as a starting point. I’ll walk you step-by-step through the process I used to develop it, the things I had to learn, what I learned I still had to learn, what I realized I could and should have done differently, etc. This is going to be as much of an educational process for me as for you.

We’ll get started in the next installment. I’m hungry.




ABAP: First Steps

A couple of weeks ago I published my first Windows Phone application. Other than the simple programs I wrote in the programming classes I’ve taken, it was the first somewhat useful application I’ve ever written. It’s called Connectivity Manager. It does what all of the other connection managers do, it links to the various connection settings visible to the user and the programmer, like Wi-Fi, Bluetooth, etc. It’s basically a glorified linker. But I needed to get my feet wet.

I’m currently working on a base converter. Yep, that’s been done plenty of times before as well. But again, you have to start somewhere. Your first, second, or third programs, hell, maybe even your 100th, are not likely going to be blockbuster hits. If that happens to you, that’s absolutely incredible and I’d love to hear your story. But for most of us, it’s going to be slow going.

You need to think of your first programs as learning experiences, no different than when you took your first baby steps. Those first steps were the hardest damn thing in the world, only you didn’t know enough at the time to get frustrated and give up. You kept trying, falling, crying, trying, falling, crying, until eventually you got on your feet. At that point it was all smiles, because those cookies on the counter were that much closer. Now if mom and dad would only leave the room…

Programming is no different. It’s one step at a time. If you don’t take it one step at a time, you will quickly overwhelm yourself. There is so much to learn, so much history, so much present, and so much future that if you don’t break it down into manageable pieces you’ll likely walk away. That’s what I always did in the past. That’s likely what many of you did too. Well, let’s not do that anymore. I’m talking to myself as much as I am to you.

So, you ask, where do I start? That’s a very good question. I’m not going to get into any specifics here, I’m going to talk very generally and I’m going to try to stay away from “well, it depends”, as much as possible.

I’m going to try and keep these posts relatively short. I don’t think anyone wants to read a blog encyclopedia. So on to my next post to continue the journey…

A Beginner’s Adventures in Programming (ABAP)

If you don’t already know, I’m very, very new to programming and application development; and as of this writing I’m 41 years old. Compared to many programmers I’m probably 30+ years behind the curve. But who cares?

I didn’t always feel that way. For years, I’ve dabbled in programming, ranging from Excel macros to web development to most recently taking introductory college courses in Assembly, C, C++, and Java. But I’ve always walked away because it just seemed too daunting. There are so many languages out there and the technology moves so quickly that it just didn’t seem to make sense to start so late in life to learn something new, something that I never felt I could get good at quickly enough to keep up. Well, that was the old me.

Something happened a month or two ago, a switch flipped in my head. Perhaps my brain finally figured out how to catch the exception and handle it properly. Honestly, I don’t know what happened, and I really don’t care, because I finally found direction. Now I’m learning C#, XAML, JavaScript, and HTML/CSS. I published my first Windows Phone app a few weeks ago. As of today, it’s been downloaded 921 times. That’s 921 random people that felt compelled enough to at least check out something I created. Whether or not they continue to use it is another matter, but at this point I don’t care. To me, it’s all about the experience.

Having listened to various podcasts for the last few months, I hear lots of comments from the podcasters that many people have dipped their toes in programming, but for various reasons gave up — life got in the way, it seemed too hard, they didn’t know where to go with it, etc. If you’re one of those people (I was definitely one of those people), I’d like to share my journey with you so that you can see that no matter what your age, what your current occupation (I’ve been in finance my entire professional career), you can learn to program, you can do something useful with it, you can stretch your mental abilities and be on a never ending path of learning, and, most importantly, you can have fun doing it.

Let’s get started…