← Back to context

Comment by nrhrjrjrjtntbt

12 hours ago

What is the best way to show code?

I really want to show some code. Like 4-5 lines to give a gist.

The advice is:

> 1. do not show a slide full of code.

Not "do not show code". Focused snippets are fine, you just need to distill the code to make sure it's just the essence of what you want to show and that it's easy to read (naming is important).

I ruthlessly make the code examples as simple as possible. Eliminate everything but the point you're trying to make. I'll adjust the font to fill the slide.

  • And it doesn't have to even be code that compiles, unless it's about the language design and it really really matters for that presentation. You can yadda yadda whatever you want. Syntax doesn't exist anymore, just use greyed out "..." for the uninteresting parts.

Just do it. There's nothing wrong with it, if that's the kind of talk you want to give.

Look at stuff by david beazley, matt godbolt or casey muratori. They all have talks which focus on small pieces of code and i'm sure it's a tremendous effort to frame that well enough and pace it appropriately, but it sure works for them (and me watching their talks).