September 5, 2015 colophon

Blog Past and Future

Blog Past and Future

This blog started as a single static page in 1995 as a set of links to provide to my students while I was teaching at DevelopMentor. I would like to show you a screenshot of that initial page, but as it turns out, the site predates the internet archive, so I can only show you what it looked like in 1998:

image

I guess I was doing some independent contracting at the time, because I was billing myself as a Windows Object Architect,” whatever that is. BTW, I wouldn’t call that phone number if I were you — I don’t know who it will ring, but it won’t be me. The rest still works, however.

Posts

Over the years, I’ve done more or less blogging based on my current gig:

image

This post will be my 2,650th, with the peak in 2003.

Tweets

Now, I’m far more active on Twitter:

image

My first tweet was in October of 2009. I’d had an account for a while before that, but I just didn’t get it at first. Now I love it and have produced 3,053 tweets in 7 years. I find that while I like long-form writing a great deal, it’s much easier to find the time to turn a single thought into 140 characters then into 1400 words.

Blot

This is all coming up now because I’m busy moving to Blot, which gives me a chance to take a look back at all of this content I’ve generated. I love Blot because I can dump all of my old content into Dropbox in HTML fragment format (along with some per-file metadata) and Blot will produce a reasonable static site for me. By moving to the file system from a blogging API (AtomPub in my case), I can remove the need to use blogging tools (like Live Writer) and instead switch to any reasonable editor I want.

Further, since Blot supports all kinds of formats, I can move to Markdown for new content but not have to try to translate all of my HTML content, which is a lifesaver.

Unfortunately, the port to Blot is taking longer than I’d like for two reasons. The first is simply that David Merfield just didn’t anticipate some old guy dumping 20 years worth of blog content into his system, so there have been some problems. The good news is that David is extremely responsive. Every system has issues, but the measure of quality is how long it takes to go from issue reported to issue fixed and in the case of Blot, that time is sometimes days but often hours, which includes adding features specifically for my use case that he just hasn’t needed before. Highly recommended.

The Dead Web

The other reason that this translation is taking some time is that I’ve got a few link formats in my content and relied on IIS URL rewriting to keep them working. As I move to Blot, it’s easier to just fix the URLs as I extract the data from SQL Server (and I still use and love RegexD to figure out how to translate those URLs). As I do that, I’m testing for 404 links on my new site to make sure that I haven’t screwed anything up (I like Xenu’s Link Sleuth for that work).

What I’m finding is that I’m fixing my own URLs but finding hundreds of links into the larger web that are broken. That’s just depressing. I work hard to keep my site running for anyone that wants the old data and I’ll be working with David on a URL forwarding scheme and 404 logging to keep external links working as I move to Blot. However, that doesn’t seem like an important goal for other folks.

Where Are We?

Still, I get to move to Blot and use whatever editor I want from whatever OS I want, so I’m a happy guy. Hopefully that happiness will translate into more blog posts, but if it doesn’t, I imagine I’ll still be spouting off on Twitter at the very least. Everyone needs a place to spout off sometimes.

January 4, 2015 .net spout

Handling Orientation Changes in Xamarin.Forms Apps

Handling Orientation Changes in Xamarin.Forms Apps

By default, Xamarin.Forms handles orientation changes for you automatically, e.g.

ss1[5]

ss4

Xamarin.Forms handles orientation changes automatically

In this example, the labels are above the text entries in both the portrait and the landscape orientation, which Xamarin.Forms can do without any help from me. However, what if I want to put the labels to the left of the text entries in landscape mode to take better advantage of the space? Further, in the general case, you may want to have different layouts for each orientation. To be able to do that, you need to be able to detect the device’s current orientation and get a notification when it changes. Unfortunately, Xamarin.Forms provides neither, but luckily it’s not hard for you to do it yourself.

Finding the Current Orientation

To determine whether you’re in portrait or landscape mode is pretty easy:

static bool IsPortrait(Page p) { return p.Width < p.Height; }

This function makes the assumption that portrait mode has a smaller width. This doesn’t work for all future imaginable devices, of course, but in the case of a square device, you’ll just have to take your changes I guess.

Orientation Change Notifications

Likewise, Xamarin.Forms doesn’t have any kind of a OrientationChanged event, but I find that handling SizeChanged does the trick just as well:

SizeChanged += (sender, e) => Content = IsPortrait(this) ? portraitView : landscapeView;

The SizeChanged event seems to get called exactly once as the user goes from portrait to landscape mode (at least in my debugging, that was true). The different layouts can be whatever you want them to be. I was able to use this technique and get myself a little extra vertical space in my landscape layout:

ss2

Using a custom layout to put the labels on the left of the text entries instead of on top 

Of course, I could use this technique to do something completely differently in each orientation, but I was hoping that the two layouts made sense to the user and didn’t even register as special, which Xamarin.Forms allowed me to do.

January 2, 2015 .net spout

Launching the Native Map App from Xamarin.Forms

My goal was to take the name and address of a place and show it on the native map app regardless of what mobile platform on which my app was running. While Xamarin.Forms provides a cross-platform API to launch the URL that starts the map app, the URL format is different depending on whether you’re using the Windows Phone 8 URI scheme for Bing maps, the Android Data URI scheme for the map intent or the Apple URL scheme for maps.

This is what I came up with:

public class Place {
  public string Name { get; set; }
  public string Vicinity { get; set; }
  public Geocode Location { get; set; }
  public Uri Icon { get; set; }
}
public void
LaunchMapApp(Place place) { // Windows Phone doesn't like ampersands in the names and the normal URI escaping doesn't help var name = place.Name.Replace("&", "and"); // var name = Uri.EscapeUriString(place.Name); var loc = string.Format("{0},{1}", place.Location.Latitude, place.Location.Longitude); var addr = Uri.EscapeUriString(place.Vicinity); var request = Device.OnPlatform( // iOS doesn't like %s or spaces in their URLs, so manually replace spaces with +s string.Format("http://maps.apple.com/maps?q={0}&sll={1}", name.Replace(' ', '+'), loc), // pass the address to Android if we have it string.Format("geo:0,0?q={0}({1})", string.IsNullOrWhiteSpace(addr) ? loc : addr, name), // WinPhone string.Format("bingmaps:?cp={0}&q={1}", loc, name) ); Device.OpenUri(new Uri(request)); }

This code was testing on several phone and tablet emulators and on 5 actual devices: an iPad running iOS 8, an iPad Touch running iOS 8, a Nokia Lumia 920 running Windows Phone 8.1, an LG G3 running Android 4.4 and an XO tablet running Android 4.1. As you can tell, each platform has not only it’s own URI format for launching the map app, but quirks as well. However, this code works well across platforms. Enjoy.

January 1, 2015 .net spout

App and User Settings in Xamarin.Forms Apps

App and User Settings in Xamarin.Forms Apps

Settings allow you to separate the parameters that configure the behavior of your app separate from the code, which allows you to change that behavior without rebuilding the app. This is handle at the app level for things like server addresses and API keys and at the user level for things like restoring the last user input and theme preferences. Xamarin.Forms provides direct support for neither, but that doesn’t mean you can’t easily add it yourself.

App Settings

Xamarin.Forms doesn’t have any concept of the .NET standard app.config. However, it’s easy enough to add the equivalent using embedded resources and the XML parser. For example, I built a Xamarin.Forms app for finding spots for coffee, food and drinks between where I am and where my friend is (MiddleMeeter, on GitHub). I’m using the Google APIs to do a bunch of geolocation-related stuff, so I need a Google API key, which I don’t want to publish on GitHub. The easy way to make that happen is to drop the API key into a separate file that’s loaded at run-time but to not check that file into GitHub by adding it to .gitignore. To make it easy to read, I added this file as an Embedded Resource in XML format:

image

Adding an XML file as an embedded resource makes it easy to read at run-time for app settings

I could’ve gone all the way and re-implemented the entire .NET configuration API, but that seemed like overkill, so I kept the file format simple:

<?xml version="1.0" encoding="utf-8" ?>
<config>
  <google-api-key>YourGoogleApiKeyHere</google-api-key>
</config>

Loading the file at run-time uses the normal .NET resources API:

string GetGoogleApiKey() {
  var type = this.GetType();
  var resource = type.Namespace + "." +
Device.OnPlatform("iOS", "Droid", "WinPhone") + ".config.xml"; using (var stream = type.Assembly.GetManifestResourceStream(resource)) using (var reader = new StreamReader(stream)) { var doc = XDocument.Parse(reader.ReadToEnd()); return doc.Element("config").Element("google-api-key").Value; } }

I used XML as the file format not because I’m in love with XML (although it does the job well enough for things like this), but because LINQ to XML is baked right into Xamarin. I could’ve used JSON, too, of course, but that requires an extra NuGet package. Also, I could’ve abstracting things a bit to make an easy API for more than one config entry, but I’ll leave that for enterprising readers.

User Settings

While app settings are read-only, user settings are read-write and each of the supported Xamarin platforms has their own place to store settings, e.g. .NET developers will likely have heard of Isolated Storage. Unfortunately, Xamarin provides no built-in support for abstracting away the platform specifics of user settings. Luckily, James Montemagno has. In his Settings Plugin NuGet package, he makes it super easy to read and write user settings. For example, in my app, I pull in the previously stored user settings when I’m creating the data model for the view on my app’s first page:

class SearchModel : INotifyPropertyChanged {
  string yourLocation;
  // reading values saved during the last session (or setting defaults)
  string theirLocation = CrossSettings.Current.GetValueOrDefault("theirLocation", "");
  SearchMode mode = CrossSettings.Current.GetValueOrDefault("mode", SearchMode.food);
  ...
}

The beauty of James’s API is that it’s concise (only one function to call to get a value or set a default if the value is missing) and type-safe, e.g. notice the use of a string and an enum here. He handles the specifics of reading from the correct underlying storage mechanism based on the platform, translating it into my native type system and I just get to write my code w/o worrying about it. Writing is just as easy:

async void button1_Clicked(object sender, EventArgs e) {
  ...

  // writing settings values at an appropriate time
  CrossSettings.Current.AddOrUpdateValue("theirLocation", model.TheirLocation);
  CrossSettings.Current.AddOrUpdateValue("mode", model.Mode);

  ...
}

My one quibble is that I wish the functions were called Read/Write or Get/Set instead of GetValueOrDefault/AddOrUpdateValue, but James’s function names make it very clear what’s actually happening under the covers. Certainly the functionality makes it more than worth the extra characters.

User Settings UI

Of course, when it comes to building a UI for editing user settings at run-time, Xamarin.Forms has all kinds of wonderful facilities, including a TableView intent specifically for settings (TableIntent.Settings). However, when it comes to extending the platform-specific Settings app, you’re on your own. That’s not such a big deal, however, since only iOS actually supports extending the Settings app (using iOS Settings Bundles). Android doesn’t support it at all (they only let the user configure things like whether an app has permission to send notifications) and while Windows Phone 8 has an extensible Settings Hub for their apps, it’s a hack if you do it with your own apps (and unlikely to make it past the Windows Store police).

Where Are We?

So, while Xamarin.Forms doesn’t provide any built in support for app or user settings, the underlying platform provides enough to make implementing the former trivial and the Xamarin ecosystem provides nicely for the latter (thanks, James!).

Even more interesting is what Xamarin has enabled with this ecosystem. They’ve mixed their very impressive core .NET and C# compiler implementation (Mono) with a set of mobile libraries providing direct access to the native platforms (MonoTouch and MonoDroid), added a core implementation of UI abstraction (Xamarin.Forms) and integration into the .NET developer’s IDE of choice (Visual Studio) together with an extensible, discoverable set of libraries (NuGet) that make it easy for 3rd party developers to contribute. That’s a platform, my friends, and it’s separate from the one that Microsoft is building. What makes it impressive is that it takes the army of .NET developers and points them at the current hotness, i.e. building iOS and Android apps, in a way that Microsoft never could. Moreover, because they’ve managed to also support Windows Phone pretty seamlessly, they’ve managed to get Microsoft to back them.

We’ll see how successful Xamarin is over time, but they certainly have a very good story to tell .NET developers.

November 1, 2014 spout

Microsoft Fan Boy Goes To Google

Microsoft Fan Boy Goes To Google

In 1992, I was a Unix programmer in Minneapolis. I’d graduated with a BS in Computer Science from the University of MN a year earlier and had written my programming assignments in C and C++ via first a VT100 terminal and then a VT100 terminal emulator on my Mac (running System 7, if you’re curious). My day job was at an AT&T VAR building multi-user voice response systems on Unix System V. My favorite editor was vi (not vim) and, like all good vi programmers, I hated emacs with a white hot passion.

Being bored with my current job, I posted my resume on the internet, which meant uploading it in ASCII text to an FTP site where tech companies knew to look for it. The tech company that found it was Intel. To prepare for my interview in Portland, OR, I went to play with a Windows 3.1 machine that someone had set up in the office, but nobody used. I had a Mac at home and Unix at work and for the 10 minutes that I could stand to use it, Windows 3.1 seemed like the worst of both. In spite of my distaste, Intel made an offer I couldn’t refuse and I found myself moving with my new wife to a new city for a new job and a new technology stack.

The move to Intel started my love affair with Windows (starting with Windows 95, of course, let’s be reasonable). Over the years, I grew to love Word, Excel, Visio, PowerPoint, Outlook, Live Writer, Skype, Windows XP, Windows 7, COM, ATL, .NET, C# and of course the Big Daddy for Windows developers: Visual Studio. Not only did I become a Windows fan boy (I can’t tell you how lonely it is to own a Windows Phone after the iPhone was released), but I became I contributing member of the Windows community, accounting for nearly 100% of the content on this web site, first published in 1995 solely to provide links to my DevelopMentor students, but growly steadily since (over 2600 posts in 20 years). Add to that to more than a dozen books and countless public speaking engagements, magazine articles and internet appearances and you’ve got a large investment in the Windows technology stack.

Of course, as I take on roles beyond consultant, speaker, author and community PM, I contribute less and less (although I do love spouting off into my twitter feed). Even so, I’ve been a regular attendee to Windows-related events and 90% of my friends are also Windows developers, so the idea of leaving not just a technology ecosystem but an entire community behind is a pretty daunting one.

And then, about 45 days ago, Google came knocking with an offer I couldn’t refuse. A few days after that, before I’ve even officially accepted the offer, I find myself in a bidding war for a house in Kirkland, WA that the wife and I both love (which almost never happens). So, for the first time since 1992, with my three boys graduated from high school, I find myself moving with my new wife to a new city for a new job and a new technology stack. As I write this, it’s the Friday before my Noogler orientation week (New Googler — get it?). I’ll be working on tools for Google cloud developers, which matches my Windows experience helping developers build distributed systems, although there’s going to be a huge learning curve swapping in the details.

After 20 years with Visual Studio, I don’t know if my fingers still know vi, but I can’t wait to find out. If I get a beer or two in me, I might even give emacs another try…

August 1, 2014 interview

Future Proof Your Technical Interviewing Process: Hiring or Not

This is the last in a 4-part series on how to interview well. Parts 1-3 covered the phone screen, the technical interview and the fit interviews. In his part, we’ll wrap up by talking about how to make the hiring decision.

Make Time For Questions

As important as what questions you ask the candidate are leaving time for them to ask their questions. Remember that they’re interviewing you, too. Be open and honest about the answers; technical people have a sensitive bullshit detector, so don’t try to pretend that everything is perfect; they’ll know if you’re not being sincere. However, it’s a fine line. If you find yourself dwelling on the negative, you have to wonder if you’ve found a good fit for yourself.

Also, don’t forget to factor their questions into your own thinking about the candidate. The questions they ask about a job and a team they’re going to be spending 40+ hours/week with is as good an indicator of how they think as anything else.

Making the Call

As you pass the interview candidate from person to person, make sure that you spend a few minutes in private with the next interviewer talking about what you heard that you liked as well as things you’d like them to circle back on. You want to give them an opportunity to try again, either to convince you it’s not an issue or to confirm that it is.

Every interviewer should share their thoughts about the candidate soon while they’re fresh. You can send an email around to the team as you finish or get together in the same room after the candidate has headed home, but it should be the same day; those first impressions matter.

Ultimately each interviewer will provide three pieces of information: a thumbs up/down (whether you use actual thumbs for this process is up to you : ), a confidence level (do you really love this person? are you on the fence?) and an explanation (“I loved how they think about the customer!” or They never figured out how to efficiently search an infinite space of possible solutions.”)

The set of interview results will come out in three ways:

  1. Everyone loved that candidate. Hire them.
  2. Everyone hated the candidate. Don’t hire them. Be polite!
  3. There’s a mix. Discuss. Potentially get more info.

Of course, options #1 and #2 are easy to deal with. Unfortunately, option #3 is where most candidates fall. The question is, what do you do with a candidate with mixed results? If you’re following the principle that it’s better to send a good candidate away then to hire a bad candidate, then you’ll pass on them. However, you’ll want to spend some extra time on candidates like these. Discuss it amongst the team. See how adamant the thumbs up voters are and why. See how adamant the thumbs down voters are and why. If the candidate is on the fence but leaning towards hire,” pick someone else to talk to them and/or get them into a different environment, e.g. the bar down the street or the bowling alley at the company Xmas party, and see how they do.

Ultimately, it boils down to one thing: does the team as a whole want to bring the candidate into the team? If so, great. If not, let them go. Certainly a senior member of the company or department can override the team and hire a candidate above their objections, but I wouldn’t recommend it. You’re much more likely to hurt a good team in those situations then to help it.

Where Are We?

Whether you agree with the specifics of this process or not, I encourage you to spend the time to really examine your process. You want the team you build to be more than the sum of the parts, but that kind of magic requires first that you have great parts.

July 29, 2014 interview

Future Proof Your Technical Interviewing Process: The Fit Interviews

If you just found yourself here, you’ve stumbled onto a multi-part series on the technical interviewing process. Part 1 covered the phone screen and part 2 covered the technical interview. Today we’re going to discuss the fit” interviews, that is, team and cultural fit.

The Team Fit Interview

Modern software development is done in teams. You want to be able to judge any candidate as a productive, positive member of your team. They don’t necessarily have to have experience doing things the way you do them, but they should show the ability to adapt when issues arise. Your job in the team fit interview is to break the important things that happen in your team into situations that you can ask your candidate about. The following are pretty standard examples:

  • What’s the right process for gathering requirements?
  • How do you convince someone that you’ve got a good idea?
  • What do you do when you can’t convince them?
  • How do you deal with vague requirements?
  • What happens if you’re asked to do something you don’t agree with?
  • etc.

However, you have to be careful here. Pretty much anyone can give you the right” answers to these questions, but you don’t want the right” answers — you want the real answers. How does a candidate actually behave in the face of these situations?

The best way I know of to get the real answers out of someone is something called Behavioral Interviewing. The idea is simple: instead of asking someone how they would act if faced with a certain situation, ask them to describe an example in their past when they’ve had to deal with that situation. Discuss it with them. How did their strategy work for them? What did they learn? What would they do differently?

Just this one shift from how would you deal with this situation” to how did you deal with this situation” will get you a much deeper look into how a candidate actually behaves, which allows you to decide if they’re a good fit for your team.

The Cultural Fit Interview

This goal of the cultural fit interview is to figure out if the candidate will like their new working environment and whether the team will be glad to have them. It’s enormously important and very difficult to access. One typical way to approach this type of interview is to ask the following kinds of questions, also in a Behavioral Interviewing style:

  • (You’re a startup) How do you like the idea of quick decisions, hard work on short deadlines, light process and tight purse strings?
  • (You’re an established company) How do you like the idea of getting buy-in with a set of stakeholders, making sure we don’t ship anything until it’s done, following an established process and sticking to a budget?
  • What’s more important: the customers or the business?
  • What kinds of activities are most important to you? Do you like to be focused on your set of tasks or do you like to do a lot of different things?
  • What makes you as productive as you can be?
  • Where do you see your career path taking you?
  • etc.

These questions are much more vague and really meant to start a conversation, but they’re also very hit-and-miss. If you happen to hit the right path, you can really crack a candidate open like a ripe nut.

Also, you want to be careful how you interpret the answers. If you don’t filter out people that aren’t a good fit for the culture of the company, they’ll be unhappy and you’ll be unhappy. On the other hand, if you filter too much, you’ll lose out on the benefits of diversity. It’s a hard line to walk.

Another way to approach a culture fit interview is to get creative. Maybe invite the person to a company event, perhaps a semi-public mixer or a Friday afternoon beer bash. Maybe sit down with the team over lunch and play a game together. Maybe sit in the café and grab lunch in a small group and see how the conversation goes.

I think the key to finding a good fit culturally is to spend time with the candidate that doesn’t center around the technology you’re using to build your products. For example, involving a candidate in something that the team does for fun can go a long way towards finding a great new member for your team.

Next Time

Tune in next time for when we wrap this series up and talk about how to make the hiring decision.

July 24, 2014 interview

Future Proof Your Technical Interviewing Process: The Technical Interview

Future Proof Your Technical Interviewing Process: The Technical Interview

It’s incredibly important to interview well as you’re building your technical team. Further, interviewing well is hard to do and, like anything, you only get out of it what you put into it. In part 1 of this series, we discussed the phone screen. In this part, we’ll discuss the technical interview.

The Technical Interview

The only way to really know if someone can deliver technically is to give them a problem to solve and watch them solve it. You can do this with simple data structure problems on the whiteboard, test questions on paper, algorithm problems in notepad, real-world problems with some pair programming or puzzle problems with them waving their hands wildly in the air. In a technical interview, you should encourage the candidate to think out loud, because you care more about how they go about solving the problem then actually getting to an answer. You will look for the following things:

  • Are they asking questions to solidify vague requirements?
  • Are they approaching the problem from a logical angle (even if it’s different from what you had in mind)? Does problem solving come naturally to them?
  • Are they making the right use of the features available in whatever sandbox you gave them in which to solve the problem, e.g. making good use of list comprehensions in Python?
  • Are they writing good code and pointing out the shortcuts they’re taking due to the medium they’re using, e.g. the whiteboard? Does the coding come naturally to them or are they struggling?
  • Do they come up with a reasonable answer? Are they on the right path even if they run out of time?
  • Do they understand the why” behind their answer as well as the how?”

This last one is the one I tend to focus on the most. Even more important than a candidate having knowledge of the technologies you’re going to ask them to use is their ability to understand new technologies over time.

My father always says that while teenage drivers hopped up on testosterone may get into the most accidents, they’re the ones that push the cars to see what they will do. You want to hire engineers that have pushed technologies past their limits for the pure joy of it. Those are going to be the ones that build the deep knowledge and can adapt in the future to whatever comes their way.

I filter for deep understanding by not just digging into not only the how” of whatever they claim to know best, but also the why.” They may know how to build a factory in Angular, but do they understand what a factory is and why Angular does it that way? They may know how to manage their resources in the face of the JVMs garbage collector, but do they know why we use garbage collection and what the downsides are? Do they understand what canvas is good for, what SVG is good for and when to choose which?

The key here is that past behavior indicates future behavior — if they’re developed deep understanding of the technologies they’ve learned before, chances are pretty good that they’re going to be able to do that for the new technologies your team adopts in the future. There is no better way to understand how well they’re going to do on future technical challenges than hearing how they’ve handled such challenges in the past and seeing how they do it right in front of you.

What’s Next in This Series

However, the technical fit is not the only thing you need to look for — you also want to make sure that they will fit in well on your team and the company culture overall. We’ll talk about these in the next piece in this series.


← Newer Entries Older Entries →