Want a free year on Tuts+ (worth $180)? Start an InMotion Hosting plan for $3.49/mo.
If you've ever been to a code-focused conference before, you can surely attest to the fact that the number of live-coding talks is incredibly low. The reason why is obvious: they're super, super hard! Imagine coding on stage in front of hundreds of people, when, all of the sudden, something goes wrong, and your code breaks! In real life, a few minutes of debugging is a non-issue. On stage, even a single moment of silence is a speaker's nightmare.
So, should we never attempt such talks? Absolutely not! You simply have to prepare in the right ways. I'll provide a few tips in this article.
What's Live Coding? This refers to a style of presentation, where the speaker limits the number of his or her slides, in favor of writing the examples or demos in real-time. It's an incredibly dangerous style of talk, yet can offer significant benefits for the audience.
Tip 1 - Make a Decision
If you're the nervous type, this may not be a good choice.
Certainly, when preparing a new talk, the most important question to ask yourself is if there's any value in doing a live-coding presentation. For example, if you're merely providing a variety of examples, do you truly need to code those in real-time? Would a well-presented slide not work just as well, while relieving you of some stress, and the potential for breakage?
You might consider taking the live-coding route in the following instances:
- Your code samples require context to be as effective as possible.
- You're hoping to present your topic in a workshop style.
- Your talk focuses on workflow, in which case a slide-based layout isn't optimal.
- You enjoy living on the edge.
Personally, I'd urge you to reach for the slides, unless you can provide a good enough argument as to why they won't be as effective. Live-coding requires a significant amount of preparation, as well as backup plans, to counter any potential roadblocks that may arise as you code. Keep that in mind. If you're the nervous type, this may not be a good choice.
Tip 2 - Practice, Practice, Practice
Practice. Practice. And, when you're done, practice some more.
Clearly, every talk should be rehearsed at least once or twice before being given in front of a live audience. However, if you intend to code in real-time, as a basic rule of thumb, triple the number of rehearsals. Code your way through the talk once, and then repeat the process; the more repetitions, the better!
When speaking on stage, you should fully expect to blank at least a few times.
- What was I supposed to say next?
- Is it time to switch slides yet?
- I have no idea what I'm doing up here!
These insecurities exist in all speakers. The easiest way to prevent as many errors as possible is to know the subject matter (and how you will present it) as well as humanly possible. Practice. Practice. And, when you're done, practice some more.
Tip 3 - Create a Backup Plan
Your first step should be to expect the worst.
So you've decided to push forward with a live workshop-style presentation. Good for you! Your first step should be to expect the worst. Ask yourself, "What happens if I completely crash and burn? What if my mind blanks?"
I always save a copy of the finished project ahead of my talk. That way, should the stage drop out from under me, so to speak, I can always make a casual, self-deprecating joke, noting how I'm clearly not talented enough to execute this style of talk. Then, I can quickly switch over to the finished code, and do my best to continue on from there.
Tip 4 - Snippets Are Your Friend
I religiously use a Mac app, called Dash.
Additionally, consider creating a variety of smaller snippets, which can represent everything from a single function, to a bit of HTML, to a CSS ruleset. Doing so can serve a few different purposes:
- Don't make the audience watch you type a particularly intricate piece of code.
- If you're moving along in your talk quite nicely, but happen to forget a line or two, it only takes a second to replace the last two lines you wrote with the finished snippet. This way, you can prevent a potentially embarrassing moment on stage, without the audience realizing.
- The simple fact that you have a variety of backup snippets for your code can help provide a great deal of confidence.
Tip 5 - Plan Your Content Well
Think of every line as mental debt.
Remember: live coding is not an excuse to demonstrate how smart you are, or how quickly you can maneuver around your code editor. The end goal is, of course, to teach the audience something that they didn't know before you stepped on stage. With that in mind, do your best to structure the code that you write in a way that doesn't overwhelm the audience. Admittedly, this requires a bit of tinkering to achieve the perfect balance.
As a guideline, always opt for the simplest route through your code. If a piece of logic is not vital to what you're attempting to pass on to the audience, then cut it out (perhaps with a quick warning that, in a real world project, you'd likely add a bit more here and there).
Do your best to be incredibly sensitive to each line that you write over the course of your presentation. Think of every added line as mental debt. The audience is a sponge; eventually, they've soaked up all that they're capable of in one forty-five minute sitting. Keep it simple.
Tip 6 - Shake it Out
Speaking on stage is a scary experience. Coding on stage is even worse!
There's no two ways about it: speaking on stage is a scary experience. Coding on stage is even worse! If you're the nervous type, find some way to remove excess energy an hour before you go on stage. The less built-up energy you have when speaking, the less likely that your hands will shake uncontrollably. Here's a few tips:
- No caffeine twenty-four hours before your talk.
- During the talk that comes before yours, excuse yourself to the restroom. Shake your hands back and forth rapidly, and run in place.
- Make the bathroom faucet as hot as possible, and stick your hands under the water for five seconds. Repeat this process several times to loosen your fingers. This is particularly helpful in cold climates.
Tip 7 - Don't Forget to Talk
Avoid the tendency to type away silently on stage.
As developers, we spend the majority of our work days in silence, coding away. But, an interesting transition will take place, if you choose to try your hand at a live coding presentation: not only will you be coding, but you'll also be talking your way through the process, verbally illustrating each line of code.
Don't forget to keep talking! Avoid the tendency to type silently on stage. This is a one-way to ticket to a bad review. The key is to rephrase every single line of code in a manner that everyone in the audience can understand, regardless of their skill level.
Tip 8 - Cross Your Fingers
Sometimes, it all comes down to a bit of luck.
Look: there's a reason why developers widely consider a live-coding presentation to be incredibly dangerous, and rarely successful. If not prepared for adequately enough, as soon as things go wrong (and they will), the audience will cringe, as they watch you silently, but desperately attempt to correct your mistake.
Sometimes, though, it all comes down to a bit of luck. Prepare like crazy, cross your fingers, and hope for the best. If you're successful, you just might show the audience something that they rarely (if ever) get to see at a conference. Good luck!