Fear and Loathing
Gonzo blogging from the Annie Leibovitz of the software development world.
-
Party with Palermo losing steam?
Was just over at the Party with Palermo site for DevTeach Vancouver that's coming up in a few weeks. Jeff's banner lists 250 attendees (approx) but I'm only seeing a couple dozen names there? C'mon people. If you're going to be at DevTeach you must attend this party. Heck, if you're just in the Vancouver area why not come (if you're a geek and can tell me the 3rd parameter to System.IO.Compression.BeginRead())
Anyway, check out the site, sign up and let everyone know you'll be there. We'll even have Kyle and Justice together again for the first time. You just can't miss that!
See you there!
-
Learning to live with the squiggly line
My name is Bil Simser, and I'm a ReSharpaholic.
There. I said it. I'm addicted to ReSharper in a very heroin-like dependency way. I refuse to work without it. Yes, I will actually turn down contracts if the firm doesn't provide or forbids me to use my own copy of R#. To me my value to a customer is providing the maximum productivity that I can and to me that productivity comes from using this tool.
I know it seems wrong to depend on a tool like this but it's reality. The way I code works perfectly within the way R# aids me in being productive. It grants me a fluid motion to refactoring and code efficiency and helps me get into a groove when I code. A groove that is both productive and efficient and fun. That keeps me going throughout the day. No longer do I have to worry about namespaces, or perform manual acts of extracting interfaces, pushing methods up to base classes, or creating classes. I don't get bogged down finding classes or files and I've almost abandoned my mouse.
However being so dependent on it I'm now at a crossroads. Visual Studio 2008 RTMs later this month and I was looking forward to using it. It's faster and seeemingly better than it's 2005 counterpart and works well (at least throughout all the beta testing we've done on it). R# provides a version for VS2008 however it's lacking some major compatibility not with Visual Studio but rather the underlying CLR, namely version 3.0. This means that if I choose to move to VS2008 and R# 3.x I have to live with squiggly lines in my code whenver I'm writing LINQ, lamdba expressions or extension methods (to name a few examples).
What are these squiggly lines you ask? Take this screenshot for example:
Here you see things like "lot" underlined with a squiggly line (I'm sure there's a more technical term for this) indicating there's an error of some kind. Sometimes it's as simple as a syntax error, other times it's the wrong type being passed to a method. This helps tremendously combined with the right gutter indicator that shows there's something amiss in your code. You can immediately just jump to the spot and fix it. This is insanely useful as I like my code clean. Squiggly lines are dirty to me and mean I have to do something (and you can see without them, how would you know something is wrong until maybe compile time [maybe]).
Unfortunately things like extension methods in .NET 3.0 are alien to ReSharper, and will be for some time now. Extension methods for example allow you to extend a class (any class including string or object or your own) and enhance it. For example here's some code from Scott Guthrie that extends System.Object by adding a method called "In" to it:
This allows me to write code for example like checking if a particular ASP.NET control is within a container control collection:
However in the declaration of the "In" extension method, ReSharper is going to show it's squiggly lines as it doesn't understand "In(this object o, IEnumerable c)". It'll consider this a syntax error and indicate this in the right gutter column. This seems dirty to me. It makes me feel like I've got something wrong in my code and I need to react, but there's nothing wrong here. These aren't the syntax errors you're looking for. Move along.
So it's a toss up between using VS2008 and 3.0 projects and living with squiggly lines, or not. On the flipside, stick with 2005 and just wait until JetBrains comes out with version 4.0 early in 2008. The other alternative is to use VS2008 but not write 3.0 code (or the features that ReSharper doesn't support yet). However that in essence makes me feel like I'm restricting myself because of a tool. Not a corner I like to be in but I seem to have painted myself there.
While I understand we're talking about two different companies on two different schedules here, it bugs me. Maybe you'll say "Suck it up Princess" and deal with it. After all, the code will compile it's really only the UX inside the IDE. However to me that's important too as it makes me stop and wonder, did I miss something? Do I need to stop and do something extra here? Maybe it's not the same for you but for me it's a question I'm pondering which is making me think about this. YMMV.
Update: Ilya Ryzhenkov, the .NET Tools Product Manager at JetBrians, posted an update in the ALT.NET mailing list with some information about ReSharper 4 and C# 3.0. While this isn't "official" information, it might be useful in making decisions:
"It is not possible to convert C#-2.0 "brains" of ReSharper to semi-C#-3.0. Also, it doesn't make any sense. Not only new constructs appeared in new version of C#. There are many changes in type inference, symbol binding and other very internal things. Even if we just parse the syntax, we will not be able to resolve overloads because we can't infer the type from, say, lambda. It will still be all red code. Refactorings and other features will break all the time, because they should be updated to support new constructs. Feature as simple as Expand Selection should be updated to work consistenly.
Even now, when we have ReSharper 4 in development and it parses almost all new constructs (we use C# 3.0 actively), and even (almost) fully supports "var", extension methods, object and collection initializers, implicitly typed arrays, autoproperties - it is still a pain to use ReSharper with C# 3.0. We are working hard to make it consistent and support language in its full power, but it's going to take time.
Also note, that EAP builds will be available pretty soon, December (optimistic) or January (more realistic). So you will not have to wait for 4-6 months, if you are going to jump pre-release wagon and provide us with your invaluable feedback."
-
Not Attending TechEd Barcelona this week
I'm here in Calgary this week, not here:
No. I will no be attending TechEd Barcelona. In not doing this, I will not be checking out Agbar tower at night:
Nor will I be taking a tour of the Barcelona Palace:
And I definitely will not be visiting the Casa Mila la Pedrea.
If you are at TechEd Barcelona, feel free to check out these sites. I will however be working in Calgary, Alberta where the weather is basically crap and nothing like Barcelona.
Just wanted to make this clear for everyone who was wondering.
-
SharePointPedia goes live
The news came a little early as it was originally slated for public release on Monday, but the genie is out of the bottle now. SharePointPedia is a MOSS based website that Microsoft is running for SharePoint content. It's not WikiPedia with the SharePoint name so don't think you'll see content blocks here with all kinds of information. Instead it's more like an information portal that takes you to other places, places with SharePoint content (blogs, whitepapers, etc.) and the content is submitted and recommended by you. All you need is a Windows Live ID and once you're online, you can add your own content or recommend others. This is very much along the lines of a Digg-like community for SharePoint.
I know, I know. Some of you may be saying "But Bil, isn't that what SharePointKicks was all about?" (and we know where that site is today). Well, yes and no. It is all links to content. Rated, categorized, and vetted content. However it goes beyond what SharePointKicks offered. Content can be related to other content, recommendations bubble up to the top of the list, and users who submit the content are featured so you can see who's talking about what.
In any case, it's new and spiffy and is yet another showcase of what SharePoint can do (unfortunately no, the source code is not available). Check it out today as a contributor, a reader, or both.
-
Being a Better Presenter
I've talked previously on great presentations and presenters. For some of us, we live in two worlds. One is the eat-sleep-breath code world, and the other is the present-to-the-masses one. I think I'm a better developer than I am a presenter but I try to come up with good presentations, be flexible and friendly with my style, and above all provide value for your hard earned time you're sitting watching/listening to me. On that front here's some tips for those that are looking to advance their presentation skills.
- I feel that the majority of speakers make the common first mistake of hitting the lights and sinking everyone into a semi-coma like state. Whenever possible I suggest presenting with the lights on and tweaking slide-decks to accommodate.
- Slide Decks are the #1 flaw I see in almost all presentations and I've personally tried to not use them. People do not, can not and will not remember pages and pages of cde splattered into a presentation, 2 or 3 key words with a slick visual to invoke a reaction will almost always work better (the possible exception being web based / virtual presentations. When I do have to resort to them, I apply a 7-7-7 rule. 7 slides, 7 points, 7 words in each point. This gets the point across and let's me tell the story I want to tell without repeating what's on screen.
- More confidence and attention to the presenter is always a huge plus. The presenter should be the first point of attention, the slide deck is just a support blanket when you really need to resort to it. I was told once that a "good presentation" should be almost useless to someone (without the presenter). You almost always see people looking for the "slide deck for such and such" which always amuses me when I think of the previous statement. Again the exception being web/virtual presentations.
- Better story telling. People will always respond to a good story, any time it's possible to tell a couple of 5 minute stories that are funny or interesting and in some way tie into what your talking about, I'd say go for it. In my mind good story telling goes hand in hand with a good presenter.
- I point almost everyone I know whom is serious about presenting, and getting better at presenting to: http://www.presentationzen.com - awesome resource for tips/tricks. (other obvious favorites - Seth Godin, Guy Kawasaki).
- Know your audience going in when possible - but be ready to change gears if you see eyes glazing over. I've been mid-presentation on the finer points of some tool when I know I've lost the audience so a shift is needed.
- Practice, Practice and more Practice - No surprise here.
- Learn from others. Often I'm attending user group meetings or conferences simply for learning and picking up presentation tips from people. Seeing how others present topics and discuss ideas helps me be a better presenter. You might want to check out Al Gores traveling presentation (An Inconvenient Truth) - not so much for the environmental education, but it's possibly one of the most compelling presentations in history. It's out on DVD.
-
Geek Toys: Digital Camera Wi-Fi!
This is totally cool. An SD card with a built-in Wi-Fi adapter for uploading your pics to Flickr, Facebook, and other sites.
About a month ago John Bristowe showed me some Nikon camera that had Wi-Fi capabilities so you could upload your pics directly from the camera to Flickr. I thought it was cool so if I was say at Party with Palermo, I could snap some pics and upload them live. Pretty slick. However it meant buying a new camera which wasn't cool since I just dropped $800 on a new digital Nikon. Also the camera really didn't take great pictures so that was a bit of an issue, but the concept was what I wanted.
Now this comes into my inbox. I just ordered one so I'll let you know how it works when I get it. If you have a SD card camera and are looking for a way to get your pics uploaded without the need for your laptop, this is the way to go. The card is just an SD card and comes with 2GB of storage, which is decent. Then after you set it up, you just snap your pics and the SD card will upload your pics to the site you configure it to when your camera is in contact with the wireless network. Slick!
You can check out the webpage here.
-
Regions == Evil
I had an email thread at work with a bunch of the guys on regions and this is the concensus we generally have come to (some of the statements are theirs, not mine, just paraphrased here). I was once a convert who liked regions. I enjoyed them. They made me happy. In all the code I would do something like this:
class UserCondition : IActionCondition
{
#region Fields
private int _condition;
#endregion
#region Constructors
public UserCondition(int _condition)
{
this._condition = _condition;
}
#endregion
#region Properties
public int Condition
{
get { return _condition; }
set { _condition = value; }
}
#endregion
#region Public Methods
public bool CanExecute(string action, WorkItem context, object caller, object target)
{
string userName = Thread.CurrentPrincipal.Identity.Name;
return userName.ToLower().Equals("domain\\joeuser");
}
#endregion
}
That felt good and organized and neat (almost in an OCD way).
However I have seen the errors of my ways, as others have before me. Regions are evil. Pure and simple. The absolute incarnate concentrated type of evil that only the Time Bandits would fear and not the watered down, garden variety kind of evil.
They're great for hiding the annoying details of an IConvertible implementation or designer generated code (when it's not already in a partial class). But I often create methods on the fly using ReSharper and it is not going to look for the correct region to place the method. So having everything separated into regions actually slows me down because I have to find where to put the method.
ReSharper is your friend. Ctrl+F12 is all you need to find stuff in a file. Using ReSharper's type member layout to enforce code layout in a file, you can get consistency across all teams so one code file isn't vastly differently organized (say that 3 times fast) than any other project. With the custom pattern on, formatting puts all the members in all the right places and keeps layout and code style somewhat consistent across teams. It makes diff comparisons and merging a more pleasant experience.
Going forward, we're purging them from all projects and forbade use of them in new code. YMMV. -
The CardSpace Value Prop
Last night I took in the Calgary .NET User Group presenation on CardSpace. It was great to see Michele Leroux Bustamante again as she's an awesome presenter. CardSpace is a relatively new technology but basically it makes identity easy for end users. You can find out more about CardSpace in general here.
The thing that I'm not sure about is the value prop for this. Currently CS is really only happening behind the firewall. There's very little penetration in the "real world" so we're not seeing CS logins on Visa sites, PayPal, or even Facebook or Yahoo Groups. That was the one thing I got when I was looked at CardSpace awhile back. I thought it was neat and perhaps solved a few problems (mainly around phishing and issues of users entering ids and passwords in clear text) but there was very little implementation out there.
Discussing it last night Michele brought up an example of how she's using it behind the firewall with a client. Essentially they're looking for a SSO layer that allows them to identify users across multiple disparate data sources, and remove the issue of managing identity on each instance of a data source. If you have SharePoint installed (2007 but 2003 will work to a certain extent) and combine their SSO services with the BDC (Business Data Catalog) you essentially get something like this. However there's the issue of tracking so if you're interested in who actually logged the request this might take some work, whereas CardSpace would help solve this problem.
However behind the firewall I have a problem with CardSpace in general. I already know the user. Sure, sure. In hetrogeneous environments where my users are Mac, Linux and PC I have problems. I also might have problems in environments where I have corporate employees that I can identify (say via ActiveDirectory) but non-empoyees (contractors or external customers) that I can't. Do I force my non-employees to be members of Active Directory? Do I create a cross-trust to other forests or domains to identify them? How do I handle federated identity in the enterprise. Maybe this is the place where CardSpace helps.
Outside the firewall I see there's benefit. There's benefit for managed cards for sure so when Visa, Mastercard, and PayPal come on board (and I'm sure they will) it will make signing into sites certainly easier, and perhaps a little more secure (I'm still debating if there's more security from CS given SSL enabled sites when you're doing banking but there are other advantages). Certainly for managed cards issued by banks and other places, I'm all over that like white on rice. Everyone does it but probably doesn't admit they use fairly weak passwords and probably share the same passwords across multiple institutions. With something like CardSpace in place, it becomes a non-issue for managing paswords (the card is my password, verify me) and really all I have to do is manage my cards, much like how I manage my credit cards in my wallet now. For the geek type we know that an SSL enabled site, a valid URL, etc. all gives us a warm and fuzzy that we can enter our credit card info on ThinkGeek and not expect charges to appear at Phil's House of Bondage. For the non-geeks out there, having them select a card from a friendly UI knowing that it's pretty safe makes me feel better (and cuts down on calls from the Father-in-law about this PayPal site he's never been to).
Of course there's still the roaming issue that needs to be address but that's a different problem. The poor mans solution right now is exporting cards and importing them around (or carrying them around on say a fingerprint enabled USB drive), however it's not a happy-happy-joy-joy scenario for someone like Jason Bourne who just wants to pop into an Internet cafe and log on (okay, bad example as Jason really doesn't want to be identified, but you get the idea).
All in all CardSpace looks fun and secure and will help solve some problems of both external sites and internet identity as well help deal with issues of FedSpace and complex corporate user identification. It's not the silver bullet (has there ever been one for anything?) but it's certainly an enabler. I'm planning on doing some cool stuff with it in the SharePoint space so stay tuned on this towards the end of the year. There's also some neat stuff that I think I'm going to do on a personal level like enabling some of my own sites with it. Even though it's not widespread, it is out there and easy enough for you to just create a personal card to save you the hassle of tracking user ids and passwords all over.
Things I learned last night at the session (maybe not completely related to CardSpace):
-
Michele is Canadian! That just rocks.
-
The iPhone really kicks the llamas butt (thanks JP for the look-see) but not sure if I'm going to ditch my CrackBerry for one just yet.
-
Michele used to work at Canadian Pacific Railway about 4 years before I started in 96 (this was Michele's pre-developer days)
-
CardSpace is simple to implement (web based or services) but does take some code to get tokens and decrypt info. This is all code Michele provides in her demos but will eventually make it's way into the core platform.
-
Garrett Serack wrote the identification code for CardSpace and worked at CP with me for a short time (he's now at Microsoft in the Open Source space)
-
It's a small freakin' world
-
I finally learned how to properly pronounce Michele's full name (and in French too!)
In any case, an interesting technology to track and some cool stuff for developers to try out. Check out CardSpace for yourself and be sure to check out Michele's demos and code as it's one of the few resources out there today for playing around.
-
-
42
The answer to life, the universe, and everything.
Also the number you'll get if you cut me open today and count the rings.
-
ALT.NET Quote #1
Overhead on the altnetconf mailing list:
"Design without patterns is the slowest route to victory. Patterns without design is the noise before defeat."