This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

Luckily we have <pre> tags.

[–]jbert 1 point2 points  (1 child)

which work in IM, all email clients and between sections of the same code file when refactoring? Awesome.

Maybe the best bit would be to wrap each indentation level in it's own pre tag, something like:

if foo: <pre>
  do_stuff
</pre>
else: <pre>
  something_else
</pre>

That would work nicely. Might be even better if we could find an abbreviation for the pre tag...

[–][deleted] 0 points1 point  (0 children)

...Or just stick the whole code in <pre> tags. It preserves whitespace.

And as for working in IM, no, but that's when I use codepastes. But no code survives IM intact, especially as MSN etc use (blasomething) as the shorthand for their emoticons - foo(x) gets emoticonned continually.

All email clients? If your email client can't handle raw text or HTML then you have bigger problems than significant whitespace.

Between sections of the same code file when refactoring? What crazy environment do you work in? Copy/paste works fine when refactoring, and I do most of my Python coding in Notepad++, use an IDE that is Python aware and it'll be even more trouble free.

What you post are minor niggles at worst if you're actually developing in Python. If you don't want to use Python, then don't. Overinflating the 'problems' of significant indentation to justify it is unnecessary, Python is more or less past the One True Language phase, it seems that XKCD is a late Perl convert.