Posted February 25th, 2011 by garrinmf
A note to self so I remember when next I need this:
First, I don't want to wade into the argument about where default values should, in the database or in the code (see this and this for example).
I left a default value off of a number of fields when I first created them and now I wish that I hadn't. I found absolutely nothing in the guides on changing defaults and googling turned up nothing as well. Finally digging through the documentation on ActiveRecord migrations I turned up paydirt.
http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html#method-i-change_default
RUBY:
-
t.change_default(:qualification, 'new')
-
t.change_default(:authorized, 1)
or a more complete example
RUBY:
-
def self.up
-
change_table users do |o|
-
o.change_default :active, true
-
end
-
end
Posted February 3rd, 2011 by garrinmf
Notice: I understand this is nearing religious boundaries, these are just my feelings from my experience..
I've been playing around with Ruby on Rails (RoR) for sometime now on the side, looking to get to know it so any 'new' projects at work can utilize it's goodness. The reason for this could be a whole other post, but for time sake we'll just say that for the last couple years on a PHP/Zend project I've found myself striving to implement things that RoR rails provides out of the box. The following is just my experience in learning RoR.
In my playing I started out on my Windows 7 based desktop and the Windows 7 install on my dual-boot laptop as this was what I was in most of the time for work. My dev environment was pretty simple:
- Windows
- Emacs 23.?
- Multiple modes, flymake, ecb, other emacs goodness
- git bash (as a terminal)
- Ruby 1.9.2 w/Devkit (rubyinstsaller.org)
- Rails 3 w/ various gems
I will say that it was easy to setup on Windows, no problems there. Some issues that I accounted to Windows were actually issues with most tutorials still being Rails2 at the time and the inclusion of bundler and the need for bundle exec in Rails3.
The reason I would NOT recommend Windows for Rails development is SPEED. If I'd gotten into more depth as far as gems and such it sounds like there might have been compatibility issues as well but I stopped well short of that due to speed. Running 10 unit tests (rspec) would take as much as 30 seconds OR MORE on Windows. Those same tests on other platforms would take less 5 seconds or less depending on circumstances. Starting console or server was just as painfully slow. I'm running an i7 quad core with 6gb of RAM, so it's not like it was the machine lacking; it's the most powerful of all 3 machines.
The other negative was no RVM on Windows. I don't jump ruby versions much but having separate gemsets has turned out to be awesome. I've since heard of a windows copy called pik, but I can't vouch for it.
I also have a mac mini at my desk for previous projects I've done for iPhone apps. Setting up my 'standard' environment in OSX was actually somewhat of a problem. Turns out that a number of the tools I use are baked into OSX and either upgrading them or replacing them is near impossible. Luckily, as it seems OSX is the platform of choice for RoR development, most of these problems have been overcome. One such tool is RVM. It's an awesome tool in itself but it's almost required on OSX if you want to use anything beyond the OSX baked in ruby 1.8.7 from 2009.
Once up and running OSX performed VERY nicely, especially after coming off of the very slow Windows. Having a better command line and more/better tools there is a definite plus as well.
Another negative that I've since found deals with the MacBook Pro and it's keyboard layout. I setup my dev environment on my wife's MBP and I find it very trying. If you're an emacs user Ctrl & Alt are more important than the home row to you and your coding. Well, on the MBP, they put the FN key out there where every other keyboard I've used puts the Ctrl key and it is MESSING with me. I've tried getting used to it but can't. Fortunately I think you can remap the keyboard, if I could only talk my wife into it...
My laptop has 2 hdd's and currently it's setup to dual boot between Windows 7 on one drive and Ubuntu Linux on the other drive. I think this is going to change to be a full Ubuntu install with a VM of windows on the second drive very soon. Setup was much the same as on windows: Emacs, Rails 3, Rails 1.9, etc. The only addition was RVM as with the OSX.
I'd definitely recommend Ubuntu (or linux) for a development environment for Ruby. Easy to install and setup. Very speedy (compared to windows) for running tests, console, and server. Linux in general can have some problems from time to time. Being all open, sometimes things just don't work as nicely together as you'd want. But it tends to give you may more flexibility.
- Ubuntu (Linux)
- OSX
- Windows
Windows would be the one 'do not recommend'. It's doable but painful! The other two have there problems but Ubuntu wins for two reasons: I like Linux, and it's almost certainly what your app is going to be running on in production anyways! Also, OSX has a rather high barrier to entry (cost), while Ubuntu has become almost stupidly simple to install and the inclusion of an 'App Store' makes getting all the big stuff together a breeze. Plus you can try it out inside a VM (like VirtualBox) in like an hour or two for free.
Granted, my post is based off a number of assumptions like using Emacs for an IDE. If I was a TextMate user I'd almost be forced to use OSX. I'd guess there are F/OSS editors that have tried to mimic TextMate you could get on Linux but TextMate itself is OSX.

From Left to Right: Mac Mini (2 screens), Windows 7 desktop, Dual-Boot laptop
But you don't have to take my word for it!
--
Mark
Posted August 27th, 2010 by jon
I hate every time I am working on something and I have to implement INotifyPropertyChanged. My DRY-dey sense tingles. Not only am I forced to not use auto-properties (1st DRY violation), I’m forced to fire the event in each setter (2nd DRY violation), and specify the name of the property that is getting set, inside of that property’s setter (3rd DRY violation). That much WET (read: not-DRY), for something so simple leaves me a little grumpy.
I’ve been on this quest before, to simplify this a bit, but it was still a little hackety, and limiting.
This time, I set out to do it right.
I’ll spare you most of the technical details, but it’s backed by Castle’s DynamicProxy project, and there’s some integration with StructureMap to make it super easy, though you don’t really have to use StructureMap if you don’t want to. [note: I’ll probably add more container support as I find time. If you have a specific need, let me know, or submit a patch.]
Here are the codez to show it in action:
Basics
Using it for a class with an interface
// note the attribute goes on the interface, not the class
[AutoNotify]
public interface IFoo
{
string Value { get; set; }
}
public class Foo : IFoo
{
public string Value { get; set; }
}
Using it for a class
[AutoNotify(Fire = FireOptions.OnlyOnChange)]
public class Foo
{
// note for autonotify to work, the property must be virtual
public virtual string Value { get; set; }
}
The previous example shows how to get the event to fire only when the value is different also. It defaults to always firing, whether the value changes or not. It’s also important to note that your properties need to be virtual so the calls to the setter can be intercepted.
Dependent Properties
Sometimes (usually) you’ve got calculated properties that need to fire the notified event too, these usually turn into WET mess as well. We’ve got the problem solved, and you’ve got a few different options, hopefully one of them suits you.
Dependency Map – DependsOn
You specify the type that defines the DependencyMap on the attribute, and then set up your dependencies in that type’s constructor. This style is somewhat influenced by the FluentNHibernate API.
[AutoNotify(DependencyMap = typeof(ProjectDependency))]
public class Project
{
public virtual string Name { get; set; }
public virtual string[] Files { get; set; }
public virtual int FileCount { get { return Files.Length; } }
}
class ProjectDependency : DependencyMap<Project>
{
public ProjectDependency()
{
Property(x => x.FileCount).DependsOn(x => x.Files);
}
}
Dependency Map – Updates
If you’d rather express your dependency the other way around, that’s fine too. The two are equivalent.
[AutoNotify(DependencyMap = typeof(ProjectDependency))]
public class Project
{
public virtual string Name { get; set; }
public virtual string[] Files { get; set; }
public virtual int FileCount { get { return Files.Length; } }
}
class ProjectDependency : DependencyMap<Project>
{
public ProjectDependency()
{
Property(x => x.Files).Updates(x => x.FileCount);
}
}
Dependency Map – UpdatesWith
If you want to stick with an auto-property, and leave the calculated property logic somewhere else, you can hook it in via your dependency map too. This example, again, is equivalent to the previous two.
[AutoNotify(DependencyMap = typeof(ProjectDependency))]
public class Project
{
public virtual string Name { get; set; }
public virtual string[] Files { get; set; }
public virtual int FileCount { get; set; }
}
class ProjectDependency : DependencyMap<Project>
{
public ProjectDependency()
{
Property(x => x.Files).Updates(x => x.FileCount).With(p => p.Files.Length);
}
}
DependsOn Attribute
If you don’t like any of those options and are looking for something a little more simple, maybe you’ll like this one. Just specify which things your property depends on in an attribute. You lose your 100% static typing help, but it’s more concise.
[AutoNotify]
public class Project
{
public virtual string Name { get; set; }
public virtual string[] Files { get; set; }
[DependsOn("Files")]
public virtual int FileCount { get { return Files.Length; } }
}
Containers and otherwise
Hooking it into StructureMap
There are a couple conventions you can use to hook into StructureMap. There is the attribute convention (which is what you’re seeing above), and there is a generic predicate convention that you can use any predicate logic. Below you can see the attribute one getting hooked in.
var container = new Container(config => config.Scan(scanConfig =>
{
scanConfig.With(new AutoNotifyAttrConvention());
scanConfig.TheCallingAssembly();
scanConfig.WithDefaultConventions();
}));
var project = container.GetInstance<Project>();
Using it without StructureMap
If you’re using another container, or no container at all, but want to use some other factory or something, you can do that too. This example is for something with an interface. It’s very similar to do the same for a concrete class… you just don’t instantiate the object first. You also have an opportunity to hook into the dependent property structure here as well with the DependencyMap parameter.
var foo = new Foo();
var notifiableFoo = Notifiable.MakeForInterface(
typeof(IFoo),
foo,
FireOptions.Always,
new ProxyGenerator(),
DependencyMap.Empty);
Assert.That(notifiableFoo is INotifyPropertyChanged);
Whew, done
So… that’s a lot of ‘how to’, but hopefully it’ll be somewhat complete introduction to get you working with it. I really don’t see much of any reason to ever implement INotifyPropertyChanged ever again (unless you are in an environment where you can’t use DynamicProxy). It can automatically be done for you from now on.
The code is up on github, and there is a gem up on rubygems if you’re using nu or noodle+bundler. Fork it, send me a patch, use it, send feedback, etc. I hope you love it!
Posted June 29th, 2010 by jon
Ever wanted a quick/easy/automated way to get syntax highlighted code from your editor of choice into PowerPoint?
EVERY time I do a technical presentation I need this. Usually I resort to taking a screenshot, or finding an “export to html” type plugin for the editor I’m using at the time (Visual Studio, Vim, IntelliJ IDEA, etc.) and then try to get that somehow into my slides.
The problem I usually run into, is that while I like coding on a dark background with a 14pt font, that’s not usually that great for presentations. So I switch to my “presentation settings” that has a light background and bigger font size, and then switch back once I’m done taking screenshots or outputting to html. [ugh, what a pain… terribly manual].
Then what happens when I spot a bug in code that’s in PowerPoint, or I want to add a comment, or I need to change the syntax highlighting theme of the entire presentation because it doesn’t go well with the lighting in the room. UGH! What a disaster.
Basically, it’s always an uphill struggle, and it really bothered me… so I decided to fix it once and for all.
Solution
I’m going to solely discuss PowerPoint (for Windows or Mac) here. I don’t have a copy of iWork, and I’m too cheap to buy one. The reason I have Office for the Mac, is because I got it for free… KeyNote/Mac zealots: feel free to be zealous, but don’t hate on me because I’m frugal… unless you want to buy me a copy of iWork.
First, download: http://www.andre-simon.de/doku/highlight/en/highlight.html
Windows Solution
The highlight tool can output many formats, but the important one for Windows is RTF.
So something like:
highlight < infile > outfile –-rtf --syntax=rb --style=vim --font=”Lucida Console” --font-size=18
This will take the source code file ‘infile’ and syntax color it as Ruby to an RTF file and output it to ‘outfile’. The text will be 18pt Lucida Console and syntax highlighted with the “vim” color scheme.
There are lots of themes included, you can ask highlight for help (highlight --help), and it’ll tell you all the options available, as well as all the options available for output, and for languages that it supports.
Next, in PowerPoint, do “Insert Object” on your target slide, and choose “Create from file”. Make sure you check the “Link” checkbox before pressing OK.
Now, whenever your source changes, re-run your command line, then you can choose “Update Link” on your embedded object in PowerPoint, or if you close and then re-open PowerPoint, it’ll give you the option to update all your links.
Mac Solution
My version of PowerPoint for Mac doesn’t like being able to link to RTF files, but it does allow linking to images.
Highlight can output to SVG, but my PowerPoint doesn’t like that either.
Now download inkscape, if you haven’t already. It will allow you to rasterize the SVG into a PNG, which PowerPoint does like. You can export your PNG from inkscape from the command line like this:
<path to inkscape> –export-png=<png file> <svg file>
The path to my inkscape command line runner is at:
/Applications/Inkscape.app/Contents/Resources/bin/inkscape
It turns out that inkscape doesn’t like external CSS files, which is what highlight gives you with your SVG, so you can merge your CSS file into your SVG file with a little script. The other cool bit about SVG, is you can tweak it, if you want, since it’s just XML.
Now, in PowerPoint, choose “Insert Picture” and browse to your newly generated PNG. Make sure the “Link to File” checkbox is checked.
I wrote a script to do this for the latest presentation I did on dependency injection. You can take a look at the script here [source.rb]. It’s Ruby, and you can see where I merge the CSS and SVG files together, and where I mess with the line spacing as well (I wasn’t happy with the default line spacing, so I tweaked it to my preference). All the source/images/PowerPoint for that presentation are available here [dependencies presentation] if you want to check them out to see how the whole process works.
Now, when I need to change the font and syntax theme throughout my entire presentation because it doesn’t match the lighting in the room, it’s super-simple: I change the configuration, re-run my script, update PowerPoint, and chill.
Posted June 24th, 2010 by jon
I just finished reading Rocket Surgery Made Easy by Steve Krug (perhaps you know him from his other book Don’t Make Me Think). Here’s what I thought.
What’s the point? Learn how to do usability testing yourself to gain most of the benefits of hiring someone to do it, and losing most of the negatives (e.g. Big Honkin’ Report, $$$). The book’s other motive is to make sure you start doing some kind of usability testing. ALL of our sites/applications have usability problems. We could eliminate the big ones just by spending a little time on it.
How was it? A pretty quick read. I’m a slow reader, and I made it through it in a couple hours a night for 3 nights. This thing is a prescriptive manual for conducting usability tests on a product you have (or on your competitors products, if you’d like to do that). It covers recruiting participants all the way to fixing the problems they discover. Usability testing doesn’t need to be a big production, hard to do, or scary. He lays it out step by step and give you (as the guy running the tests) guidance each step along the way, complete with checklists and scripts (I know, that sounds hokey, but I think it’ll actually work).
Who should read it? If you’re reading this, you probably ought to read the book. Realistically, anyone remotely interested in having a usable application and is actually partly responsible for said application (PM, Tech Lead, Dev, Designer, Marketing, Tech Writing, Tester, etc.). Even if you aren’t going to be the one running/moderating the tests, it’s good to know what the participant’s are going through, what the moderator is doing behind the scenes, and what your role is as an observer.
Posted June 4th, 2010 by jon
This week I ran into wanting to use C# 4.0 optional parameters, but wanted StructureMap (my IoC tool of choice) to respect the default value specified for those optional parameters.
The Problem
In this example, we’ll be pulling a command out of the container. The important part is the optional constructor parameter (level), and it’s default value (Level.Info).
public class LogCommand
{
IDestination _destination;
Level _level;
public LogCommand(
IDestination destination, Level level = Level.Info)
{
_destination = destination;
_level = level;
}
/* logging code here */
}
Here is your basic usage, but doesn’t work since StructureMap doesn’t know how to take advantage of the optional parameters with default values.
var container = new Container(config =>
{
config.Scan(scanner =>
{
scanner.TheCallingAssembly();
scanner.AddAllTypesOf<IDestination>();
scanner.WithDefaultConventions();
});
});
var logCommand = container.GetInstance<LogCommand>();
The last line results in an exception because StructureMap doesn’t know how to fill in the level parameter.
The Solution
We can solve this by adding a new convention. One that adds information about default constructor arguments. Here is the implementation of the convention:
public class DefaultCtorParameterConvention : IRegistrationConvention
{
public void Process(Type type, Registry registry)
{
if(type.IsAbstract || type.IsEnum)
return;
var ctor = type.GetGreediestCtor();
if(!ctor.HasOptionalParameters())
return;
var inst = registry.For(type).Use(type);
foreach(var param in ctor.GetOptionalParameters())
inst.Child(param.Name).Is(param.DefaultValue);
}
}
Note: GetGreediestCtor, HasOptionalParameters, and GetOptionalParameters are extension methods. We’ll see their implementation shortly.
The convention inherits from the IRegistrationConvention, which is how you implement new conventions in StructureMap. It has only one method: Process. We filter out types that are abstract, are enums, or have constructors that don’t have optional parameters. Once we realize we have a constructor we want to deal with, we use the Child method, that sets either a property or a constructor argument (for our case, it’ll always be a constructor argument), and then we set it’s value to the parameter’s default value, as provided by the ParameterInfo object, for each optional parameter.
Minor Details
Curious about the implementation of GetGreediestCtor or the *OptionalParameters methods? If not, skip this section.
public static bool HasOptionalParameters(
this ConstructorInfo ctor)
{
return ctor.GetOptionalParameters().Any();
}
public static IEnumerable<ParameterInfo> GetOptionalParameters(this ConstructorInfo ctor)
{
return ctor.GetParameters().Where(
param => param.Attributes
.HasFlag(ParameterAttributes.Optional));
}
public static ConstructorInfo GetGreediestCtor(
this Type target)
{
return target.GetConstructors()
.WithMax(ctor => ctor.GetParameters().Length);
}
public static T WithMax<T>(
this IEnumerable<T> target, Func<T, int> selector)
{
int max = -1;
T currentMax = default(T);
foreach(var item in target)
{
var current = selector(item);
if(current <= max)
continue;
max = current;
currentMax = item;
}
return currentMax;
}
The Usage
Here’s how to use your new convention.
var container = new Container(config =>
{
config.Scan(scanner =>
{
scanner.TheCallingAssembly();
scanner.AddAllTypesOf<IDestination>();
scanner.WithDefaultConventions();
scanner.Convention<DefaultCtorParameterConvention>();
});
});
var logCommand = container.GetInstance<LogCommand>();
Now, when we pull the LogCommand out of the container, the level parameter gets defaulted to Level.Info, just like we specified in the constructor. Sweet!
Conclusion
This implementation is somewhat limiting, but the version I have in my github repo is a little more open and configurable. It allows you to customize the instance key/name you use when registering your type, and also allows you to do additional, non-standard registrations if you need to.
Also, this doesn’t work if you’ve selected a constructor using the SelectConstructor config API from StructureMap, I’m not sure how to tap into that facility to look for that constructor rather than the greediest.
Am I missing something? Did something not make sense? Leave me a note!
Posted May 28th, 2010 by jon
Book Club Foreword
A couple years ago I brought up the idea of doing a book club here at SEP because I had participated in a couple before coming to SEP, but we called them SEDG (coined by Steve McConnell in Professional Software Development). I don’t really like that term, so we called it book club instead.
We start up a new round a couple times a year, and small groups (3-8) break off and read different books (normally technical) that are interesting to them. We normally get together for an hour once a week to discuss/debate the chapter(s) we read for that week. I’ve participated in several including DDD (Evans), Code Complete 2 (McConnell), Programming Clojure (Halloway), and now Pro Git (Chacon). It’s a lot of fun, and I always learn a lot about the content of the book, and about the people I participate with.
I’d highly recommend starting one at your company, or in your community, it’s a great way to connect with people and learn new things at the same time.
The Book
First off, the book is available for free, online at progit.org. It’s also hosted in a repository on github, and there is an easy script to get it onto your kindle (with a little hacking of the script), so that was a win for me: free AND kindle-ized.
I participated with Matt (@spraints) and Todd (@snibble) (both of which know more about git than I do… Matt wrote git-tfs, and Todd is working with git on a REAL project).
I’ll follow Raman’s Recipe to keep this short and simple. I’ll also mix-in the book club aspect to each section.
What’s the point? Become a git ninja (or at least be able to play one on TV at work). Learn how to use git effectively, and give you the tools (ideas, knowledge, know-how) to give you a framework on how to effectively use it in your context. The cool thing about git, is that it gets out of your way and lets you work the way you and your team want to… not the other way around like SVN, TFS, P4, etc. It was also a great way to leech off of Matt and Todd’s knowledge.
How was it? Great. Scott (author) certainly knows how to git down (I’ll be here all week
). I feel comfortable participating on a project that uses git (hey look, I am already!), and also feel comfortable making recommendations about using git (e.g. “You should use git!”), though, I do still get lost in hairy situations every once in awhile (thanks Matt for always saving me!). We had some good discussions on how it relates to us as company, and how we might use it. We also had some good discussions on schoolin’ me, so that was always good. The book contains lots of examples, with corresponding diagrams to help n00bs like myself understand what’s going on.
Who should read it? Any developer planning on staying a developer for the next few years. DVCS seems to be on an up-tick, and I don’t really see it going away anytime soon (but hey, what do I know?). I don’t think you’ll be able to get by effectively in a DVCS world unless you’ve done at least some reading on the subject.
Posted May 26th, 2010 by jon
IndyTechFest is teh awesome!
I was privileged enough to be a speaker alongside some other ridiculously awesome regional speakers (and even had a few of them IN my presentation!)… star struck having @dburton, @timwingfield, @skimedic, and other community leaders like @myotherpants and @maggielongshore in the audience. I am truly humbled. Thanks to the organizers for allowing me to practice my teaching, and thanks to those that sat through my talk for supporting me (and also, thanks for the positive feedback from those I talked to afterwards!). [Side note: If you want to see my slides: http://github.com/jonfuller/presentations/tree/master/mongo/]
The best part, however, had nothing do with any presentation at the event. It had to do with the amazing conversations we had in the Open Spaces area hosted by @alanstevens. I hung out there ALL day (except for when I was presenting), and got more out of any one open space topic than I have at entire conferences before.
We talked about Ruby on Rails, IronRuby, Public Speaking, Technical Speaking, Running a User Group, Linchpins, Alt.Net, Software Craftsmanship, DVCS (hg and git specifically)…
I’ll pause and let that list of topics sink in. For me, that list is like a holy grail of a developer conference.
Most of this was deep discussion about the topic at hand by some great minds/leaders in the area. All of the aforementioned folks plus @jayharris, @alanbarber, @jademason, @garrinmf,@arktronic, @browniepoints were together having these conversations, and it was really exciting (at least for me) hanging out with these guys and learning so much from them.
For me, this year, IndyTechFest was about the people and the interactions I had with them. What was it for you?
I can’t wait for next year.
Posted May 11th, 2010 by jon
In .NET we’ve got this cool little language construct called default, that’ll give you the default value for any given type. That is, null, for any reference type, or zero/false/DateTime.Min/etc. for value types.
Here it is in action (nothing amazing going on here):
var x = default(DateTime);
So what if you don’t know the type you want the default of at compile time? You can’t say
var y = default(today.GetType());
nor
var z = typeof(DateTime).GetDefault();
That last one would be nice, but that “GetDefault” method doesn’t exist.
I’ve seen several solutions to this, that are basically variations on this theme:
public static object GetDefaultValue(Type type)
{
return type.IsValueType
? Activator.CreateInstance(type)
: null;
}
This certainly works, but I somehow feel like it’s not exactly perfect since it doesn’t use the default operator.
Here is how I normally do it. It sidesteps the IsValueType, and Activator stuff, and uses the built-in default language construct… First it grabs a handle to the GetDefaultGeneric method, and then makes the generic version of it with the specific type. Then it calls it, returning the value.
public static object GetDefault(this Type type)
{
var getDefault = typeof(ExtReflection)
.GetMethod("GetDefaultGeneric");
var typed = getDefault.MakeGenericMethod(type);
return typed.Invoke(null, new object[] { });
}
public static T GetDefaultGeneric<T>()
{
return default(T);
}
Pretty simple, but something I’ve found useful every now and again. I’d guess this technique could be useful in other situations/contexts as well.
Filed under:Uncategorized
Posted April 26th, 2010 by jon
I got beautiful teams a few months ago and tore into it hoping for lots of wonderful insights ab
out how to help culture/foster/create functional and beautiful team environments.
Instead, I ended up with a collection of stories from some people (some of which I've heard of, most of which I haven't) that have been on teams and are willing to share their stories.
Now, I know all teams and projects and organizations are different, so maybe my expectation of 'Here is how you build a team. Step 1:...' was a little naive, but I certainly wasn't expecting what I got. There were some interesting stories throughout the book (i.e. a team of folks whose conference room ended up with one of the hijacked planes from 9/11 in it, literally, it crashed into their conference room), but I had few takeaways of solid advice on how or what I could do to help nurture a great team or start to build/rebuild a failing team.
All in all, I'd say there were some entertaining stories, but if you're looking for some concrete takeaway's, look elsewhere. And on that note, if you're looking for entertaining stories, you may be better off reading some Stephen King or something like that as well. Sorry O'Reilly (and Stellman and Greene, also authors of Head First C#, which I do have and enjoyed thoroughly), this just wasn't for me. Probably my own fault for having false expectations.