[Tutor] Shortening the code of a finsihed program.

Alan Gauld alan.gauld at btinternet.com
Sat Nov 26 02:57:34 CET 2011


On 26/11/11 00:07, Steven D'Aprano wrote:

>> Its usually better to paste long programs into a pastebin web site and
>> give us a link.
>
> I'd just like to say that some of us disagree with this advice. Some
> people (e.g. me) often read their where getting access to a browser is
> less convenient.

Its true there are downsides to every option.

> Even a 200 line program isn't that big, it's only about 6K.

That adds up if you are reading on a  3G smartphone with a 100M data 
limit or paying by the byte. And attachments don't help there.
Plus many email gateways block all attachments as a security measure.

> is so large that syntax highlighting becomes particularly useful, then
> chances are it's too long and people won't read it regardless.

I find syntax highlighting useful even in very short snippets of code, 
but I agree it's better to just keep the code sample short and post it 
inline.

And I do take the point that pastebins are short lived and so unless the 
replies incorporate the defective code snippets its lost to the archive.

Nonetheless I personally prefer a pastebin posting to a long mail 
listing with no highlighting and often defective indenting. as I say 
there is no perfect solution to long posts other than to shorten them....


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list