3 ms·
Begin lines with spaces to indicate code: def luyt(): return "Hello, Luyt" if main: print luyt() Easy does it ;-)
by Luyt 13y ago
Begin lines with spaces to indicate code:
def luyt():
return "Hello, Luyt"
if main:
print luyt()
Easy does it ;-)
- film42 13y agoIt's not seperated from the text at all. I feel that if it looked nicer (like GitHub in that they seperate it out) would be more pleasant to share and review code. Maybe I'm just asking for too much, tho.
- declandewet 13y agoRemember that any websites styles are easily overwritten with a browser extension, GreaseMonkey/TamperMonkey user script or Stylish stylesheet, and the chances of someone already having written one are fairly good. If not, create your own. :)
- film42 13y agoNot a bad idea! I also wish HN was community developed, it would be awesome if I could submit a pull request to add better code blocks in comments.
- Luyt 13y agoPRE-formatted code fragments show up in monospaced font in my browser, which makes it stand out sufficiently against the body text, which is a proportional font.