← Back to context

Comment by holman

6 years ago

> I'm not sure who invented [fenced code blocks], but I definitely know that it is widely used because GitHub Flavored Markdown made it so and I am grateful for that.

I’m pretty sure Vicent Martí (@vmg) was the originator of them. I remember we spent a number of weeks internally at GitHub debating the syntax, since no one really fell in love with any of the proposals for various reasons. Eventually the triple tick won out and that’s worked out fairly well, I think.

Man I hate those ticks. I have no idea what arcane key combination on my keyboard I need to do to get them. Maybe it's easier on a US keyboard.

  • It’s very easy on the US keyboard: the key for ticks is under the escape key, no shift needed, just hit this single key.

    I’m German myself, but I use the US keyboard layout for more than 15 years now, because it is so much easier to type things like this... especially in tech. (And also keys for [, ], { and } are much better placed in the US layout)

    • Dane here. The danish keyboard is arguably retarded, but I've used it my entire life, and on purpose have not tried other layouts, because as soon as I use a computer that isn't my own, I'd revert back to hunt and peck mode. It's the same reason why I never bother changing software defaults, except in rare cases.

  • The single biggest one-time leveling up I did as a programmer, was switching to a US keyboard. All the various symbols are just so much easier to type (except, of course, numbers should probably be shift-typed). You can still use your local keyboard for text...

    • I created my own keyboard. It based on the ISO English keyboard, but when I want to type Hungarian characters I just hit the Caps Lock (or alt if I only need one character), but every other character stays in the same space. I also moved the zero before one because I needed the space for the 9 extra characters.

      Coding on the Hungarian keyboard is a nightmare, I don't know how others can do it.

      1 reply →

    • > numbers should probably be shift-typed

      I tried this for a week several years ago; it was not a success. Aside from all the muscle memory re-learning, I also found that I used the number more often than I had thought.

      What I do these days just make Vim abbreviations; for example 1= becomes !=, ;= becomes :=, etc.

  • I always use triple tilde instead, ie ~~~language code ~~~ is the same as ```language code ``` (at least on github)

    Depending on your keyboard it might be easier to type.

  • I'm not in the US and there's a single key that corresponds to a back-tick. In fact, it hasn't yet been an issue for me on keyboard layouts for four different languages (from three separate language families, no less)!

    Where is your keyboard from?

    • German keyboards have both accent directions as a dead-key. So you have to press press shift+´ then space to get `. And that assumes you can remember which direction markdown wants.

  • Wiki Creole in 2006 standardized many wiki engines on {{{ }}} code blocks. {{{#!python ...}}} for language or other extensions. All of OP's other points were also solved, at least in the most common implementation. Unfortunately people forgot about this IMO huge improvement.

  • My biggest problem with the ticks is that they're dead keys if you want to be able to write accented characters easily. I write à code sample` way too often.

    • You could consider using the compose key instead of dead keys. Diacritic characters take a three-key chord instead of two ([compose ` a] instead of [` a]), but all programming characters type as-is. The right alt is usually chosen as compose key.

  • Very easy on a US keyboard. It's just the top-left key, directly adjacent to '1' and below Escape. No modifiers (shift, whatever) required.