Best practices for talking code on this platform? /

in #steemit7 years ago (edited)

I'm quite afraid I'll write a bunch of articles on steemit and later discover I'd rather go back and edit every single one, just because I couldn't see there's a better practice to do things on this platform.

So with this post I would like to create a list of do's and don'ts when presenting code on steemit.

I started a youtube series involving programming but I realize the youtube platform forces me to link the people I work with to something like github, which in turn has no way of explaining things except for whole readme files. 

On steem, for one, I know of <code>code</code> text and I now read about the triple ` for code alla 

  ```main = putStrLn "Hello, steemit!"```

although there may or may not be an html issue for me here? Furthermore, do you guys switch between "modes" when editing. Do you write it beforehand and copypaste it here? In markup? Do you use html breaks or &nbsp? Beyond that, what would you guys say how to structure articles and what lengths are appropriate until you cut to the next post. I've seen some very long posts that don't make for attractive articles either. And do I remove all comments in code and write it as inline text between comments? I could go on.

I'm thankful for your input!

Sort:  

disclaimer : I haven't displayed any coding on a steemit yet.

But if I were you I would try things with the html/css in markdown in order to get a nice box where you can input code.

or post images of the code being pretty and colorfull with links and a link on the image leading to the github page.

Aha, thanks for the reply, howo. I didn't know you could use css on steemit? I've seen images with code here, but I think not being able to copypaste peoples code would be a strong drawback, even more than missing syntax highlighting.

Here's the way I usually write posts containing code snippets. It's never good practice to insert images with code as visually impaired readers may have a hard time reading it. The triple backtick markdown syntax works for me just fine. One other way is to embed GitHub gists. That way you get syntax highlighting.

Aha, so there's editor extensions for steemit too? I'll check that out, thanks!

What I do is pictures of my editor showing code for large chunks, for one liners I use the > at the start of a line to show it as a block

like this block

Also I think ´´´ syntax is a github specific thing.

Hi again, iobates. I played around a bit and maybe writing html in an editor isn't that bad.
Pretty sure there's ``code block syntax for several lines, I'll just have to do it right.
I haven't used the > lines yet, thanks for the suggestion!

https://guides.github.com/features/mastering-markdown/
note the section on github flavored markdown, ´´´ is specific to github.

Hey again. Maybe that's the origin! But there's `` blocks here too, check this out:

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.027
BTC 59476.67
ETH 2299.07
USDT 1.00
SBD 2.48