Monday, June 20, 2011

NDC 2011

{

It may be easy to miss amidst all the hoopla around Windows 8 but the Norwegian Developers Conference just released all their session vidoes on the site.

It’s been a while since I’ve gotten to go to a conference but the last few I have attended were put on by Microsoft. Although this has advantages in the sense that it coalesces the “experts” of specific Microsoft technologies, many of the presenters work at Microsoft and therefore don’t have a similar problem set that you or I might slogging our way through building products, often with older (read: more “boring”) software. There are also some talks on development techniques like BDD and DDD that are not product specific.

The good thing about NDC is that it seems a lot of the presenters come from an outside perspective so it’s a good balance for a lot of the MIX / PDC type stuff I’ve been watching of late. Without further ado:

Direct Download from NDC website: Day 1 | Day 2 | Day 3

Roy Osherove’s “unofficial” torrent

}

Wednesday, June 15, 2011

Search, Match, Replace, Generate

{

Many moons ago I got about 0.25 seconds of fame when nRegex, a tool I wrote for evaluating regular expressions of the .NET flavor,  got a bit of acclaim. It was one of the better days of my life, an encouragement that sometimes struggling alone in a South Dakota basement can lead to a little bit of notice.

One of the tricks that keeps me going back to nRegex is being able to generate code by using a regular expressions. Regular Expressions, though often reviled, turn out to be quite handy in a lot of situations.

Let’s say you have a table that looks like this:

	CREATE TABLE PackingList(
PackingListId INT IDENTITY PRIMARY KEY,
PackingItem VARCHAR(50),
Destination VARCHAR(50)
)
GO


 



Let’s say you have a list of values:



Shoes
Camera
Laptop
Wallet


The list is short for brevity but let's say you want to insert them all into your table for a destination called //Build/. You know the syntax for an INSERT but it's a bit of a nuisance to type over and over again. One thing you can do is to use a regular expression to match and then reference the results of your match in a replace. Over on nRegex, we'd paste in our list of items into the main text area and then use the regular expression (.+) to match each item, line by line. Because the items are matched into a group with your parenthesis, you can now write something like the following for your replace:



INSERT INTO PackingList VALUES('$1', '//Build/')


And voila! You now just have to copy the results:



INSERT INTO PackingList VALUES('Shoes', '//Build/')
INSERT INTO PackingList VALUES('Camera', '//Build/')
INSERT INTO PackingList VALUES('Laptop', '//Build/')
INSERT INTO PackingList VALUES('Wallet', '//Build/')



But that's just a tip of the iceberg. There's a lot more nifty regular expressions tricks for working with code. Here's another one I run into quite often. Let's say I have some code that looks like this:



  rs["foo"] = myFoo;
rs["bar"] = myBar;


I want to swap what's on either side of the equals sign to do the opposite type of assignment. Here's my regular expression:



(.+)\s=\s(.+);


And my replacement expression



$2 = $1;


Et voila aussi! You can now copy the swapped values to wherever they need to go.




One final thing: any place that offers you regular expressions you can use these techniques. There are some subtle differences but as long as you have a conceptual understanding of what your goal is it's quite easy to bend to the flavor of regular expressions presented. For example, if you are using Notepad++ and want to accomplish the same thing, you reference your groups with a leading backslash rather than the "$" character - in our first example you would use the following:



INSERT INTO PackingList VALUES('\1', '//Build/')


This is, of course, just scratching the surface. It’s not that hard though! Once you learn the meaning of things like ^ or $ then you can manipulate strings in all sorts of ways that may have once not seemed possible. The best way to learn regular expressions hasn’t changed for many years. The two canonical books I always refer to are Mastering Regular Expressions by Jeffrey Friedl and the Regular Expressions Cookbook by Goyvaerts and Levithan.











 



Although nRegex will allow you to hobble by I also recommend RegexBuddy. Rexv (which inspired nRegex) is a good tool though the Regular Expression engine is not .NET.



Last thing: do you have any nifty regex to code generation tricks you use on a regular basis? The audience of one you have in this space would love to learn them.



}

Tuesday, June 14, 2011

On Features

{

“More features isn’t [sic] better. More features is unfocused. More features means you’ll do them worse. More features means you probably don’t have any differentiation. If you’re doing a startup, you should have less [sic] features than your competitors. If you have more features, you’re probably doing it wrong.”

Nugget from Peter Van Dijck. So the question is: when do you add a new feature? Joel Spolsky (who has written about most interesting things already, way back in the day (although it would be interesting to hear if things are still done the same in the present day FogCreek) ) wrote about how they decided on new features by prioritizing and voting as a group.

As a developer of one I’m interested in techniques on deciding what to put on a roadmap and how to prioritize features. Any insight?

}

Monday, June 13, 2011

Closures, Anonymous: JavaScript influenced C#

{

I’ve taken knocks in the past because of my penchant for closures and lambdas. Syntactically they never looked that strange to me and most of the time when I used them it was because it made more sense to get a sense of the flow of how things were assigned. I thought: this feels so natural, what makes it so different from some of the people I’m around using C#? Here’s an example of how I’d approach something: in the constructor, assign a loading handler, in that handler, assign a click handler, and rather than putting it in some separate method where I’d have to scroll or look elsewhere, just place it here:

        public MainPage()
{
InitializeComponent();

this.Loaded += (o, e) =>
{
myButton.Click += (_, e2) =>
{
myText.Text = "Hello World";
};
};
}


But then the other day I was tinkering with KnockoutJS, writing some Javascript with jquery and it dawned on my why I approach things the way I do.



        $(document).ready(function () {
$('#myButton').click(function () {
$('#myLabel').text('Hello World');
});
});


It's always interesting to make that connection more formally than trying to explain why my approach would be “better.” The advantage of being able to use a closure with the above approach has always been the main rational I’ve given when forced to come up with an answer.



}

Friday, June 10, 2011

Getting Random Rows, Random Numbers with Sql Server

{

The 5 second version of this, should you arrive via search, is that to get random rows, simply use an TOP query with  ORDER BY NewId() expression. It’s really that simple! Take a look:

-- SAMPLE TABLE
CREATE TABLE Keywords(
KeywordId INT IDENTITY(1,1) PRIMARY KEY,
KeywordValue VARCHAR(50)
)
GO

-- SAMPLE DATA
DECLARE @N INT
SET @N = 1
WHILE @N < 101 BEGIN
INSERT INTO Keywords(KeywordValue)
VALUES('key word ' + CONVERT(VARCHAR(5), @N))
SET @N = @N + 1
END

-- A TOP QUERY WITH ORDER BY NEWID()
SELECT TOP 5 * FROM Keywords ORDER BY NEWID()


The longer version of this is that I recently was asked to generate random keywords for a website I was working on with a lookup table. Getting random numbers in TSQL is easy, the RAND() function does all the magic but getting rows is a lot more tricky, especially if you want to make sure you exclude anything you’ve previously retrieved. The above technique worked quite well and made it easy to allow for them to add and remove keywords on demand.



One interesting application of this is that you can combine it with RAND() to get random numbers via multiplier and random rows (RAND gets a random between 0 and 1 leaving you the responsibility to multiply it to control the range you want).



Here is where I thought this could be taken as a flexible way to get random numbers within a bounded range:



-- get a series of random numbers
SELECT TOP 5 Rand() * KeywordId FROM Keywords ORDER BY NEWID()


There’s a lot of flexibility but SQL Server makes it trivial. 



}

Wednesday, June 08, 2011

Silverlight Is Dead…

{

… a title which I hope brings massive attention to this blog and to this rant against those that are rabid in their attacks on Microsoft and the Silverlight platform.

First and foremost: Silverlight 5 has yet to be released. How can the platform be “dead” if we’re on the verge of a new version?

Secondly: Spend some time listening to MVPs and Microsoft people. Even though there is this awkward gag order until //Build/ it seems quite obvious that the platform will continue to be a viable option for developers.

Third: HTML5 is no panacea. Spend a few days looking into the different specifications and the varied support by browsers and platforms. It will become obvious that the W3C is being true to their word when they say it won’t be “finished” for a while.

Fourth: Grow Up. Yes you’ve made this enormous investment in Silverlight or WPF. I have too; the last 3 years of my life have been in the trenches and my employer took a calculated risk to do a significant amount of work in Silverlight. Does that mean that every rumor should shake you to the very foundation and cause emotional outbursts at being abandoned? Stay the course. When you have real information from Microsoft directly then you can have your break down if it’s not what you expected. I don’t consider my time wasted no matter what the case. I can take my knowledge of MVVM elsewhere. I know a lot more than I used to about asynchronous programming.

Fifth: Let’s just say it’s true. Does it still warrant all that drama? You’ll be fine. People are dying in wars, unrest, and natural disasters all over the place but guess what? If you’re a Silverlight Dev and They all of a sudden remove the Silverlight Project Template from your Visual Studio and run a secret binary on your local machine to destroy the plugin removing all evidence of its existence globally you’ll still be alive. You’ll still dust off your trousers and either port your work or begin new and fanciful things in a platform that you find available.

Sixth: Try to make a distinction between people who are vocal versus people who are actually building software. I’m aware of a project right now where I work that makes heavy use of COM. Yeah that “not dead but done” COM. People who build things usually have their heads down creating value. I know there are a lot of talking heads online, especially talkers unsympathetic to the “evil” b0rg in Redmond, but there’s a lot of noise for very little signal. It’s cool that people get passionate (I’m being passionate myself now too) but sometimes it’s a good thing to take a step back and survey the landscape of what is real and what is bluster.

I’ve already admitted I could be wrong. But as significant a decision Microsoft has potential to make, my approach is to take it in stride, try to learn as much as I can and be flexible since in the tech world, no matter who you are, change is inevitable. For some of us change, with all the concomitant turbulence, is fun.

}

Monday, March 14, 2011

Happy pi day!

{

class Program
{

static double PI(int i, int limit)
{
return (i > limit)? 1 : (1 + i / (2.0 * i + 1) * PI(i + 1, limit));
}

static void Main(string[] args)
{
double pi = 2 * PI(1, 2011);
Console.WriteLine(pi);
Console.WriteLine("Happy pi day!");
Console.ReadLine();
}
}


}

Saturday, January 29, 2011

Primes, Sums of Primes, 2011 in C#

{

I had no idea:

2011 = 157 + 163 + 167 + 173 + 179 + 181 + 191 + 193 + 197 + 199 + 211

After learning that not only was 2011 was prime, but that it was the sum of consecutive primes, I sought to write some C# code that would demonstrate this. I wrote it in a functional style, meaning at some point to port it to F# – you'll recognize my in a forthcoming post on computing primes with F# which is actually an implementation of the algorithm I first worked through in the below C#.

Func<long[], IEnumerable<KeyValuePair<long, string>>> GenerateConsecutivePrimeSums = (primes) =>
{
List<KeyValuePair<long, string>> primeSums = new List<KeyValuePair<long, string>>();
for (int i = 0; i < primes.Count(); i++)
{
List<string> operands = new List<string>();
long primeSum = primes[i];
operands.Add(primeSum.ToString());
for (int j = i + 1; j < primes.Count(); j++)
{
primeSum += primes[j];
operands.Add(primes[j].ToString());
if (!primeSums.Any(ps => ps.Key == primeSum) && primes.Contains(primeSum))
{
primeSums.Add(new KeyValuePair<long, string>(primeSum, String.Join(" + ", operands.ToArray())));
}
}
}

return primeSums;
};

Action primesAndSums = () => {
// generate primes up to 2020
var primes = GeneratePrimes(2020);
// generate arrays of consecutive primes that add up to prime
var primesSummed = GenerateConsecutivePrimeSums(primes.OrderBy(a => a).ToArray());
// go through the summed primes (dictionary of prime as key, added numbers as value)
// Console.WriteLine formatted results
primesSummed
.OrderBy(ps => ps.Key)
.ToList()
.ForEach(ps => Console.WriteLine(ps.Key + " = " + ps.Value));
};

primesAndSums();


 



The code actually calculates sums of the primes it generates, click here for all the other primes which are sums of consecutive primes up to 2020:



}

Monday, January 24, 2011

Interesting Data Points From How Facebook Ships Code

{

I ran across this blog entry which is an unofficial attempt by somoene to glean the internal workings of Facebook’s product and software development processes. There are some very interesting things to be noted, most of which I’ll just quote from the article directly:

“resourcing for projects is purely voluntary”

It’s interesting from this unofficial post that project dynamics are organic and based on what engineers want to work on. It begs the question of how the more difficult and less pleasing problems are solved but I would hedge that by having people who are talented and motivated, difficult and more grimy problems might be what attract people that are always seeking challenges. Indeed, from later in the article: “engineers generally want to work on infrastructure, scalability and “hard problems” — that’s where all the prestige is.”.

“Engineers handle entire feature themselves — front end javascript, backend database code, and everything in between.  If they want help from a Designer (there are a limited staff of dedicated designers available), they need to get a Designer interested enough in their project to take it on.  Same for Architect help.  But in general, expectation is that engineers will handle everything they need themselves.”

This is one of the more fascinating points because it reflects one side of an approach to programming that I’ve encountered: that delivering some functionality is a process of ownership where a person generalizes across disciplines and technologies. The opposing viewpoint sees programming more in terms of division of labor with staff assigned to “tiers” of the technological back end: database developers, “business layer” or component programmers, user interface and so on. I always think of sports with this dichotomy where the former thinks of software development like basketball – a game that involves some specialization but really rewards the generalist who can play any role on a team, and football – a game of specialists where it’s a liability to do too many things since even the physique is developed on a per position basis.

Many people acknowledge generalists for small organization but it appears that Facebook, a company as large as they come, prefers them.

“engineers responsible for testing, bug fixes, and post-launch maintenance of their own work.  there are some unit-testing and integration-testing frameworks available, but only sporadically used.”

There are a few edits and comments to this point but the reason I find it interesting is that they are a corollary to the views that Joel Spolsky expressed on the StackOverflow podcast. Many developers, myself included, berate ourselves on a lack of unit testing with the assumption that “everyone is doing it, why can’t I?” As time passes, however, I realize that TDD and Unit Testing are very important but not essential. It’s a very unpopular opinion and while I admit that I strive to make my code testable and, especially on personal projects where I have enough control, architect my software so that it’s testable from the get-go.

}

Saturday, January 22, 2011

Learning F# with FizzBuzz: Match

{

I had previously done a solution for FizzBuzz in F# (from a long time ago) but now that I’m more familiar with the idioms of F# I tend more towards pattern matching instead of if/else logic for quite a few scenarios. Here is an example of my rewriting what could otherwise been a conditional if/else checking for factors of 3 and 5, but using a pattern match instead.

#light 
let fizz num =
match (num % 3 = 0) with
| true -> "fizz"
| false -> ""

let buzz num =
match (num % 5 = 0) with
| true -> "buzz"
| false -> ""

let outform num fizCalc =
match fizCalc.ToString().Length = 0 with
| true -> num.ToString()
| false -> fizCalc

let rec printer nums =
match nums with
| [] -> printfn "-"
| h::t ->
printfn "%s" (outform h ((fizz h) + (buzz h)))
printer t

let numbers = [1..100]
printer numbers




Although I read claims that if/else conditional operations are more readable, I think the pattern match used consistently across scenarios above makes for something I find quite readable.



}

Thursday, January 20, 2011

On Leadership

{

“If you want to build a ship, don’t drum up people to gather wood, divide the work, and give them orders. Instead, teach them to yearn for the vast and endless sea”

- Antoine De Saint-Exupery, author of "The Little Prince"

Originally posted on Chris Sells’s blog but worth some thought.

}

Wednesday, January 19, 2011

Download .NET Source Code

{

I’ve been having a problem that warrants looking at the source which can be downloaded right here.

}

Learning F# with FizzBuzz

{

Eons ago I'd posted on how I’d rewritten how I would solve FizzBuzz to have a more functional style (here is an imperative version), inspired by Tomas Petricek and John Skeet’s Functional Programming for the Real World. Shortly thereafter I had written a version in F#, I’m not sure what prevented me from posting it but here it is:

let numbers = [1..100]
let fizz num =
let res = if (num % 3 = 0) then "fizz" else ""
res

let buzz num =
let res = if (num % 5 = 0) then "buzz" else ""
res

let outform num fizCalc =
let res = if(fizCalc.ToString().Length > 0) then fizCalc.ToString() else num.ToString()
res

let rec printer nums =
match nums with
| [] -> printfn "-"
| h::t ->
printfn "%s" (outform h ((fizz h) + (buzz h)))
printer t

printer numbers


I can already see now areas that are still influenced by the C# - most notably the use of if rather than using match for everything. I will clean it up, hopefully demonstrating an increased facility with F#. If you are looking at the above and know F#, what are some idioms or language constructs that I am neglecting in the above code? Type annotations for one... what else?



}

Sunday, January 02, 2011

Information Diet Planning – Newsletters

{

Given the amount of information that is out there it’s difficult to throttle back and actually digest it. A quick look at any web page will set that context; hit StackOverflow and you’ve got several dozens of links to follow, each a rabbit hole on its own. The same can be said for Hacker News, Channel 9, and just about every other popular developer site that is out there.

What tools exist to process this more efficiently? Perhaps, I hope, one of the oldest tools out there: email.

I came across this solution reading the Washington Post’s email newsletter I subscribe to one morning. I realized I’d get more out of the news by scheduling a more deliberate reading of the newsletter than by going to the site and being bombarded by stories and links that, while no doubt interesting, would result in an overflow of words that would invariably lose their depth.

I decided for the next week not to visit any news site directly but rather to subscribe to several newsletters and schedule the reading from directly from my email inbox. I also turned off the radio so that rather than hearing multiple versions of syndicated stories from the Associated Press, I would be able to dive more deeply and think more at length about what I read. The goal was to buck the trends of the modern day information seeker:

“characterised as being 'horizontal, bouncing, checking and viewing in nature. Users are promiscuous, diverse and volatile.' 'Horizontal' information-seeking means 'a form of skimming activity, where people view just one or two pages from an academic site then "bounce" out, perhaps never to return.' The average times users spend on e-book and e-journal sites are very short: typically four and eight minutes respectively.”

I wanted to get more vertical with my reading rather than surfing through multiple versions of the same piece of news.

I was so pleased with the results that I decided to use the same strategy with technical news and articles. I have long been a member of The Code Project and of the software development newsletters I receive (surprisingly few) theirs is probably the best. Each day, and then in a weekly digest, there is an email in my inbox with a decent roundup of technical articles. Although not all of them pertain to my skills set or interests, there are usually one or two good links to follow up with; in this newsletter received on the last day of the year I could easily spend an hour on The Best Technology Writing of 2010 or catch up with Rob Connery giving his sentiments on BizSpark.

The experiment will continue and although I do admit to “skimming” from time to time, even the tepid commitment that I’ve made seems to make my time online much more efficient. The next steps regarding newsletters is to find some more development related ones that come in a digest form, preferably weekly so that I can spend a full week on the contents.

}

Thursday, December 23, 2010

Information Diet Planning - Part 1

{

Goal Setting

I’ve let it slip that one personal goal for 2011 is a more regimented information diet. I’m becoming increasingly convinced that the concepts we apply to diets on the body can be applied with some parallel applications in the world of information.

Calorie Counting

The first thing that applies to physical diets is the concept of tracking intake. Our bodies can utilize up to a certain amount of food after which, no matter how good it is, the food is going to be stored up as fat. Is tracking intake something that can be applied to information? The number of sites visited in a day, the number of browser tabs open, the amount of time getting pumped with information via some form of media: podcast, radio, screencast, television or otherwise? Is there a point where that additional reading does no good and takes away from what might have been retained?

Exercise

The second basic thing in the world of physical diets is some concomitant form of exercise. Some of this might be for burning away calories (cardio) but sometimes it’s about gaining mass or turning “fat” into “muscle.” I wonder what exercise looks like in the world of information. Steve Yegge had an old article about practice for programmers and I suspect that exercise involves designating time specifically for the mental effort related to processing information efficiently.

“The great engineers I know are as good as they are because they practice all the time. People in great physical shape only get that way by working out regularly, and they need to keep it up, or they get out of shape. The same goes for programming and engineering.”

Media and Delivery

There are different “food groups” associated with a healthy diet. Some types of food, like “fatty carbs” are very difficult to incorporate into any meaningful diet but others, like fruit, are a staple of most sensible dieting efforts drawn up for a healthier lifestyle. I wrote down my main sources of intake and looking at the list I would consider some blog entries analogous to fatty carbs or sugar whereas other forms of intake such as technical books to be a more substantive form of media for input and processing.

Confession: I’m an architecture geek1. It started in earnest when I moved to South Dakota – it was the first time I’d lived in a rural area. I missed the built environment I was used to in cities. Along the way I’ve managed to have 14 different architecture blogs in my RSS Reader. Especially since I’m not an architect, this is excessive. I usually enjoy a story here and there but I leave a lot unread. This is a case where it’s not my curiosity that needs to go away, it’s the delivery format. I’d be better served rereading Steen Eiler Rasmussen’s Experiencing Architecture or Bjarke Ingalls’s Yes Is More than getting distracted by blog entries from the web.

Processing

I’m not sure there is any equivalent in the world of dieting but the last thing I’ve been thinking about related to my information diet is designating time for processing. Earlier this year I finally made some headway in understanding Getting Things Done and though I can’t say I’ve implemented everything David Allen recommends two things have stuck: his recommendation of using a calendar and the idea that you process information rather than letting it idle in an indeterminate state.

It’s occurred to me that in recent years information access for personal and professional development is trivial. Wikipedia is a great resource for documenting general knowledge. For professional work there are websites, link aggregators, and vendors eagerly providing a glut of information to learn from.

In this environment, what does it mean to “process” an information resource? For example, at work this week we watched Bart De Smet give a talk on a language feature of C# called LINQ. I’ve used LINQ quite a bit but his talk covered some direction in the technology that is new (Rx). In a more general sense, he referenced the Wikipedia entry on Monads – another resource which I would like to process.

I’m not sure what processing should look like but it seems like what it means to process an information resource is less of an issue than the discipline it takes to designate time for it. Perhaps that ties this notion back to exercise.

Conclusion

I’ll be using the next couple of weeks to think more about what an Information Diet should look like and a practical structure to use. I’m posting in part because I would love any input on tactics and also because committing this to the permanence of my blog means the commitment is formalized. Four areas of focus will be:

  • Calorie Counting – tracking input
  • Exercise – deliberate practice
  • Media and Delivery – determining which formats and timing work best for information
  • Processing – what steps are involved in making meaning out of information

}

1A running joke with my wife is that I will quit my job, enroll in an architecture program just so I can be a critic. She takes great joy in laughing about this.

Monday, December 20, 2010

Language, Programming, Quirks, Conviction; Derek Sivers at RailsConf

{

Imagine that you are standing on a street, and you are in America, and a Japanese guy comes up to you and says “Excuse me… what is the name of this block?”

And you say “well, I don’t understand… there’s Oak street and there’s Elm street, this is 27th street and that’s 26th…”

And he says: “Yes but what is the name of this block?”

You say: “I don’t understand what you mean; blocks don’t have names, streets have names. Blocks are just the unnamed spaces in between the streets.”

He looks a little disappointed and leaves.

So now imagine that you are standing in Tokyo one day and you’re a little lost and you turn to somebody next to you and you say “Excuse me, what is the name of this street?”

And they say, “That is block 17 and that is block 16.”

And you say “Yeah, but what is the name of this street?”

And they say, “Streets don’t have names; that’s just the space between blocks 16 and 17.”

A great talk from Derek Sivers given at RailsConf earlier this year available on IT Conversations.

}

Sunday, December 19, 2010

The Future Is Balkanized

{

“I like HTML5, but I think you're duct taping a horn on a horse and hoping it will become a unicorn.”

Shawn Wildermuth hit the nail on the head with a recent analysis entitled “The Next Application Platform? All of them... ” It would be interesting to see how many more hits the article would have gotten with a title like “XYZ is dead” or “The Death of XYZ,” perhaps something along the lines of “The Death of the One Stop platform.”

A basic summary is that he points to a future in which developers tangle themselves with the following development targets:

  • An HTML5 solution for the web
  • Plugins to extend HTML5 as necessary
  • Desktop/Browser apps for in house/well known customers
  • Apps for mobile/tablets in Objective-C, Java, and Silverlight

The sentiments are corroborated by my own experience, most recently even with a potential customer who wanted to have an iPad friendly application (native) but also wanted to support web based users who had no such device. If I could translate the request, it could simply be that they want things in the best possible experience for each of the disparate platforms for which they had users. Of course the smart phone was no exception.

In a world like this, what could the future portend but that we will have multiple platforms, no singular delivery, and a constantly increasing need to build things quickly, portably?

I’ve cited the article quite a bit but over the years I’ve always gone back to Jonathan Edwards article on Beautiful Code:

“I wish someone had instead warned me that programming is a desperate losing battle against the unconquerable complexity of code, and the treachery of requirements.”

Although Edwards was talking more specifically about code, all of my experience points towards this truth in the realms of the disparate platforms, specifically that getting something to work in a “real world” where people use different operating systems, browsers, displays, and connectivity paradigms. Over the years there have been different tactics in trying to solve the problem: web standards, ActiveX controls, Java, plugins, and of course the latest new craze, HTML5. It’s not that these tactics (and the technologies related to them) are bad: I still advocate web standards to a point, I still have my day job programming Silverlight. It’s just that the pragmatist in me thinks this is the Arab-Israeli conflict in software: no perfect solution no matter how badly its desired by those in each of the platform camps.

The big insight for me as a developer is this line:

This means as a developer you'll need to expand what you know and learn more platforms. Is that bad or good?  Both. It means more work for all of us, but it does mean you'll need to less focus on silo's of platforms and use your knowledge across these platforms.

}

Monday, December 13, 2010

Advent Calendars for Developers

{

Since my days trying to hack up some Perl1 I was charmed by the idea of a developer’s advent calendar: a day by day lead up to Christmas with articles pertaining to a specific topic. I’m otherwise a scrooge during the holiday time; not given to commercialism, Christmas music, and other seasonal rituals.

But I am up for the both the Perl Advent Calendar and the RJBS (Perl) Advent Calendar. On a similar vein, Sys Advent, a sys admin advent calendar should be interesting tracking too.

Others have riffed on the idea, most notably web developers. 24ways is a seasonal advent project that I’ve tuned into each year – I usually have at least one or two of the posts stick.

Finally, there is an entrepreneurial advent calendar, 24waystostart. A lot of good things in there, I feel the onset of holiday good cheer.

I’m disappointed not to find a .NET Advent calendar (or even a Python one!). If you know of a good advent calendar, developer or otherwise, feel free to share. A few good articles can make the season pleasurable, even for a grinch like me.

}

1Could it have been that long ago? Funny to see those old posts, but that's part of why I blog

Thursday, December 02, 2010

Serialization’s “Pit of Success” with C# and JSON

{

Although it’s been mentioned before here, it bears repeating that before you find yourself making a reference to the DataContractJsonSerializer, you ought to consider and indeed are more likely better off with the NewtonSoft library Json.NET. Whereas the DataContractJsonSerializer relies on giving you the flexibility of creating types and using the DataContract and DataMember attributes on them for a lot of granular control, this is burdensome with types that should naturally find themselves serializable and JSON friendly. For example, let’s say I have a Dictionary<int, string>; the intent of the user shouldn’t be too complicated in the serialization process. Or, if I have a class Foo with a couple of properties, and I want to serialize an IEnumerable of said class, again, the intent doesn’t require the extra use of attributes and a complexity overhead.

This is not to say that the DataContractJsonSerializer does not have its place; if you are leveraging WCF and choosing JSON as your serialization format, it is probably the best route to go. That said, however, I have fallen more than once into a “pit of success” with Json.NET after getting burdened with trying to use the DataContractJsonSerializer.

Json.NET is still quite active, the last release during the latter half of this year. Check it out.

}

Friday, August 27, 2010

Design Related: Branding with Debbie Millman

{

I always struggled with a singular identity. Maybe that had something to do with going back and forth from East Africa and the United States, maybe it is because my father had a lot of books and it gave me a curious nature. Whatever it is, I am the kind of person who, when I find myself in a bookstore, picks up a magazine on a topic I know nothing about and enjoys trying to discover the nuances of a not yet explored world of information. I’ve done it with things like pens, model trains, and antiques.

When it comes to design, as much as it may seem by some to be orthogonal to software development, I’ve had the growing understanding that the two go hand in hand. Design, to me, is not picking nice colors for gradients or making icons. Design is planning, it’s understanding a problem and solving it. Although as a software developer my visual design has often been an afterthought (something I’ve fought with increasing intensity over time) and yet when I write a piece of software, put together a user interface, or model data structures, I am planning and problem solving. I am designing, even if I’m making a poor effort of things.

The more aware I’ve become of this, the more I’ve sought to have a baseline understanding of design which is why I found myself at the South Dakota AIGA hearing Debbie Millman give a talk on the history of branding, which was originally prompted by her thinking about the phenomenon of MySpace. I’d long been aware of Debbie; I listened to her Design Matters show when it originally became available online and look forward to a new podcast via Design Observer.

In speeding us to the present, the question of why there may be 300 national brands of cereal or 100 different types of bottled water in a store, Millman began 50,000 years ago with the “big brain bang” where scientists believe we developed our Triune brain. The 3 parts of the brain Millman talked about, Reptilllian, Limbic, and Neocortex are a basis for how she believes that branding works today – if I could shortcut to the conclusion, the reason why we put ourselves in groups and find affiliation important is because this need is hardwired. In one humorous aside, Millman said of the part of the brain that fears the unknown:

“You can’t meditate it away. It’s just there.”

The talk bolstered this point along many fronts, some anthropology, some historical/statistics and other scientific studies and anecdotes. She then divided the history of branding, starting from the US Trademark Registration (landmark legislation that is the legal foundation for branding) in 1876, into 5 different “waves:”

Wave 1: 1875 – 1920

Brands as a guarantor of consistency (Think Campbells soup, Quaker Oats).

Wave 2: 1920 – 1965

Brands as a guarantor of quality. (Think Mortin’s Salt, Pepsi).

Wave 3: 1965 – 1985

Brands as self expressive statements, telegraphing what others should think of us. (Think Nike, Levis, Volskwagen).

Wave 4: 1985 – 2000

Brands as an experience. (Think Starbucks.)

Wave 5: 2000 – present

Limbic brands. (Think Social Networking). In reference to the earlier portion of the talk on brain development, this is the part of our brains which serves us emotion and sense of group. In our present, fractured world, where traditional models of group like family are being uprooted by modernity, we turn to brands to fill that portion of our lives, which is hardwired.

I found the talk riveting, in large part because it aimed at a higher level thinking of how branding works. Afterward I had a chance to talk to Debbie and it sounds like there are new Design Matters shows in the making. I’ll look forward to hearing them and learning more.

}