I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I've pondered this myself. I use it in embedded scripts-that-aren't exactly scripts. Stuff where I'm giving an example of what something will do when run.
For example, in a recent post I had something like this:
$ pwd
/home/moopet
$ echo$$
8192
I don't want to have to explain what I'm doing every time, and $ is a kinda convention, but I'm also slightly concerned that it might confuse people who haven't seen it before.
As far as presenting literal lines as a series of instructions, I think we should leave it out. Not so that people can copy-paste the whole script, though! We should encourage people to try one line at a time, because these little formulae, even with the best intention, will explode your machine one day from a casual assumtpion:
cd /tmp/foo
rm -rf *
In the real world, we'd want to at least separate those commands with && or something, in case /tmp/foo doesn't exist.
So I think any argument for copying snippets small enough for tweets is probably invalid.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I've pondered this myself. I use it in embedded scripts-that-aren't exactly scripts. Stuff where I'm giving an example of what something will do when run.
For example, in a recent post I had something like this:
I don't want to have to explain what I'm doing every time, and $ is a kinda convention, but I'm also slightly concerned that it might confuse people who haven't seen it before.
As far as presenting literal lines as a series of instructions, I think we should leave it out. Not so that people can copy-paste the whole script, though! We should encourage people to try one line at a time, because these little formulae, even with the best intention, will explode your machine one day from a casual assumtpion:
In the real world, we'd want to at least separate those commands with
&&
or something, in case/tmp/foo
doesn't exist.So I think any argument for copying snippets small enough for tweets is probably invalid.