Scott Hanselman

The Weekly Source Code 59 - An Open Source Treasure: Irony .NET Language Implementation Kit

October 14, '11 Comments [19] Posted in Learning .NET | Open Source | Source Code
Sponsored By

Select Grammars Dialog in Irony filled with grammarsOne of the best, if not the best way to sharpen the saw and keep your software development skills up to date is by reading code. Sure, write lots of code, but don't forget to explore other people's brains code. There's always fifteen different ways to create a "textboxes over data" application, and while it's interesting to take a look at whatever the newest way to make business software, sometimes it's nice to relax by looking at some implementations of classic software issues like parsers, lexers, and abstract syntax trees. If you didn't go to school or failed to take a compilers class at least knowing that this area of software engineering exists and is accessible to you is very important.

It's so nice to discover open source projects that I didn't know existed. One such project I just stumbled upon while doing research for a customer is "Irony," a .NET language implementation kit. From the CodePlex site:

Irony is a development kit for implementing languages on .NET platform. Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs. Irony's scanner and parser modules use the grammar encoded as c# class to control the parsing process. See the expression grammar sample for an example of grammar definition in c# class, and using it in a working parser.

Irony includes "simplified grammars for C#, Scheme, SQL, GwBasic, JSON and others" to learn from. There are different kinds of parsers that are grammar generators you might be familiar with. For example, ANTLR is a what's called a LL(*) grammar generator, while Irony is a LALR (Look Ahead Left to Right) grammar generator.

Here's a very basic SQL statement for getting a show from my Podcast database:


Here's the Irony Parse Tree as viewed in the irony Grammar Explorer:

A complete parse tree of the SQL statement with every node expanded

Typically, in my experience, when creating a parser one will use a DSL (Domain Specific Language) like the GOLD Meta Language building on the BNF (Backus-Naur Form) expression grammar. These domain specific languages are tightly optimized to express exactly how a language is structured and how it should be parsed. You learn a language to create languages.

Remember in the Irony intro text earlier? Let me repeat:

Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs.

What Roman from Irony has done here is use C# language constructs as if it's a DSL. A fluent parser, as it were. So he's using C# classes and methods to express the language grammar. It's a very interesting and powerful idea if you are interested in creating DSLs but not interested in learning other parsers like GOLD. Plus, it's just fun.

The Irony Grammar Explorer

He has a very rich bass class called Grammar that you derive from, like:

[Language("SQL", "89", "SQL 89 grammar")]
public class SqlGrammar : Grammar {
public SqlGrammar() : base(false) { //SQL is case insensitive

But instead of a grammar language like this (simplified by me) to express a SQL SELECT Statement:

! =============================================================================
! Select Statement
! =============================================================================
<SELECT Stm> ::= SELECT <COLUMNS> <INTO Clause> <FROM Clause> <WHERE Clause>
<GROUP Clause> <HAVING Clause> <ORDER Clause><COLUMNS> ::= <RESTRICTION> '*' |
<RESTRICTION> <COLUMN List>...snip for clarity...<RESTRICTION> ::= ALL |
DISTINCT |<AGGREGATE> ::= Count '(' '*' ')' | Count '(' <EXPRESSION> ')' |
Avg '(' <EXPRESSION> ')' | Min '(' <EXPRESSION> ')' | Max '(' <EXPRESSION> ')' |
StDev '(' <EXPRESSION> ')' | StDevP '(' <EXPRESSION> ')' | Sum '(' <EXPRESSION> ')' |
Var '(' <EXPRESSION> ')' | VarP '(' <EXPRESSION> ')'<INTO Clause> ::= INTO Id |
<FROM Clause> ::= FROM <ID List> <JOIN Chain><JOIN Chain> ::= <JOIN> <JOIN Chain> |
...snip for clarity...

You'd have something like this instead, again, simplified so this doesn't turn into a giant listing of code rather than a blog post.

//Select stmt
selectStmt.Rule = SELECT + selRestrOpt + selList + intoClauseOpt + fromClauseOpt + whereClauseOpt + groupClauseOpt + havingClauseOpt + orderClauseOpt;
selRestrOpt.Rule = Empty | "ALL" | "DISTINCT";
selList.Rule = columnItemList | "*";
columnItemList.Rule = MakePlusRule(columnItemList, comma, columnItem);
columnItem.Rule = columnSource + aliasOpt;aliasOpt.Rule = Empty | asOpt + Id;
asOpt.Rule = Empty | AS;columnSource.Rule = aggregate | Id;
aggregate.Rule = aggregateName + "(" + aggregateArg + ")";
aggregateArg.Rule = expression | "*";
aggregateName.Rule = COUNT | "Avg" | "Min" | "Max" | "StDev" | "StDevP" | "Sum" | "Var" | "VarP";
intoClauseOpt.Rule = Empty | INTO + Id;fromClauseOpt.Rule = Empty | FROM + idlist + joinChainOpt;
joinChainOpt.Rule = Empty | joinKindOpt + JOIN + idlist + ON + Id + "=" + Id;
joinKindOpt.Rule = Empty | "INNER" | "LEFT" | "RIGHT";
whereClauseOpt.Rule = Empty | "WHERE" + expression;
groupClauseOpt.Rule = Empty | "GROUP" + BY + idlist;
havingClauseOpt.Rule = Empty | "HAVING" + expression;
orderClauseOpt.Rule = Empty | "ORDER" + BY + orderList;

Here the variables and terms that are being use to build the grammar were defined earlier like this, as an example:

var SELECT = ToTerm("SELECT"); var FROM = ToTerm("FROM");var AS = ToTerm("AS"); 

You might immediately declare, Dear Reader, that this is blasphemy!  How can C# compete with a specialized DSL like the BNF? This is a C# shaped peg being shoved into a round hold. Well, maybe, but it's interesting to point out that the SQL GOLD Grammar is 259 lines and the C# version of essentially the same thing is 247 lines. Now, I'm not pointing out line numbers to imply that this is a better way or that this is even a valid 1:1 comparison. But, it's interesting that the C# class is even close. You might have assumed it would be much much larger. I think it's close because Roman, the Irony developer, has a very well factored and specialized base class for the derived class to "lean on." Each of his sample grammars are surprisingly tight.

For example:

  • "Mini" Python - ~140 lines
  • Java - ~130 lines
  • Scheme - ~200 lines
  • JSON - 39 lines

To conclude, here's the JSON grammar generator. 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Irony.Parsing;

namespace Irony.Samples.Json
[Language("JSON", "1.0", "JSON data format")]
public class JsonGrammar : Grammar
public JsonGrammar()
var jstring = new StringLiteral("string", "\"");
var jnumber = new NumberLiteral("number"); var comma = ToTerm(",");

var jobject = new NonTerminal("Object");
var jobjectBr = new NonTerminal("ObjectBr");
var jarray = new NonTerminal("Array");
var jarrayBr = new NonTerminal("ArrayBr");
var jvalue = new NonTerminal("Value");
var jprop = new NonTerminal("Property");
jvalue.Rule = jstring | jnumber | jobjectBr | jarrayBr | "true" | "false" | "null";
jobjectBr.Rule = "{" + jobject + "}";
jobject.Rule = MakeStarRule(jobject, comma, jprop);
jprop.Rule = jstring + ":" + jvalue;
jarrayBr.Rule = "[" + jarray + "]";
jarray.Rule = MakeStarRule(jarray, comma, jvalue);
//Set grammar root
this.Root = jvalue; MarkPunctuation("{", "}", "[", "]", ":", ",");
this.MarkTransient(jvalue, jarrayBr, jobjectBr);

Pretty clever stuff, and a well put together project and solution that is well structured. I could myself using this in a C# or Compiler class to teach some of these concepts. It's also a great little tool for creating small languages of your own. Perhaps you have a Wiki-dialect that's specific to your company and you want to get rid of all that nasty manual parsing? Or many you have an old custom workflow engine or custom expression system embedded in your application and never got around to changing all your parsing to a proper grammar? Maybe now is the time to get that little language you've been thinking about off the ground!

I encourage you, Dear Reader, to support open source projects like this. Why not go leave a comment today on your favorite open source project's site and just let them know you appreciate what they're doing?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Just please comb their hair and wipe their noses - My month as a single dad

October 11, '11 Comments [53] Posted in Musings | Parenting
Sponsored By

OnomatopoeiaThis month I've definitely realized that intellectualizing something is different from actually living it. I've been a single dad for the last 24 days. My wife has been in South Africa attending a family wedding and visiting friends while I've been alone with our two boys, ages three and five. It's been an experience, to the say the least. I decided to take half-time vacation and worked 10am - 2pm while the boys were in school.

Other than my obligatory 4 hours of deleting email work it was all home-making and kids for me. Who knew that single parenting is so hard? There were the first few days of "this is new," followed by "when is Mommy coming back," and the inevitable "so this is what life is like without Mommy." Definitely an emotional roller coaster for everyone.

Then there seemed to be a series of phases I went through, not unlike the phases of grief.
Shock - This phase includes disbelief and numbness. What am I gonna do? Gotta make sure the boys get to school each day. I have to sleep well, don't want to burn out too early.

  • Denial - After a few 3am surprise wake-up calls and obligatory potty emergencies, one tends to find themselves overwhelmed.
  • Bargaining - Just sleep through this one night and...
  • Guilt - Oh, I'm a horrible parent, the boys were late for school today.
  • Anger - This is so frustrating. Just do what I say and everything will go fine.
  • Depression - This totally sucks, how does anyone do this without help?
  • Acceptance - OK, I've got this. Maybe not the laundry, but lunches and playtime, I've got that down solid.

Death by a Thousand Tiny Cuts

Sometimes in a marriage (with kids) one tends to assume that their job to see the hardest. The thing is though, each role fulfilled by each spouse is different. The thing I learned about single parenting is that it's truly incessant. By that I mean specifically "it never ceases." Taken individually the tasks involved aren't difficult: make lunch, do laundry, buy food, but the problem is - it never stops. Just because I made meals and cleaned up all day yesterday doesn’t mean I don’t get to do it again today. And tomorrow. And the day after that...There's no credit to be brought forward for doing well yesterday: the clock resets, and it starts all over.

It seems that single parenting is the ultimate project management job. Every day included not the dozens of daily details that keep a house running but another dozen irregular details that were challenging to keep track of. I keep a lot of lists and notes and to-dos in my day job, but I had 4x the lists and notes and to-dos in this new single-parent job.

Playing to my strengths

One of the most significant things I learned about myself is to play to my strengths. While I may not be very good at remembering whose hair is combed or to wipe noses, I'm pretty good at teaching. I worked with the 5-year old who has been a little stalled at sounding words out. Turns out he's just bored with the material. Seems that "See Spot Run" isn't as interesting as "Batman." I found some age-appropriate comics (no guns, easier stories) and rather than trying to get him to read the dialog of the comics we focused entirely on the onomatopoeia action words. After doing this for a week I discovered that using comic books to teach onomatopoeia is a real thing that's done in schools. Cool!

The Good and the Bad

A good friend of my got divorced a few months ago. He made a large purchase and mentioned said to me,

"You know what the best part was? Not having to ask permission before making the purchase. And the worst part? The same."

That's a powerful and profound statement right there. It really stuck with me and totally applied in my month alone. On the one hand, it was really enabling and empowering to be able to change the system. We ate what we wanted (it was still good food, just what I wanted) and did what we wanted (zoo, museums, etc.) It wasn't that we didn't do these things when my wife is here but the point is, there's just one less adult voting. It felt like things went more smoothly, probably because any debates happened in my own head. It was nice to just decide things.

On the down side, there's no one around to brainstorm with. And there's no break at 3am. Or 4am. Or 5:30am. I don't know how single parents get a break, especially if they don't have family to lean on.

If it works, keep it. If it doesn't, change it

Now that the wife is back, we're going to look at some of the systems that I came up with and combine them with the existing ones that she had going. The goal is for neither of us to burn out doing our jobs. I think each person in a partnership tends to get hyper-focused on the task in front of them and forget the stresses on the other partner. Both of us have jobs that "never stop." We can't turn off and focus on something else just because it’s after 5pm. I really enjoyed my time with the boys as a single parent, and hope I never have to do it again any time soon!

The Customers (Kids) Don't Care

Another fascinating part to this was the complete ambivalence and amazing resilience of the children. While they were sad after Mommy was gone, a few days later "the new normal" become clear and they were back to business. I was a wreck, of course, but the kids didn't miss a beat. Their inherent wonderful "childish selfishness" remains intact, as it should. "What? Mom's gone? Ok, so are you the one making sandwiches now? Service! There's only one waiter in this lousy restaurant?"


I appreciated that my wife didn't just fly in, raise the landing gear and immediately take over the whole ecosystem. The boys and I had a good thing going and found a kind of equilibrium. A snotty nosed, wrinkled clothed, uncombed equilibrium, but equilibrium nonetheless. (Dad's skills lie elsewhere. Their pants were on straight 85% of the time, so I take full credit for that success!) My wife recognized that she was returning to a new house with new rules and we have spent the last few days talking about what worked, what didn't and what things we discovered while she was gone that we might want to keep.

Walk a Mile

It's certainly hard to be judgmental of any single parent when you've been one. We've all seen a single mom or dad walking around and wondered "where's the other partner?" Well, who knows, maybe in Africa, but you can bet that the one left is working hard.

I was explaining how college degrees work to the kids as we drove my a university this morning.

Me: "...Well, Mommy has a Master's Degree, she's very smart."

3: "Where is it?"

Me: "What?"

3: "The master."

Me: "It's on the wall in the office."

3: "Why don't you have one of those smartie things that mommy has?"

This made me remember that my wife has taken time off from one career to make the kids her career for a few years. I definitely understand my wife's job better after this month.

Behind every great man is a woman who is not impressed. - Me on twitter

Now I just need to figure out how to get her to do my job for a month so she'll appreciate how hard it is to tweet and restart Outlook! ;)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

410 Gone - Thoughts on Mark "diveintomark" Pilgrim's and _why's infosuicides

October 10, '11 Comments [66] Posted in Blogging | Musings
Sponsored By

Developer Tools - http___diveintomark.org_ (88)I don't know Mark Pilgrim personally. I only know his work and it's excellent. I knew of him first from his Dive Into Accessibility almost a decade ago and later from his other "Dive Into" books that educated a young generation on Python, and most recently HTML 5.

Mark is alive, but online he's gone. He committed "infosuicide" last week. All of his websites are Gone. That's capital G, Gone. Not 404, Not Found, but the not-often-used HTTP Status 410. And this is where it gets concerning to me.

HTTP Status 410 states per the spec with emphasis mine:

Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally removed and the resource should be purged. Upon receiving a 410 status code, the client should not request the resource again in the future. Clients such as search engines should remove the resource from their indices. Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.

As it says, most use cases don't call for removal from a search engine, but in this case, Mark literally and figuratively "took his ball and went home," no longer interested in playing.

The first major "infosuicide" of note was that of whytheluckystiff, author of Why's Poignant Guide to Ruby. No one knows why _why left, but a tweet just before he left said:

programming is rather thankless. u see your works become replaced by superior ones in a year. unable to run at all in a few more.

Perhaps one can glean some meaning from that. In a similar vein, in 2008 Mark blogged on minimalism and then before Twitter existed Mark Pilgrim blogged (almost 7 years ago this month) a microblogpost, preserved via the Wayback Machine:

It’s time for me to find a new hobby. Preferably one that doesn’t involve angle brackets. Or computers. Or electricity.

Why do I care? I'm exploring this as someone who has been blogging publically and effectively nonstop since 2002. That's almost a decade, Dear Reader. For me to leave, either willingly or unwillingly, after putting so much useful (presumably, says my ego) information out there would be one thing. But to leave AND remove all that information, declaring it Gone and asking that it no longer be indexed seems, on the surface, to be a selfish act.

I realize it costs money to keep a website up but it's typically not a crushing expense. If one wanted to retreat from online life (as I sometimes do) one could add a banner to their existing sites that says something like "I'm taking a break and teaching high school" or "I've become a non-technical ER nurse" or "I've opened a hair salon" (each has been a one-time fantasy job for me) and setup an email auto-responder. This extraction from being online wouldn't take more than a week of prep and would be perceived as a much classier - although not as dramatic - move than a disappearance hinging on an HTTP status code.

Even so, Erik Meyer quotes Mark in a 2003 post:

"Embracing HTTP error code 410 means embracing the impermanence of all things."
- Mark Pilgrim, March 27, 2003 (

That's an accurate albeit mighty metaphysical reading into the HTTP spec. Do bloggers/teachers/infopublishers have the right to leave the community? Of course. Do we have the right to control, and ultimately remove our content? Surely. But to put so much information out and to remove it seems unnecessary. Is it to much to ask to maintain ones own archive, if only for a little while?

I've always said two things. First, respect the permalink. Second, don't give bile a permalink. While a 410 isn't bile, it's not the most respectful way to disappear.

Reading into Mark's blog, it's obvious that being on the web didn't feed his spirit. It does leave one to wonder, when you pass on, will you be mirrored or just 410 Gone?


The requested resource /
is no longer available on this server and there is no forwarding address. Please remove all references to this resource.

I truly wish Mark all the best in his disconnected life, as I do anyone else who wants to disconnect. If they come back, we'll be here.

Mirrors of Mark "diveintomark" Pilgrim's Work

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

RFC: New website

October 10, '11 Comments [55] Posted in ASP.NET | ASP.NET MVC
Sponsored By Before I worked for the ASP.NET team as I do now, I worked for MSDN. While I was over there, part of my time was spent working on the team. I led the charge to move the site over to Umbraco, and we did. Over the last two years, we have continually made improvements to the .NET (,, sites. In July, the MSDN team announced the release of a new Silverlight site, and today I'm happy to announce the Beta launch of a redesigned ASP.NET website at

This redesign is still a work in progress, but we wanted everyone to see where we are heading with not just a new look and feel, but also improved organization and navigation that will hopefully make content easier to find. We'll be collecting feedback on UserVoice.

What's new with the redesign

You'll notice that the top-level navigation is similar to the current site ( to keep the familiarity, however we have significantly improved the site design and navigational framework around Learn and Community content in an effort to make it easier to discover and find information on the site. The issue is that there's piles of great content on the site but it's hard to find. Here are some highlights of the redesign:

  • A newer Information Architecture (IA) that scales with different types of content. Trying to get you somewhere useful quickly.
  • Content organized into relevant topic areas (Overview, Videos, Tutorials, etc.) to make information easier to find and to learn a technology.
  • Improved on boarding experience – Developers new to ASP.NET should find it easier to get started and download what they need.
  • Important Samples and Tutorials are positioned prominently in the structure of the site so that they are easier to find.
  • Textual Tutorials are as important as videos - We've heard people want text tutorials more than videos, so we're finding balance between these two kind of content.
  • Improved Social Integration – Community info, pulling from Twitter, Facebook and blogs.
  • A less cluttered user experience to get you where you need to go in fewer clicks.
  • Open Source and Samples - We're looking for new ways to showcase great open source projects and excellent samples.

Next Steps

Not all the content and features are in place yet! The ASP.NET Website team will continue to iterate over the information architecture, layout, and content (with lots of new video and text content) in the coming weeks, and we are targeting to launch the final site by the end of November.

I know, more than anyone, that the #1 piece of feedback has been that folks don't like the ads. You don't need to tell me, as you're preaching to the (powerless) choir. Instead, make yourself heard - both positive and negative - at the ASP.NET Website section of our User Voice site.

I hope you like the site and find it useful. It's at

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Brain, Bytes, Back, Buns - The Programmer's Priorities

October 5, '11 Comments [70] Posted in Musings
Sponsored By

My office, which I am very happy withI recently said something that ended up making the rounds on Twitter:

"If you're a developer, you need to spend money on a great computer, an awesome monitor, a fantastic chair and a good bed" - Scott Hanselman

This convenient 140-character-friendly statement could be misconstrued, I suppose, as me saying that good developers need to spend money on expensive gear. That's not my message. I'm saying that you need to invest in your tools.


I was listening to a designer friend recently agonizing over the purchase of a US$700 chair. I realize that everyone makes different amounts of money depending on where they live in the world, but bear with me. This designer spent months trying to decide if this chair was a good idea. "It's so expensive! Should I spend that much?”

Now, we're not talking about jewelry, or video games, or fancy pants. We are talking about a chair that is going to be sat on while work is done for hours a day for at least a few years. Figure 50 weeks a year, for 3 years (at least) for 5 hours a day (because these are round numbers) that's at least 1250 hours in the first year (and more likely much more) and 3750 if it lasts the 3. That's a 19 cents an hour for a comfortable butt. Invest in your own ass.

I don't regret my purchase of a Herman Miller Aeron Chair one bit. The best part is that I bought it for myself, with my own money over 5 years ago. Every day I own it, I enjoy it, and my cost of usage per day goes down.


I spent a decent amount of money on a very nice mattress as I've got Programmer's Back. I'm consistently surprised when I talk to developers who have cheap (meaning, low quality) mattresses and cheap chairs and they complain about pain. A programmer in pain is a lousy programmer. To quote Wu Tang Clan, protect ya neck. Don't skimp on your sleeping quarters.

Physical purchases aside, it's also crucial to invest in your back with things like yoga, stretching and regular exercise. When you are using something eight hours a day for week after week, do the research and invest in that thing. You're flat on your back unconscious for a full third of your life. Give that amount of time the respect it deserves and do what's right for your body. One of the essential tools is a quality bed. I enjoy investing in a new computer but only recently realized that a utilitarian purchase like a great mattress is just as valuable and just as life-changing.

I also have a height adjustable desk (a Steelcase Series 7) which I enjoy. I wouldn't have thought twice about purchasing this desk on my own, but with enough visits to a chiropractor turns out these are easy to come by. It's motorized and has presets so it's easy to set and switch between seated and standing positions. If you think one would be helpful to you, talk to your HR department and request an ergonomic evaluation. Can't hurt to ask, but it is guaranteed to hurt if you don't.s


Ya, I couldn't just say "computer" and screw up a potentially killer alliteration. Surely you understand, Dear Reader. I hate seeing people suffer with crappy hardware. I went back and forth with a gentleman on Twitter running a 4 to 6 year old Mac who felt that I was advocating or implying that one must have awesome hardware to be a good programmer. That wasn't my intent, but this is. If you are waiting for your computer, you are wasting time. Forget about religious arguments, I don't care if it's your operating system, your text editor, or that spinning rust you call a hard drive. If it's making your wait, swap it out.

Start by getting an SSD. The fellow on twitter with the slightly older hardware had an SSD in the machine. Everyone can use an SSD. There are only so many life-changing hardware purchases left in the world. Treat yourself. They are, memory, SSD, monitor.  No matter what OS you are running, have 4 gigs of RAM at least. You can get little SSDs for under US$100 these days and decent sized ones for $200. I pulled the trigger on a 256 gig OCZ Vertex and even if it lasts just a year, it's just $2 a day for the kind of silent joy that only a saturated PCI bus can give. Every day after a year it lasts (it'll likely last a few) it gets cheaper to have owned it.

Get whatever size or number of monitors that makes you happy. I like three monitors. For laptops, I like a 15". Some folks do great on a 13" LCD but others prefer something larger. My point is, if you HATE your monitor situation, change it. You're worth it and it'll make you more productive.

And, as always, if you have Programmer's Hands, consider your keyboard and mouse. While I realize that many of you insist and persist on using a standard straight keyboard for typing even in spite of the obvious anatomy, the most important thing is to listen to your body. If your desktop set works for you, awesome. If not, get one that supports you and the way you work.


Books, classes, experience, and challenges all push your brain. I often tell the story of the senior developer who has 20 years experience. The problem is it's the same year of experience, twenty times. Somewhere in year 5, or year 14, you'd think this developer would notice this and break out. What I'm saying is that not only should you as a programmer listen to your body, you should also listen to your brain. If your tool is dull, consider consciously what you can do to sharpen the saw.

When I speak to user group meetings or regional conferences and code camps, I'm always sure to tell the attendees something like this:

 "You're already in the top tier of developers just by showing up here tonight. I don't know how talented you are, how much experience you have, but you showed up. You're putting yourself out there because you care to improve. Thanks for caring."

You should give yourself credit for simply being conscious. Not conscious as in 'a living entity' but conscious as in 'paying attention to your journey.' If you are conscious, you're ahead of the pack. We get into trouble when we aren't paying attention. Time goes by and one wakes up years later with no new experiences, no new knowledge, essentially treading water with no inertia. Sometimes just waking up and paying attention is the catalyst one needs to make a change. Every new day is an opportunity to turn it around. Don't feel bad about taking that class, buying that new book, or starting that new mentoring relationship. Get them and put them in your brain - they'll be yours forever.

There's this wonderful story that comedian Paul Reiser told Marc Maron on Marc's podcast. Paul met the actor Peter Falk and asked him if there was a secret to writing a movie script. Peter Falk said "get some paper, put it in a typewriter, type FADE IN...and keep typing."

It's surprising how that answer also works when someone asks me how to succeed in programming. Be conscious, take care of yourself, invest in your tools, and do the work.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.