Marquee de Sells: Chris's insight outlet for category 'spout' via ATOM 1.0 csells on twitter

You've reached the internet home of Chris Sells, who has a long history as a contributing member of the Windows developer community. He enjoys long walks on the beach and various computer technologies.




Creating a Lazy Sequence of Directory Descendants in C#

My dear friend Craig Andera posted an implementation of a function that descends into a directory in a "lazy" manner, i.e. you get the first descendant back right away and not after all descendants have been calculated. His implementation was in Clojure, a Lisp variant that runs on the Java VM:

(import [java.io File])

(defn dir-descendants [dir]
  (let [children (.listFiles (File. dir))]
    (lazy-cat
     (map (memfn getPath) (filter (memfn isFile) children))
     (mapcat dir-descendants
      (map (memfn getPath) (filter (memfn isDirectory) children))))))

Craig was happy with this function because, even though it was a "mind-bender to write," it's easy to read and because C# "would almost certainly be at least somewhat more verbose."

Taking this as a challenge, I rewrote this program in C#, maintaining the laziness:

using System.IO;
using System.Collections.Generic;

namespace ConsoleApplication1 {
    class Program {
        static IEnumerable<string> GetDirectoryDecendants(string path) {
            foreach (var file in Directory.GetFiles(path)) { yield return file; }
            foreach (var directory in Directory.GetDirectories(path)) {
                foreach (var file in GetDirectoryDecendants(directory)) { yield return file; }
            }
        }
    }
}

The key hit here is the use of "yield return" which lets me return elements of an IEnumerable as I calculate them. This took me 5 minutes to write, my mind is straight and I find it fairly easy to read. I'll let you decide on the relative verbosity of each implementation.

0 comments




The incomplete list of impolite WP7 user feature requests

When I first moved from the combination of a dumb phone and a separate music player, I had modest requirements: phone calls, MP3 playback, calendar notifications, contact management, email, camera and solitaire. Even asking for only these seven things, my first smart phone was as life changing as my first laptop. I could do a great deal of my work while out and about, allowing me to have a much more productive work/personal life balance.

 

When I was first married, the word “love” didn’t seem big enough for what I felt for my bride. These days, the word “phone” doesn’t seem nearly big enough for the pocket-sized mobile device that I’m never without, like my wallet and my keys. Further, I expect my phone to replace my wallet and keys any day now, along with the Walkman, DVD player, TV, radio, book shelf, notepads, calculator, compass, alarm clock, wall calendar, newspaper, encyclopedia, dictionary, GameBoy, carpenter’s level, laptop, navigation device and landline it’s already replaced.

 

Now that I’ve been through several smart phones, including my favorites, the T-Mobile Dash and the iPhone 3G, I have a much longer, incomplete list of what I want from my Windows Phone 7 Series (and I know it’s incomplete because after I post this list, someone is going to remind me what vital things I missed : ).

 

·        A calculator. It’s surprising how useful this is, including the scientific features.

·        A battery that lasts at least 24 hours while I’m using Bluetooth, 3G, Wi-Fi, GPS, music and my apps. Oh, and please let me charge the thing with a standard connector (USB!) and let me use my phone while it’s recharging.

·        An easy, high-quality way to run the music through my car stereo. The Sells Brothers and I like to jam!

·        An easy way to switch back and forth to airplane mode. Or even better, can you make it so the device isn’t an FAA threat during takeoff and landing so I can stop reading the stupid magazine in the seat pocket in front of me for 5 minutes at the beginning and ending of my flights?

·        Great auto-correct on my hard or soft keyboard entry. This is really the only way that allows my big fingers and the lack of tactile feedback to even work with a phone keyboard.

·        Copy-paste: I can’t live w/o it anymore. Also, please include pasting into my phone during calls so I can stop memorizing 9-digit conference call IDs.

·        I’d really love intelligent integration of music, i.e. keep it playing when I switch apps and not just the built-in Zune player, but 3rd party music apps, too (aka Pandora). Also, let me pause, next, previous while my phone is locked or I’m in another app. Finally, make sure to stop music when I get a call and start it back up again when my call is over. I love that.

·        Full (!) calendar support:

o   Sync’ing with Exchange and not Exchange.

o   Recognition of phone numbers and addresses in my calendar appointments with links to dial/get directions.

o   Reply All to an appointment so that I can let folks know I’m running late.

o   Snooze on my meeting reminders (I can’t tell you how many times I’ve forgotten my meeting after the one and only 15 minute reminder).

o   Show my appointments on my home page instead of making me dig into some app.

·        Please provide a responsive UI, even if I haven’t rebooted in a week. Ideally I’d never have to reboot at all.

·        Wireless sync’ing to my PC. My house is bathed in Wi-Fi; why make me connect a wire?

·        Tethering so I can use my phone as a network connection for my PC. I’m paying for unlimited data – let me use it! And ideally make that wireless, too.

·        Turn-by-turn directions! This won’t be ready until I go off course and I hear “recalculating” from my phone piped through my car stereo with Pandora playing in the background.

·        There definitely needs to be an "app store" for phone apps, but also there needs to be a way to install apps from other sources without hacking my phone. Also, please let me install them on my SD card so I can take advantage of the extra memory.

·        Let me install extra memory!

·        Let me replace the battery! Batteries go bad over time and they need to be replaced on the go.

·        I need a great audio book listening experience (bookmarks!) and a great ebook reading experience (formats!).

·        I’d like some phone-wide search, including the ability to see where the result came from. I never want the email-only Contact from the list of everyone that I’ve ever received an email from – I want the real contact info that I’ve got cached on my phone.

·        Full contact lookup, both personal and corporate (Exchange).

·        Good camera (and flash): the one on my phone is the only one I ever use, as it’s the one I always have with me.

·        Bluetooth and voice dialing for hands free operation (required by state law in both Washington and Oregon, where I spend most of my time). Also, I’d love the same integration with my Jawbone that I have with my iPhone, i.e. volume control and battery indicator.

·        Apps I can’t live without:

o   Evernote: I’m willing to move my data into OneNote so long as I can sync between the web, my phone and my PC.

o   Social networking clients: IM, Twitter, an RSS/ATOM Feed Reader, YouTube and Facebook.

o   Converter for currency, distance, volume, etc.

o   A Compass.

o   A Flashlight. I have used the ambient life from my phone to get myself out of the forest in pitch blackness. Without it, I’m sure I would’ve been hacked to pieces by Jason or Michael Meyers.

o   TripIt, Movies, OpenTable, UrbanSpoon, Mint: I use these all the time.

o   Shazam: Before this app, I used to record snippets of songs and email them to my son would be charge me $.50/ea. to find the title and artist so I could grab them for my phone. Shazam has cut out the middle man and represents ~100% of the music I purchase these days.

o   Skype or some other good way to use my phone to do IP Telephony (or even IP Video Conferencing)

o   Tetris! I guess there are other casual games in the world, but that’s mine.

 

Because the WP7 hasn’t shipped yet, I can pile all of my hopes and dreams on it and, like everyone else not on the WP7 team, I have very little idea of whether my hopes will be fulfilled, but that doesn’t stop me from dreaming. So now it’s your turn – what did I miss? : )

 

P.S. I know that lots of phones have a subset of these features and I’m sure someone will tell me that, with the correct config, I can make their favorite phone do all these things. I know that’s going to happen because whenever I complain about a missing feature in the Visual Studio editor, some emacs guy says, “Oh, you can do that with Alt+Shift+Left Elbow in my editor!” I don’t care about what your phone can do. No phone’s UI has stirred me like the WP7’s UI. That’s the one I want to use, so that’s the phone I’m going to bang on ‘til my incomplete list is complete.

0 comments




Please don't run apps in the background on my WP7 phone!

When I was but a wee lad, I learned that when it came to my computer, I was often going to be waiting on something, whether it was the CPU, the IO or the memory. Now that I'm all grown up and spending a great deal of time on handheld mobile devices, I've discovered a whole new thing I'm waiting on: charging the battery.

In the bad old days of DOS, I spent a disturbing amount of time working on my autoexec.bat and config.sys files to optimize the loading of drivers and TSRs (DOS programs that run in the background for you whippersnappers). Now, instead of optimizing for memory usage on my PC,  I spend my time optimizing for power consumption on my phone, e.g. turning off 3G and Bluetooth when I don't need them, turning down the polling frequency on my SMTP mail accounts and spreading power adapters everywhere in my world where I sit for more than 5 minutes. The single most important feature on my phone is that's it's on and the way power is managed on my iPhone means that this is often not the case. Sometimes I pine for my Windows Mobile Dash for just that reason; it ran for days instead of hours.

And as bad as this power situation is, it would be even worse if my phone ran more than one app at a time. I don't worry about random apps from the AppStore using too much memory or crashing; I worry about them eating my battery and killing my iPhone in the middle of a route to somewhere I've never been. By not allowing background apps to run, Apple is trying to do the right thing but (although my battery life still sucks). I don’t have personal experience with Google phones, but since they do allow background apps to run, I have to imagine battery life is an even bigger problem.

So, when I see people lobbying for background apps on the new Windows Phone 7 Series, all I can say is, you don't want it. What you want is for work to go on in the background for you without the cost in power.

Oh, I want to listen to my MP3s or Pandora while I answer my email like everyone else, but I don't want every financial/IM/email/social/sports app I download sucking down my battery life because it feels itself to be more important than everything else on my phone. I want those apps to notify me when something I care about happens but I don't want the processing to discover such events to happen on my phone - I want the processing to happen in the cloud.

You may recall my piece about how important storage in the cloud is for moble devices. Let's let somebody else scale and manage the storage so we can leverage it. In the same way, we want to leverage CPU and power in the cloud, saving local resources for cool graphics, twitch games and streaming my "Pink" channel.

Of course, if we're going to push the processing to the cloud, I'm going to need an efficient and easy way to write my WP7 apps to be notified so I can do the actual processing that needs to happen on the phone. And that all needs to happen while I'm navigating and playing my bad girls party mix.

I'm saving my WP7 phone battery for important things after all.

0 comments




We need cloud apps to use cloud drives

Reading about Windows Azure Drive reminded me of a conversation I had when I was hanging out with my Microsoft brethren last week. We started by talking about how apps target a particular OS and how Microsoft's bread-and-butter is making sure that apps continue to work forever on Windows so that our customers can upgrade their OS and still get their work done.

We then moved on to wondering whether Apple was gonna do the same thing when it came to letting iPhone/iPod Touch apps run on the new iPad. As it turns out, we heard from the iPad announcement that Apple is doing just that (although in a particularly strange single-tasking way).

From there we moved on to how it's really not a big deal whether you ditch your current smart phone, e.g. Dash, iPhone, BlackBerry, Droid, etc., for another one because nobody really keeps data on their phones anymore anyway. It's either synch'd to their PC, e.g. photos, music, etc., or it's kept in the cloud. In fact, without realizing it, I already have a great deal of info in the cloud:

Further, I could keep my pictures in Flickr, my documents on Live and I'm sure there are many, many more. This is fabulous, because I can move from platform to platform on my phone and it's in a vendor's interest to make sure that each major platform has their app on it and because it's a smaller, more focused platform, it's easier for them to do.

The problem here, of course, is that we've moved from mobile vendor lock-in to cloud data storage lock-in. What happens when Amazon decides to repossess another book or Mint decides to start charging or Flickr goes out of business? Unlike the physical storage business (you know, little garages where people keep stuff when their relatives die or they're going through a divorce), the logical storage business doesn't have any legal responsibility to keep the doors open for 30 days when they go out of business to let me move my stuff somewhere else.

And this has already happened. When GeoCities went out of business, all of those people's web sites were gone. When live.com decided to clean out my set of RSS feeds, there wasn't any notification or recourse. I'm sure there are more similar stories and there will be lots more in the future.

And because I know there will be more, I'm worried.

Right now, as we move our apps and storage in the cloud, we have a very different dynamic then apps and storage on the desktop. Because apps on the desktop use storage I own, I can back up that data, import it into other programs and, if I feel like it, write programs against it. It's my data. The vendor doesn't ever even see it, let alone gate my access to it.

On the other hand, cloud app vendors ARE gating access to my data; I have to use their apps to get to it. Unless there's some pressure, you can be damned sure the Flickrs and Mints and Amazons aren't going to be giving up the data they've got a wall around now so that I can take it to a competitor.

Which is why we need control over the storage for cloud apps just as much as we do for desktop apps. I want to go to a vendor I trust, e.g. Amazon, Microsoft, GE, i.e. someone big, someone you know is gonna be around for a while, and purchase cloud storage from them. I want to be able to use it as a HD for my desktop data (like Azure Drive and other products before it), including general-purpose backup, but I also want my cloud apps to store their data there, too. That way, if they start charging or they go out of business or I want to go somewhere else with my data, I can do so.

I expect to pay for this service, of course. That way, the cloud storage folks make money, the cloud apps folks make money for using my cloud storage and I get peace of mind knowing that I'll always have access to my data, no matter what happens to the cloud app or the cloud app vendor, just like today.

We need cloud apps to use cloud drives. Call your congressman!

0 comments




Stead Defines 'Customer'

And here's one more from the paper file I'm putting into electronic format to reduce the pile of papers in my life:

During the all-associate broadcast, Jerre Stead shared with the team a memo another associate had sent about defining a customer. Here are the highlights:

Customer "Must Not's"

Customer "Can's"

0 comments




How To Handle Angry Callers in 7 Not-So-Easy Steps

When I was first in technical phone support for the software I was building, I found out that I wasn't exactly a... um... "natural" at putting customers at ease. I used the following information from an AT&T magazine (I was working for a AT&T VAR at the time) in the fall of 1992 to start my education:

  1. Don't react. Stay calm. When confronted with an irate caller, everyone has the urge to return fire. But don't fight back. And don't take it personally, or you'll become an emotional basket case. Keep relaxed by breathing deeply. And remind yourself that this discussion will not change the destiny of mankind.
  2. Let them vent. Remember, you simply cannot get customers to deal with the logic of a situation until you've dealt with their emotions. Trying to attack the problem before people have fully vented their anger or disappointment just won't work.
  3. Defusing the anger. When a tirade is winding down, try asking - sincerely - "Is there anything else?" By this point, they're usually exhausted and willing to talk. If you hear profanity, try saying: "I know the words you're using right now aren't directed at me personally." If the caller replies, "Oh yes they are!" you're no worse off than you were. But generally they'll apologize, realizing it's not your fault. At which point, a real dialogue can begin.
  4. What do they want? Once they've calmed down, that's the time to find out what they want: Money back? A defective part replaced? Find out quickly to determine whether you can solve the problem on the spot.
  5. What can they have. Once you've figured out what they want, what can you do? This will be set by bounds of your company's policies - such as warranties or guarantees - as well as any flexibility that management may give you (which should be clearly spelled out).
  6. Customer solutions. Sometimes, the best solution you can deliver is one the customer suggests. And, surprisingly, it can end up being less than what you yourself were willing to offer. Recently, at a major department store, a customer wanted a discounting an imperfect blouse. The cashier was willing to take 35% off the marked price, but first asked the woman what discount she wanted. The answer: 20% off. Of course, some customers will make outrageous demands. In that case, ask them what they'd consider to be a "fair solution." Instead of confronting the customer, this reply opens up the discussion to a more equitable resolution.
  7. Follow up. Don't make an angry customer even angrier by not doing what you said you'd do. When a promise is made, keep following up internally to be certain that what was promised has been implemented. Even if that means making a minor pest of yourself!

Fred Gleek

0 comments




Do you know someone that needs dinner this Thanksgiving?

The boys and I were driving past a church with a holiday bizarre, so we stopped by. It was a mix of silent auction, bake sale and a $1 raffle for a turkey dinner with all the fixings. I made several comments about how they could skip the formality of the drawing and to make sure they could read my phone number on the back of my raffle ticket, because I was obviously going to win. They laughed.

When they called this morning to let me know that I had won, they told me that they remembered me and I laughed.

Anyway, the Sells Brothers and I have already picked up all we need for our Thanksgiving dinner, so if you know of a family in the Portland metro area without the means for a traditional dinner this holiday season, please let me know. I doubt it'll be so big that I'll need a sled to cart it through the streets, but I'm happy to deliver it when it needs to go. You can leave a comment on this post or drop me a line.

Happy holidays, everyone.

0 comments




The New Microsoft Store Looks Cool

And the folks in Scottsdale, AZ lined up overnight to be there when it opened and get their copies of Windows 7 (which goes on sale today and, if I may say so, rocks).

0 comments




The Downside of Transparency

Ever since Chris Anderson built his blogging software and shared it with his colleagues, more and more Microsoft employees has been pushing hard on being as transparent to our customers as we can be. This has been a very much grass roots effort. I remember coming into Microsoft six years ago just when legal was busy giving everyone disclaimers to put on their personal blogs and telling us what we could and could not say. It was always a worry whether the next blog post would get you fired. I got in trouble personally several times, but the brave pioneers before me laid the groundwork for people like me to comment on the internals of Microsoft culture, for Robert Scoble to call Steve Balmer out onto the carpet several times and for Rory Blyth to talk about penises, all on the Microsoft dime. Now blogging is just an accepted way to do things. It's not even questioned anymore; it's expected.

And by and large, this transparency is good for reasons that are obvious these days -- when our customers see how the sausage is made and have a say in the ingredients, they're happier eating it with their breakfasts.

As with all good things, however, these is a downside. For example, the product I've been working on for 4.5 years has gone through many transformations. This has to do with how new software is designed at Microsoft.

The tag line when we're hiring folks is always, "Don't you want to change the world?!" Of course, everyone does and that's good, because people coming in the door want to take big risks and do big things. If you're trying for the next Office or Windows, that's the kind of thinking you need. However, what that means is that we have a lot of folks building 1.0 software. We do this in my division with an organizational structure called an "incubation."

My product was in incubation mode for years and we started with zero assumptions. My first day on the job, I was asked to "think about synchronization." What did that mean? What problem was I trying to solve? Does replication count as synchronization? Does data import? I struggled with this for months before I got my head around the process of noodling with a technology enough to understand what problems there were in the space and how that fit with our general idea of what we might want to build into a product.

We tried a huge amount of stuff, often rebuilding shipping technologies to which we had ready source code access just so we could get a feel for how it worked (I personally built multiple data synchronization engines, a WPF-compatible XAML parser, a data binding engine and a set of universal data viewers during that period, all of which were thrown away, as expected).

As we got further along, we started producing things that needed to be published, even if they weren't a core part of our product anymore (like MEF and some new features in XAML 4.0). Once this started happening, we started to feel like we had a handle on what we were doing to move into "startup" mode, where we formed a team to make productization plans. At this point, we started telling folks what we thought we had, including analysts and "insider" customers, getting their feedback. Based on this feedback, we re-jiggered the product and the story and did it again. And again.

Eventually, we move out of startup mode to become a real product team with dev, test, PM and UA splits (up 'til then everyone does everything or, as we liked to say, "everyone shovels"). Eventually in this mode, you publish some set of bits that are your best guess at the time of what we think we're eventually going to ship. In our case, it was the October 2008 "Oslo" SDK CTP, guaranteed only to take up space on your hard drive. At the time, we'd been telling the "Oslo" story for more than a year and it had evolved a great deal. Since we published that initial CTP, we've published a few more, along with an entire web site filled with articles, videos, specifications, samples, etc.

I mean, we did it big. We were part of the keynote at the 2008 PDC and we had lots of folks on our team that are very visible in the community, including Don Box, Chris Anderson and Doug Purdy. These are the heavy hitters, so when they said something, folks listened.

And we definitely got a lot of community involvement -- way more than we expected, in fact. With that involvement, we got a ton of feedback, which is the benefit to us of releasing early and often. We take that feedback and we make changes to our product -- sometimes big changes. In this particular case, we were building on all kinds of SQL Server-related technologies, so because of pressure to build the absolute best thing we possibly could for our customers, we actually merged the division that owned "Oslo" (and WF, AD, WCF, BizTalk, etc) with the SQL Server division.

Of course, those are the kinds of changes that our customers don't see. What they see is that things are changing and that they're not quite sure what our plans are. That's one big downside:

When you share early information, sometimes it's half-baked, it often changes and is almost always confusing.

As an example, Jeremy Miller recently had this to say about "Oslo" and our communication about it's purpose in life. Believe it or not, this is helpful feedback and it's my team's responsibility to understand what exactly is holding folks up and get it fixed in the way we tell the story and in the product itself.

Another part of my team's responsibility, of course, is communicating what it is the product does so that folks can understand it and give us feedback. That means that the first people that know how confusing a product is are the folks writing the documentation and tutorials, building the videos and producing the samples. And believe me, we act as customers on the team as well, logging bugs and making complaints and bugging the developers and PMs directly, hoping to fix everything before customers even see it. Of course, we can't do that all the time (or even most of the time), so often:

We produce materials that tell the story in the very best way we know how with the current set of bits.

Kraig's recent "Oslo" blog post is an example of this. This is an important part of the process, too, actually. We, as Microsoft employees, can complain to the folks producing the software 'til we're blue in the face, but often real changes aren't made 'til real customers complain. As a consequence of this:

We take the slings and arrows of our customers and thank them for taking the time to shoot us.

This one can really hurt, actually. I'm a professional, but I take it personally when I say something that doesn't resonate with my audience (at a recent conference, I threw away an entire completed slide deck and started over only days before the deadline so I could tell a better story) and the audience takes it personally when I show them something that they don't understand.

In fact, everyone in marketing, DPE, UA and every part of the team that interacts with customers directly or via the software we're producing, including the devs and test engineers, all take it personally. We care deeply about building products that delight and empower our customers, which is why we push so hard on transparency from the bottom -- the sooner we hear your complaints, no matter how confusing we might be, the better able we are to build something you love.

I'll tell you though, if we could build something you'd love without giving you an early look, we might want to do that because:

When a customer is confused or disappointed by an early look at a product, they might not want to look at it again for a really long time, if at all.

Early looks are a double-edged sword. We want the early feedback to make our product better, but if you don't come to look at it again, you'll never know we made it better.

Still, transparency is absolutely worth the downsides. Keeps those cards and letters comin'! : )

0 comments




PowerBoots makes me want to use PowerShell!

I've picked up PowerShell half a dozen times or more. The central premise, that I can pipe streams of objects instead of streams of text between programs, is pure genius. However, in the day-to-day, two things make me put it down again every single time:

  1. The differences between ps and cmd.exe are annoying and unnecessary.
  2. The lack of pushing the boundaries on the text output in a GUI window leaves me wondering what I really gain when I get over the hump of #1.

I understand the need to "reboot" the DOS command line and get something scalable and consistent, but ps is a superset of cmd.exe and aliasing could've made the transition seamless. However, because little more than "dir" works (and "dir /s" doesn't) I'm constantly bumping into barriers just trying to get my work done in the new shell.

And I'd be really ready to learn ps, especially since it's everywhere now, but what am I really gaining? I never wrote a bunch of shell scripts in cmd.exe and I don't find myself writing them in ps either, which means that the cool "piping objects" thing doesn't make my life any simpler. What I really really want is for the text window of the ps shell to also be something active, e.g. if I do a "dir", I'd like to be able to click on a file or folder in output of dir and open it or right-click on a file and choose a method on the .NET File object to execute. Even better, I'd like all of that functionality but with a keyboard command interface like the old Norton Commander used to provide. I've tried the ps IDEs and GUI shells and haven't liked any of them.

Anyway, the first thing that's made me really really want to move to ps is PowerBoots! It's starting to really deliver on what I had hoped to get out of ps and it feels like Shoes, which I already know I love. Check it out!

0 comments




Dynamic Languages: A Separation of Concerns

I saw Nick Muhonen give a talk on the new language features in C# 4.0 last night at the Portland-Area .NET User Group. He did a good job in spite of the constant questions I asked. He showed one example that I found especially compelling:

object GetConfig() {
  return new {
    WindowSize = new Size() { Width = 100, Height = 200 },
    ConnectionString = "...",
    ...
  };
}

Of course, you wouldn't hard code settings in your application -- you'd load them from somewhere (ideally a database, but that's another story : ). Anyway, in C# 4.0, I can write code like this:

dynamic config = GetConfig();
mainWindow.Size = config.WindowSize;
...

Notice the use of the dynamic keyword -- this means I don't have to know the type at compile-type -- I'll check for the WindowSize property at run-time ala .NET Reflection, COM IDispatch or VB "Option Explicit Off". Of course, this is the cornerstone of all dynamic languages, e.g. Perl, Python, Ruby, etc. These languages have been gaining in popularity for the last few years and I didn't understand why. Tim Ewald, my close friend and compadre, kept trying to explain it to me, but I'm just too slow to get it and I didn't ''til last night watch Nick do his thing. It wasn't looking at the code that Nick typed that made the point for me, it was looking at what he didn't type.

When writing dynamic code, there is no requirement to define a type.

That is, when I inevitably add another property or 10 to my app config, I have to write code to use the new properties, but that's all. I don't have to write a class and I likely don't have to update the save/load code either, because it's also going to be dynamic and just expose whatever data is part of the serialized config. Or, to put it another way:

When writing dynamic code, I only have to write the part I care about.

In the case of dealing with application config, that's about 2/3rds of the code I no longer have to write. Of course, this isn't a new idea -- Stuart Halloway has been talking about embracing essence (the code you care about) and rejecting ceremony (the code you don't) for a long time now. It just took Nick's concrete example for me to understand it.

And not only does this make dynamic code good for reducing the code you type, it always makes it good for the code you're generating, e.g. COM interop assemblies, database mapping code, XML mapping code, etc. In general, I find that most of the code we have generated for us in the .NET programming environment is code to map to foreign type systems, i.e. COM, databases, XML, web services, etc. With dynamic languages, you can write that code once and just use it. In fact, in C# 4.0, there's no need to use Primary Interop Assemblies (PIAs) anymore -- those can just be mapped to a sub-class of the "DynamicObject" type that .NET 4.0 ships to provide that dynamic mapping bridge.

When writing dynamic code, you don't need generated code layers to map to foreign type systems.

This means I don't have to do the mapping to databases per query or to XML per XSD -- I can just have an implementation of DynamicObject, point it at my configuration and go -- no muss, no fuss. Of course, purely dynamic languages have a construct for DO built right in, so it's even easier.

Around the table after Nick's talk last night, someone was complaining that with purely dynamic languages, I give up the benefits of the compiler doing static type checking (I think it was Nick : ). I argued that this was a good thing. The compiler is really just one kind of unit testing -- it's testing names. It can't do any of the other unit testing you need done, however, so you still need unit tests. What that means is that, with static languages, you've got some unit tests separate from your code and some baked into the code via types, casts, etc.

When writing dynamic code, you can separate unit tests completely out of your code.

Of course, as software engineers, we already know that separating concerns leads to better, more readable and more maintainable code, which is why we've long separated our applications into tiers, separated our view from our data, our interfaces from our implementations, etc. Dynamic languages let us do another complete separation of concerns with regards to unit tests that static languages don't allow. In a static language, the ceremony is required, thereby obfuscating the essence.

And all of this is great except for one question -- how do I get my list of possible code to write when I type "." if I'm using a dynamic language or dynamic features of a static language ala C# 4.0?

When writing dynamic code, I don't get Intellisense.

My name is Chris Sells and I'm an Intellisense addict. Admitting I have the problem is the first step...

0 comments




Win7 killed a feature I love in Vista!

All my friends have updated to Windows 7. My 14-year old son is running Win7. I'm the only one I know that's not running Windows 7. The reason? Windows 7 took away a feature I use all the time, as shown on the right: Search the Internet.

Here's what I do all day, every day in Vista: Ctrl+Esc to bring up the Start menu, then I start typing. If I'm searching on my HD, I immediately get matches and I can choose one with just the arrows and the Enter key. If I'm typing in the name of a program in the Start menu, I get those matches and choose one. If I want "calc" or "notepad" I can just type those and those work.

However, 80% of the time, I want to search the internet, so enter my search term, optionally including attributes like "site:", I press, down-arrow once, highlight "Search the Internet" and press Enter. This brings up my default browser with my search results in my default search engine without me having to move the mouse or open the browser and wait for the home page or even decide where I want the search results to come from until after I've entered my search phrase.

And they took it out of Windows 7. : (

I logged the bug and heard nothing.

Does anyone know of I 3rd party program I can run that will work exactly like the Vista Start menu under Windows 7? Please?

0 comments




Twitter takes a bite out of blogs

At the last DevCon in 2003, blogging was rampant. We had about 100 posts in the lead up to the conference and during the conference itself.

A this year's DSL DevCon, there's a ton of buzz, but almost none of it is in the blogosphere. Instead, it's all in Twitter.Last I checked, it was more than 150 tweets and we're still on the first talk of the 2nd day (and day #1 was only a half day).

The worm has turned.

0 comments




Why I Hate My iPhone

I've had an iphone for the last coupla weeks and there are some things that drive me crazy about it!

And all of that pales in comparison to the single worst deficiency in the app-suite of the iphone for which I've found no good work-arounds; the calendar app is nearly worthless in a business environment:

The calendar app is the single thing that makes me miss my Dash. Someone please tell me there's a workaround to these issues! I'll pay!

The reason I list the things I hate about my iphone is because the list of things I love about it would be impossible to enumerate. I had a T-Mobile Dash for years and it went with me everywhere. It was as big a boost in my electronic lifestyle as my first laptop. After having a smart phone for contacts, email, music and surfing the web, I couldn't go back. Plus, I loved the Dash so much that I'd try a new phone every 6 months or so and then bring it back because it just didn't compare.

On the other hand, the iPhone replaced my Dash in 24 hours. I've been twittering iPhone development related apps. I've purchased iphone charing cables for everywhere in my life where I sit for more than 5 minutes. I want to integrate my iphone as closely into my car as possible.

They will pry my iphone out of my cold dead hands.

0 comments




How I learned to Stop Worrying and Love the Twitter

Scott Hanselman performed an intervention on me in the mall the other day. I was in denial and while I can't say I'm fully into acceptance, I'm at least past anger. : )

It took Scott 90 minutes and I fought him every step of the way, but I think I finally have a handle on what Twitter is. I've heard it described as a "24-hour virtual cocktail party," which always turned me off. I'll take a lake of fire any day over more than three strangers in a room with which I share no common task and with whom I'm expected to socialize. Making that into a 24-hour thing and including everyone in the world does not make this more attractive to me.

And while that is one valid way to describe Twitter, the more attractive way for me to thing about it is as a single global chat room with conventions and tools to pull out the bits and pieces you want, i.e. the people to which you want to listen, the topics you care about, etc.

Except that's not right, either.

Instead, it's more like a poetry reading in a hippy bar where you're up on stage saying whatever comes into your head and the audience is generally ignoring you (because they're also on their own stage) except occasionally when they holler "yeah man! right on!" back at the stage.

And why is that cool?

Well, I can't speak for anyone else, but until Scott turned the light on in my head, it wasn't. Now I check Twitter (via TweetDeck) half a dozen times a day looking for direct messages first, then replies, then new search results (I search on my name, Oslo and DSL right now), then whatever's on top of my "All Friends." When I find someone that says something interesting about a topic I like, I follow them for a while til I decide they're saying mostly stuff I'm not interested in and then I unfollow.

The whole thing feels very much like what we used to do in email ("Look! Cute kiddie pictures!") and then in blogs ("Look! I have a blog!") before we figured out how to use it and what it was really for. I can't say I really know what Twitter is for yet, although I've been following Scott's advice, i.e. bigger, permanent stuff goes into blogs, transient stuff to a few people goes into email and transient stuff that goes to the hippy bar audience (i.e. the world) goes into Twitter.

I'm still very much learning and hardly anyone is following me (@csells), but that's OK. I'm already finding out who's in the Oslo community and have had lots of useful stuff on personal topics, too, e.g. sharing my iPhone love/hate.

Also, I have to say that I really love the social aspect -- I'm working alone at my house a lot and it's nice to have the world listening to every fool thing that comes into my head. : )

0 comments




488 older posts       15 newer posts