Welcome to the first in a new series of interviews called â€œHow I Workâ€. These interviews revolve around how thinkers and creators in the Web world design, code, and create. The goal is not to get into the specific nuances of their craft (as that information already exists online), but rather step back and learn a bit about their habits, philosophies, and workflow for producing great work.
Meet Doug Crockford
Image credits go to Eric Miraglia.
Below is a conversation that took place in Bozeman, Montana prior to a talk at Montana State University. Doug freely shared his thoughts on great programmers, user empathy, and how JSON restored his faith in humanity.
Why do you feel programmers should study the history of Computer Science?
Well, first semester of physics is a history class. You study Galileo and Newton and all their contributions to the field and that gives us the overall view of physics. Itâ€™s a really nice place to start.
I wish CS would do that. It doesnâ€™t seem to have enough value in its history and itâ€™s a really amazing history thatâ€™s completely neglected. Itâ€™s rarely that the best idea won. So, weâ€™ve taken different paths over the years and maybe havenâ€™t realized why.
Ironically, despite the rate of change in technology, we see in the story of software that it takes a generation to retire or die off before we have a critical mass of bright young minds to embrace new ideas.
I think if people were more aware of their history, they could see these patterns more easily.
What were the traits of the weak programmers youâ€™ve seen over your career?
Thatâ€™s an easy oneâ€”lack of curiosity. They were so satisfied with the work that they were doing was good enough (without an understanding of what â€˜goodâ€™ was) that they didnâ€™t push themselves.
Iâ€™m much more impressed with people that are always learning. The brilliant programmers Iâ€™ve been around are always learning.
You see so many people get into one language and spend their entire career in that language, and as a result arenâ€™t that great as programmers.
Do you feel that the pain a programmer goes through in learning a language contributes to this unhealthy attachment to using only one language?
My advice to programmers to avoid this trap is to learn lots of different languages. Weâ€™re in sort of a language renaissance right now and there are a ton of brilliant languages to learn from.
To learn new languages takes nights and weekends outside of work, and thatâ€™s a commitment. The great programmers are the people that are constantly picking a project and diving into it, learning a language that way.
In Coders at Work, you stress the importance of doing code readings with teams. Why do you feel itâ€™s important to present your code in front of other people?
Well, over the years I noticed that there are some terrific programmers out there that are completely content to sit in their cave all day long writing brilliant code. But they donâ€™t interact much with their team, which means itâ€™s a lost opportunity for mentoring other members.
As you know, a lot of coders arenâ€™t the most socially adept animals either.
So, my idea with code reading sessions is to provide a forum where people can come together and read for each other to get them out of their caves. The masters read for the beginners, and vice versa, as a team-building exercise.
The trick for success is to set up rules ahead of time so that nobody is going to get spanked and everyone is respectful in their feedback. It has to be a good learning experience for everyone. You have to be careful with a dysfunctional team, because it can quickly tear apart the group. But I always call the game before it gets that far.
The rules are that itâ€™s about improving the quality of the code that weâ€™re all responsible for, improving the quality of our team, and improving our individual capabilities.
Some people see this as a terrible time sink. Yet, Iâ€™ve found by doing this exercise, bugs are caught way ahead of time and you can prevent a team member from going off the tracks. But again, thatâ€™s not the goal, itâ€™s about team building.
Over time the masters help pull up the beginners and the overall output from the team gets better.
Are programmers getting better at user empathy?
The best experience I had with empathy was working in marketing support. There were times I would go out into the field and hold hands with the customers and see the consequences firsthand of some of the crap we were delivering to them.
I was shocked when I moved into systems programming and how the programmers actually held the customer in contempt.
I think every programmer should work in customer support for the product theyâ€™re delivering.
Itâ€™s another case of over-specialization. â€œI just write the code,â€ is the response you get and the programmers donâ€™t see it as a chance to improve peoplesâ€™ lives.
How much of a language do you need to know?
Virtually every programming language is too big. Language standards have difficulty removing unnecessary features but as users we can choose not to use it.
I would say you can do 100% with knowing 50% of the language.
What approaches would you say a master has versus a beginner?
When I was a journeyman, I was a maximilist. I tried to use the whole language. While I donâ€™t know if I would call myself a master now, Iâ€™m certainly a minimalist. Iâ€™ve tried to get good at using as little of the language as possible.
I place a lot of value in simplicity and minimalism.
What are your thoughts on jQuery? Some JS enthusiasts feel like itâ€™s letting people off the hook from truly learning JS.
There is some really clever stuff in jQuery and I think John Resig did some very good work there.
I do have a problem with anybody doing anything without understanding what theyâ€™re doing. Iâ€™m not going to fault jQuery for attracting those sorts of people.
But I do think there are some other AJAX libraries that maybe doing a better job that arenâ€™t quite as accessible. However, I think there is a place for all of these things.
When you were developing JSON was it tough to pull back and not put too much into it?
But it also meant that when somebody proposed, â€œHey we should do this crazy thingâ€ we could be like â€œNopeâ€. So, we had a really easy criteria for stopping extra features from being added.
One interesting story about leaving things out: as we got closer to releasing JSON I decided to take out the ability to do comments. When translating JSON into other languages, often times the commenting piece was the most complicated part. By taking the commenting out we reduced the complexity of the parsers by halfâ€”everything else was just too simple.
One of the best features of JSON is that itâ€™s stable. If your program works now, it will work forever, and that is an attractive thing.
I still get notes from people saying theyâ€™ve got great ideas for the next version. But there isnâ€™t going to be a next version. I always say youâ€™re free to invent a new standard and promote it as much as you like.
How did JSON get adopted?
You know, the adoption of JSON sort of restored my faith in humanity because it was a good idea that won out, only because it was a good idea.
It was a case where there were no slick marketing campaigns. In 2001, I started working on it as a way to tie the browsers to the server. At the time, everyone thought XML had to be used or theyâ€™d say â€œthatâ€™s a great idea but JSON isnâ€™t a standardâ€. So, I bought json.org, made a logo, threw up a Web page and it sat out on the Web for three years.
In the meantime, AJAX happened and when it became the way for writing applications JSON was there. There was counter promotion from the XML community, of course.
But when I arrived at Yahoo! some kids at the company started thinking it was okay to start shipping JSON APIâ€™s through Web services. And developers found the apps got faster and were easier to write.
It sort of took off from thereâ€”no slick campaigns. So a good idea based on simplicity won out for once.
Learn About The JSON Saga
In this video, Doug tells the interesting tale of how JSON was discovered, and sheds some light on how it became a major standard for describing data in an interesting turn of events.