LINQPad - The Must Have Tool

by Nick Wednesday, April 30, 2008 11:24 AM

I mentioned a couple weeks ago during my live blogging of Deeper in .NET that I was surprised that the LINQ discussions didn't utilize a utility called LINQPad.  I thought it would be worthwhile for those of you unfamiliar with the tool to write a little bit more about it, just to emphasize the importance of downloading it.  LINQPad is essentially a better version of SQL Management Studio, except instead of using raw SQL to query your database, you can use LINQ snippets.  There are some pretty sweet features in my opinion.

Ability to Navigate Foreign Key Relationships:  When you add a database connection similar to what you might do in SQL Management Studio, it shows you all the foreign key relationships with a hyperlink.  That means that when you click on the relationship, it automatically takes you to that table so you can view.  You can then see all the parent relationships so you can navigate back.

Ability to View Lambda and SQL Code:  After you've written a LINQ query, you can change the output view to show the resulting lambda version of your query, and also the resulting SQL code that gets executed.  This is invaluable as a learning tool for one, so you can see exactly how lambda expressions expand, but also to ensure that the resulting SQL is what you expect.

Ability to Run Other .NET Code:  This isn't just for querying.  You can include more complicated code in there as well, with looping structures and conditionals as well.  This gives you the opportunity to really write code snippets and test the output before you include it into your larger .NET projets.

I've really only just scratched the surface of what you can do with LINQPad.  Really you just need to download it.  It's a single executable that doesn't even have an installer.  The author of the program believes that anything with the word "pad" in the name should only require a single executable.  The only prerequisite is the .NET Framework 3.5.

O'Reilly also had a webinar more than a month ago (MOV format) with a live video demonstration of some of the cooler features which you can watch.  I highly recommend you do, so you can see some other cool features available.

My Morning Routine

by Nick Thursday, April 24, 2008 9:37 AM

I hate Internet Explorer 7.0 with a vengeance, but unfortunately due to certain policies at work, I have to use it.  The reason why I hate it may seem trivial, but it just goes to show you how a simple annoyance can eventually upset you to no end.  Internet Explorer refuses, absolutely refuses, to honor "Lock the Toolbars".  You see, I am very anal about what toolbars and strips I have on my screen, and I like to maximize the amount of viewable space for actual browsing.  So I actually try to get as many toolbars scrunched together as I can.  For whatever reason, every morning when I log in and start IE, it reorders my toolbars so that the "Links" bar is below my toolbar, and I have reorder them so they are next to each other.

If for some reason IE crashes on me during the day, and I have to restart it, then I have to do the "move the toolbars" dance all over again.  Why on Earth can't IE actually remember my settings and honor them?!

Is Interviewing Worthwhile?

by Nick Wednesday, April 23, 2008 11:12 AM

As part of my consulting work, I do technical interviews, both for my consulting company, and sometimes for clients as well.  This is fairly new to me, but I've jumped in with both feet and like everything I do with my job, I've tried to read up as much as I can in order to get as much good information and do the best job possible.  I take interviews very seriously, and have always seen them as an important step in the hiring process.  That's why I found this particular tidbit from a recent Megan McArdle post to be quite troubling:

There's a rich body of literature suggesting that job interviews are actually counterproductive. You are much better off hiring people (or not) based on their resume and/or body of work. Interviewing actually reduces your chances of hiring a satisfactory candidate.

This hit me hard to be honest.  Has what I've been doing for the last several months to vet candidates been a waste?  My gut reaction is of course to say no, but I think she brings up an important point, which I've read many places.  Most people who interview don't do a great job at it, because they let the interviewee do most of the talking.  If you let the person being interviewed do most of the talking, of course you won't find out anything.  They've practiced their schpeel over and over again, and have it down pat, or at least they should.  As a result you might hire somebody who is all fluff and no substance.  Worse yet, you can miss out on a great person who has deep knowledge, but is very nervous and not a good speaker, or is introverted, and therefore doesn't know how to sell themselves.

One of the posts from Coding Horror that I found to be incredibly useful was this one on getting a phone screen right.  The gist of the post is that you, the interviewer, should drive the interview.  The interview should be technical, and very specific.  Ask them to define common terminology, describe a sample architecture for some made up problem, or how they would approach solving a problem.  Interrupt the candidate often with questions regarding how they did something specifically, or why they chose one method over another.

The problem for technical people is that we usually don't have a portfolio we can share!  When a programmer leaves a job, they generally can't bring the source code they wrote with them and show it to a perspective employer as a sample of their work.  Megan has the advantage of working in a field where she can do just that.  She can take articles she's written for other publications and show them to someone else as an example of the quality of her work.  In the technical world, the resume can be pretty useless.  They may accurately describe projects that they've been part of, but may exaggerate their part in creating that project.  And just because you helped write a piece of software that is in production today... was it written well, with good architectural and object oriented design techniques and is it maintainable?  Or was it certified as "Works on My Machine"?

In our profession, its also easy to get roped into the "years of experience myth".  Technology changes so quickly that a great portfolio of projects in one technology doesn't show whether or not you can, or are willing to, learn the next great technology that your company wants to employ.  In fact, I've often found that the best candidates in highly technical positions are the youngest candidates, because they still remember how to learn, and are passionate about it.  The older people get, the more settled into their ways they become, and the more likely they are to pigeon hole themselves into static methodologies.  That's why I always ask people what blogs they read, magazines they subscribe to, and what, if any, user's groups they are active in.  That is a huge indicator as to how passionate about learning technology someone is.  One of the best people I've seen hired recently was in his 50's.  Software development for him was a second career, and he took it up with a fierce passion.  So you shouldn't simply look at age either.

In short, if you don't think that interviewing is worthwhile, then it probably means that you're simply running down a person's resume, and letting them talk about where they've worked.  That is not how to do an interview.

More Web 2.0 Integration... Twitter Style

by Nick Wednesday, April 16, 2008 10:33 AM

So along with the recent news that I've joined Facebook, you can also follow me on Twitter.  One of the things that I kept hearing at Deeper in .NET a couple weeks ago was, "So what's your Twitter name?" and "Aren't you on Twitter yet?".  I heard it from so many people, that I finally decided to give it a try.  And if you're on Twitter and I should know about, feel free to drop your Twitter name in the comment thread so I can add you too.  Some of my blogs also feature my latest Twitter updates in the sidebar.

This Looks Super Cool

by Nick Friday, April 11, 2008 9:10 AM

Scott Hanselman has a great overview post up on ASP.NET Dynamic Data.  It's a new preview ASP.NET framework that works with .NET 3.5 which allows you to mark up your business objects with meta data that will be used by your GUI code to control what type of control is used to view and validate your data.  This is huge if you have multiple screens that show the same data points in multiple ways, because it allows you to centralize this code into your business objects so that you can change your visualization in one location, and have it spread across all your pages.  Wow!

Now the only question I have is why doesn't something like this exist for WinForms or XAML?  Or does it already exist and I just don't know it?

Deeper in .NET Downloads Available

by Nick Wednesday, April 09, 2008 11:40 AM

For those of you that missed Deeper in .NET, and didn't think my live blogging was enough, you can find links to presentation and code downloads at the WI-INETA site here.  I highly recommend the slides for The Science of a Great UI and The Scaling Habits of ASP.NET Applications.  The information presented in those two presentations were truly unique.  The LINQ presentations were good overviews of the technologies and new language changes to support them, and are worth downloading to review, but can also be found easily in numerous books, white papers and MSDN articles.

Geeking it Out at Deeper in .NET

by Nick Saturday, April 05, 2008 7:56 AM

I found a table right next to a power source, and I have WiFi so things are good.  I'm going to be live blogging the speakers as they come up.  If you want to see the line up, you can see the listing here.

LINQ Internals with Scott Wisniewski @ 8AM

Scott had an interesting approach which was to write an app using traditional ADO.NET data access methodology to show you how painful current techniques are, and then gradually change the app to utilize the new LINQ functionality in VB9.  Not sure this was the best approach given the relatively limited time, since we all know (or should know) how painful the current methods are.  It's pretty clear that he's new to speaking at these types of events.  He has good information, and speaks fairly well, but there is a degree of polish that is missing, which only comes with speaking at events often.  This started to kill him during the presentation because he had a lot to cover, and not being fully prepared meant that his live coding demos were slowing him up.

He started out pretty basic with talking about extension methods.  However, he doesn't go into some of the important caveats of extension methods, namely that it's syntactic sugar (utilizing good compiler tricks), and isn't polymorphic in anyway.  Scott Hanselman had a good post on this recently because this issue is causing a lot of confusion.  This is sort of like how var caused significant confusion with people when it was originally talked about, in that people think it's a variant (from the bad old VB6 days) when it's not.

Obviously in an hour, you can only give just barely a taste of LINQ, but the problem is that there are so many new language features that are required to make LINQ work (extension methods, lambdas, type inference, etc.) that it's really hard to do a good job in just an hour.  For most people, getting your head wrapped around some of these things, especially lamda expressions, is really hard.

He also showed the built in XML expressions that is in VB9.  C# needs something like this!  Normally with .NET, C# would get something before VB.NET (unsigned types, using directive, built-in nullable type support with the ? operator, etc).  To my knowledge, this is really the first time that VB.NET is getting a super cool feature that C# doesn't have first class support for first.

Scott recommended Rico Mariani's blog if you're interested in the performance of LINQ.  He's got some good posts that talk about how to squeeze the maximum performance out of LINQ.  I was surprised that he never mentioned LINQPad.  If you want to learn LINQ and use it a lot, get this tool!!!  It allows you to write code snippets with LINQ and run them without having to create a command line harness, and gives you powerful looks at your database just like SQL Management Studio, but with better features for navigating the relationships in your tables.

The Science of Great UI with Mark Miller @ 9:45 AM

I'm a usability nut, so I was really looking forward to this one.  What was good right away is that he talked about things besides controls, and grids, and code.  He was talking about real "human factors" like how your eye and hand movements, if not designed well, can make things harder on your user.  Of course, he hardly talked at all about CodeRush, which is too bad because I've wanted to see more of it without installing it at this point because of the cost.

Best quote so far... "You want to be able to spank your data like a porn star."

Mark spent this first part of the talk with observations of common interaction issues.  He talked about keyboard shortcuts, mouse travel distance, and poor GUI paradigms that require extra brainpower to run a UI.  What seemed strange to me was that use used Visual Studio as an example of these pains.  While its something we're all familiar with, the developer is definitely not your typical user, and so it seemed odd.  Maybe because we consider ourselves to be power users, we don't mind the pain... but maybe that also encourages us to make poor UI's for other users.

Mark recommended Visual Explanations by Edward Tufte.  He's not a programmer, which is a good thing.  This is just about how the human brain works, and how to present things in the easiest way possible for the user.  Mark talked about showing things with the smallest effective difference necessary, presenting things in serial vs. parallel, and also reducing the amount of noise.

He also recommended using a tool from Adobe called kuler which allows you to pick good color schemes for your UI using good hue combinations.  Mark talked a lot of the difference to use contrast appropriately, as well as size.  High contrast and larger size both attract your eye, so it should be used for important data, not mundane things like headers.

Another good quote... "This moving in and out, its sort of like coding masturbation."

As far as animation goes, be careful with it.  Animation attracts the eye (like moving a window in and out from the side), but you can't work with the dialog until the animation is done.  Use changes in opacity instead because you can start moving towards your target in the middle of the opacity change and it's less jarring to the eye and brain.

For making keyboard shortcuts better, utilize context better.  Make the same keyboard combination do different things in different contexts.  One drawback of this that he doesn't talk about is confusion.  One of the beauties of keyboard shortcuts is that they're viewed as "global", and by adding too many meanings to the same combination, it might confuse the user.

He talked a lot about wanting to have UI's reorganize themselves based on context, or move the mouse if the dialog get's shifted, etc.  Unfortunately, there aren't a lot of libraries that do this for you, so you'll spend a lot of time rolling your own for these ideas until someone does it for you.  He did talk a lot about the beauty of monochrome applications, but I'm concerned about physical eye strain, and really didn't have any information on that.  You don't want to physically tire out your users, and that might be a concern.

Speaker Q&A Panel @ 11:30

I'm eating, networking and not paying much attention.  Mostly its people complaining about this or that not being in Visual Studio, and what blogs people like to read.  Heard it once, heard it a thousand times.  Why do they always serve pizza and Diet Mtn. Dew?  I mean, I enjoy both... but how much more do we need to self identify as geeks?  Honestly.

The Scaling Habits of ASP.NET Applications with Richard Cambell @ 12:45 PM

Way too much information about his personal history that took away from what the topic of the conversation was.  I mean seriously, it's good to know who you are, but I'm here to listen about specific topics.  Get to it already.  He did push .NET Rocks, Hanselminutes and RunAs Radio, which are all good developer podcasts.  Once I figure out how to integrate podcasts into my life, I'll start listening to them I'm sure.

He had really good information about all the details around performance calculations.  I know its boring, but there are lots of things that people forget to account for when doing those calculations, and reminded us of those.  You know, things like Round Trip Time, extra HTTP Requests, etc.

Interesting thought... performance is how fast something works with one user.  Scalability is how fast something works with multiple users.  The difference between the two should be as small as possible.  It's ok to sacrifice single user performance if it improves multi-user performance.  Most testing is with single users, so some changes will seem as if they killed performance, when they in fact they improved scalability.

He does talk about using Firebug and YSlow.  You need to be careful with YSlow though, because it is skewed towards using things like Content Delivery Networks which really are only useful for certain types of users.  Jeff Atwood talked about this at length.

Funny perspective on software versions:

  • Version 1:  Make it work.
  • Version 2:  Make it work right.
  • Version 3:  Business Traction (now the app is important).
  • Version N:  Business Success.

What does failure look like?  It's usually not a smoking server.  So what is it?

  • .NET Memory consumption over 80% (because the physical server may still have 1 gig free)
  • Processor consumption over 100%
  • Request queues grow out of hand (usually during a GC b/c requests can't be served during a GC)
  • Page timeouts
  • Sessions get lost
  • People bitch at you.

Nobody ever needs 100% reliability.  The cost difference between 99% reliability and 100% reliability is huge (on the order of hundreds of thousands of dollars).

His view on optimization made me sad.  What is the cost of tuning your code vs. buying another web server.  It's usually cheaper to buy the second server.  How many people will simply use that as an excuse to write bad code?  *sigh*  Sometimes optimization makes your code harder to understand and more buggy though.  So there is a tradeoff.  Often times caching isn't used as much as you think, and you pay a memory cost.  So always instrument your cache code to decide whether its worth the penalty.

Building Next Generation Web Applications Using Silverlight 2.0 with Jason Beres @ 2:30 PM

Holy cow, he mentioned Silverlight as being similar to Flash!  Now we know he doesn't work for Microsoft.  Basically this talk is marketing talk about Silverlight from someone who doesn't work at Microsoft.  Kind of boring really.  Hardly any code.

Silverlight is still pretty Beta.  In Visual Studio 2008, the graphical display is read only, and so you have to know XAML and be able to edit it in order to do anything.  At that point, the graphical display area will correctly re-render with your changes.  This seems to be by design.  Expression Blend has all the drag and drop that you'd expect.  It seems that Microsoft is enforcing this idea of having developers separated from the designers.  That's great if you're working in the Flash model, but the reality is that most companies will have one person doing both.  Why do I need two software products then?!

Strange side note, he pulled one of the Silverlight assemblies into ILDASM.  Who still uses ILDASM?!  Doesn't everyone use Reflector?  And if not, you should.  Its also important to note right now that Microsoft Expression Blend is still in CTCP, and is free to use until July 1st.  By then, you should be able to find a free license of it somewhere.

Best quote so far... "It's super fast!  It's like running an old VB5 app on a 2.5 GHz machine!"

Deep Zoom was freaking cool.  It allows you to take an extremely high resolution picture and break it into grids of higher and lower resolution sections so that you can display the picture at lower resolution, and then zoom in quickly without the huge bandwidth penalties all at once.  Sort of like how Google Maps works, but at a much finer resolution.  Matt Berseth has as some really cool examples of this.

Sadly, when he finally got to the demos, they basically all blew up.

The Essence of LINQ with C# 3.0 with Charlie Calvert @ 4:30

This will be interesting because we already heard a LINQ talk with regards to VB.NET, so now we'll see it from the C# perspective, and also whether Charlie can accommodate the fact that we heard some of it before earlier in the morning.  So far he's covering the same stuff we heard this morning, but in a slightly different way.  Scott Wisniewski did this by showing us old code and new code, while this guy is doing it by talking with a single PowerPoint slide up.

However, he is talking about some of the features of LINQ that Scott never hit, like the ability to write custom providers like extensions to use LINQ to go after reflection data in assemblies, or use LINQ to go after web services in a query like fashion as opposed to a function call like paradigm.  For instance, there is an extension to query Amazon web services using LINQ to get book information.

Why is nobody using LINQPad?  Seriously.  Who needs to write a console app in Visual Studio when you can have the results immediately delivered in an output window for your demo?

He did explain the true nature of var, and that fact that you need it for anonymous types.  A lot of people are using var to be sloppy in their coding though, so they don't have to think about the types they're using, even though they ought to be able to know the type easily.

At least he is going into more detail about what Lambda methods are, along with the new enumerator syntax (with yield return), etc..  These are really hard core changes into the language that you have to know in order to get the most out of LINQ.  It will either be really successful, or it will be the downfall because of the perceived difficulty, even though the result is easier code.

You can tell that he's a compiler geek.  He's getting really, really, excited about about Expression Trees when realistically, for someone writing a business app, you could care less.  Why can't these demos be more practical?  Seriously.  Show me how it will make my life easier writing a real world application, not masturbating over how cool the compiler can figure out parameters in a lambda.


Well that's pretty much it everyone.  Some pretty good speakers, and some interesting topics.  I'm off to the After Party... we'll see what other tidbits I can get out of them next.

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement



Flickr Photos
This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Nick Schweitzer