Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Code Tags

by Ovid (Cardinal)
on May 24, 2001 at 21:26 UTC ( [id://83010]=monkdiscuss: print w/replies, xml ) Need Help??

Recently, I was checking nodes requiring editing (you won't see them unless you're an editor) and noticed that there were some requests to edit nodes by a particular user who always wraps the entire text in <CODE> tags. Often, this user makes good posts and one might wish to download the code, but this is hampered by a lot of extraneous comments in the code tags.

Before I realized that this user posts everything in code tags, I edited one post and sent a /msg to the user. Once I realized what was going on, I stopped and asked the other editors what they thought and was asked to open this to general discussion. We don't want to simply go around and change every little thing we don't like or everything that we're asked to edit, but some may feel that this is a reasonable thing to edit.

Should we edit posts with the entire post wrapped in code tags? (unless the post consists solely of code)

Here are the reasons why there was even a concern with code tags:

  • Smaller, fixed width font can be aesthetically unappealing.
  • Can be harder to read.
  • Doesn't line wrap nicely.
  • Interferes with downloading code.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: Code Tags
by footpad (Abbot) on May 24, 2001 at 21:55 UTC

    I think so. I've noticed that the Monk In Question (MIQ) has had several nodes considered and have also noticed that the general opinion concerning these edits is that they should be done. Consequently, the tireless have been editing things accordingly, which (to my aging eyes) make them far easier to read.

    Personally, I'm grateful for that. Ideally, MIQ would adjust his (assumption) posting style accordingly. Until that happens, however, I ask that those nodes be subjected to Node::Pretty.

    Mind you, I'm aware of the ethical concerns concerning style. However, I would hope that we would be willing to make common-sense adjustments to a node. For example:

    • Changing titles as appropriate
    • Fixing minor typographic errors
    • Adjusting egregious coding problems upon request [*]
    • Hiding/Removing inappropriate code.

    [*] (By request, I mean the standard venues, e.g. consideration, CB message, private /msg, and so on.)

    Perhaps some of the work involved can be avoided simply by asking the poster to edit their own posts with a private /msg. While this would only work for editable nodes, it at least saves the tireless a little bit of effort. If the poster refuses and the community feels strongly, then I see no problem with the janitors cleaning up as needed.

    I do agree that this needs to be done with a light touch, when possible. We are, after all, PerlMonks, not copy-editors. (Well, most of us, anyway.)

    --f

      I, for one, refuse to spend my time constantly editing a single (possibly stubborn) person's nodes. I also don't like the moral implications of such work.

      If you don't like the MIQ's chosen style, then please /msg them and ask them to change it (or vote such nodes down, etc.). Note that there is nothing stopping the MIQ from re-editing said nodes to restore the original "style".

      I also refuse to correct typographical or coding errors unless requested by the author.

      I think the janitors are here to clean up messes, not to pollish things!

              - tye (but my friends call me "Tye")
Re: Code Tags
by tachyon (Chancellor) on May 25, 2001 at 04:53 UTC
    # Mea Culpa

    Whoops!

    Sorry to have caused problem, I have finally worked out what those little checkboxes under the chatterbox are :p


    I got into the habit of just slapping the whole post between <code> tags as it was quick and easy, and if you use comments (for your comments) on code you can just stay in the editor to test them, cut and paste betweeen the code tags and you are done. I hate hand coding HTML, thus the thoroughly lazy approach.

    I have just written a little script to let me still do that but format nicely for posting that I'll use from now on. If it is suggested to be a good idea I will use it to fix the most recent nodes as well.

    Learning a little more every day

    tachyon

      Thanks for the response, tachyon! Proof positive that the best solution still is to openly discuss things :-)

      I have just written a little script to let me still do that but format nicely for posting that I'll use from now on.
      That sounds like something that could be useful. Maybe you could post it in the Code Catacombs or Snippets?

      --ZZamboni

Re: Code Tags
by azatoth (Curate) on May 24, 2001 at 21:49 UTC
    The only issue I have with this is thus :

    The user in question uses code tags all over the show because he/she likes the way it makes his/her posts look.

    By enforcing a standard / constantly changing content via the janitors, we start treading on the grounds of censorship. And tread carefully we must, as people as a rule don't like to see their voice censored / chopped and changed to suit the masses.

    I know I haven't been much help here, but I wanted to make that point - the code tags are there because the user has chosen it.

    I don't know if anyone should have the power to change that.

    Azatoth a.k.a Captain Whiplash

    Make Your Die Messages Full of Wisdom!
    Get YOUR PerlMonks Stagename here!
    Want to speak like a Londoner?
      Censorship might be pushing it a bit...unless text disappears from posts for no reason, this is mearly trying to maintain readability.

      However, the point that wrapping the entire bit of text in CODE instead of just the necessary parts is important, as the former case will make downloading the code that much harder. If the person feels that their post 'looks better' in fixed-width fonts, then they should be using PRE and TT tags for non-code parts, and CODE for code. They'll get just the same effect as if they used code, and and code they do have will be downloadable without extra luggage.

      In the case for the editors, I think it's important that the introductary documentation that everyone is supposed to have read before posting (ha ha!) include the fact that posts might be edited, not for content (except in extreme cases), but for readibility if the CODE tag is misused.


      Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
      Now I'm wondering what would be done if a user started posting everything inside <H1> tags, because he/she likes the way it makes his/her posts look...

      My opinion is that PerlMonks provides the CODE tags feature for a specific purpose, namely to protect code blocks from HTML rendering and to provide a convenient way to download them. Using a CODE block around one's entire node goes against this purpose, without providing any benefit to the community.

      Additionally, I feel that "censorship" is a serious word that is frequently used too lightly. I fail to see how a trivial change made to the formatting of a node to improve readibility could possibly be construed as censorship.

        The first couple of times, I'd edit them and notify the author. If the problem persisted, I'd consider the author anti social and downvote (some) new nodes and request reaping of any that overly disrupted otherwise useful threads. If the author managed to make enough of a nuisance of him/herself, then the author would probably eventually find that s/he had "fogotten" his/her password.

        I would not continue to edit (at least the majority of) them!

        Are all-code posts that big of a problem? I think it ranks more closely to that of individual monks who persistantly post incorrect answers, use poor grammar, don't break their text into paragraphs, use <a href="http://www.perlmonks.nog/..."> instead of [...], etc. Sure these are all annoying, but I don't think any of them fall into the category of "let the editors fix them forever". (Yes, I know and accept that I will be fixing these types of problems "forever", but I refuse to keep fixing them for the same person over and over again and, if the person refuses to modify their behavior, then I think other editors should likewise not use their special powers futher.)

                - tye (but my friends call me "Tye")
Re: Code Tags
by myocom (Deacon) on May 24, 2001 at 22:10 UTC

    It seems to me that the stuff inside code tags should be code (or at least code-like). I think the nodes should be edited (preferably by the author, but by the editors if need be).

    As Ovid points out, the code tags have more behind them than just changing the font. Putting the entire message in code tags does interfere with the "Download Code" link (not to mention it's hard on my eyes).

    Frankly, if I have to edit too much out of the code I download, I'm going to be far less likely to want to help the person who put the extra cruft there, when s/he could simply have put their question text *outside* the code tags in the first place..

      It seems to me that the stuff inside code tags should be code (or at least code-like).

      Just a minor clarification. Please don't use <pre> unless the lines are quite short (max line length of 60 characters should be safe). If you have something that you don't feel is "code-like" but that you don't want line wrapped/justified, you should probably still use <code> tags much of the time.

      This has the disadvantage of causing the text to be included when "download code" is selected, but the other problem of having a node that is way, way too wide is much worse.

              - tye (but my friends call me "Tye")
Re: Code Tags
by yakko (Friar) on May 24, 2001 at 23:09 UTC
    There are ways on the user's end to combat some of these: for font issues, adjust them in your browser and don't let web pages change them. Turn on "Large CODE fonts" in your user settings on PM.

    For the "d/l code" option, however, any extraneous stuff in <code> tags without providing for it (ie, use "__END__" on the real code to ease things) is a real problem.

    Personally, I find that both serif fonts and proportional fonts make it unappealing to my eyes to read the text. Of course, "Courier New," as a fixed serif font, is rather ugly on the eyes, especially when small. So, I ditch Courier in favour of Andale Mono or Lucida Typewriter for fixed fonts, and Lucida Sans for proportional fonts. Much easier to read.

    Closer to the subject at hand, I feel that editing nodes that use the code tags in violation of their spirit is justified, though I would hope that the person doing the editing is the author.

    --
    Me spell chucker work grate. Knead grandma chicken.

Re: Code Tags
by Beatnik (Parson) on May 24, 2001 at 22:34 UTC
    I confess... I too have considered nodes from MIQ and /msg'ed him occasionally on the topic. His posts are indeed quite good, but always consider text as code. His code seems to be at the very bottom, which indicates to me he's putting it there for some odd reason. I don't know weither to guide him thru the entire thing (altho he doesn't reply msg's) or to club him on the head til he wakes up :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://83010]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found