Re: newbies, <code> tags and recognizing perl
by BrowserUk (Patriarch) on Mar 21, 2008 at 03:32 UTC
|
Personally, I think a simple approach of presenting the textarea with a couple of the common tags already in it would guide most new users into doing the right thing. Eg:
Your text:
+-----------------------------------------+
|<p>Your question here</p> |
| |
|<code> |
|#Perl code goes here |
|</code> |
| |
| |
| |
+-----------------------------------------+
[preview]
But then I always favour simple solutions.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
|
|
I agree w/ BrowserUK; the "snippets" section is almost like this. Even better would be to just include text that you might actually want to erase (and, hence, pay attention to) in the create box, eg:
Use this space to ask your question. You can delete this text.
Place actual perl code inside the <code> tags below.
<code>
CODE GOES HERE
</code>
See below for more formatting tips.
I think almost anyone asking a legitimate question will be able to deal with this PLUS:
it's PROACTIVE!
it's easier. | [reply] |
|
|
Did you really intend your post to be such a mixture of unclosed tags, mixed font-weight and -style, etc? And if so, please clarify how is it supposed to differ from BrowserUk's above.
Whether or not the appearance of your post reflects inadequate previewing or not, it's quite plausible (to me, anyway) that many posters eliminate the "Preview" button when creating a node, or treat it as so many treat an "accept this license" box during software installs; that is, as something to click through as quickly (and carelessly) as possible.
Sorry if this sounds snarky (and I'm not trying to suggest that you're among those who simply haven't read the docs), but many of the formatting problems here are created by those who haven't understood them.
We can't cure the former, except by gentle guidance and by making the markup docs easier to follow, which might also automagically address the latter.
Puff: Please see Markup in the Monastery for one attempt at enhancing the guidance.
| [reply] |
|
|
|
|
|
|
| [reply] |
|
|
I'm undecided as to whether or not this is a good idea, but it is certainly the best way to increase the number of new monks that use code tags. Messages will not work, task-driven people generally ignore text that isn't needed for completing their task (even if you make it giant and blinking!).
The only way to stop a user is to force them into a decision, like this solution which makes them remove default values.
| [reply] |
|
|
It is a good suggestion, but I can't help thinking that we'd see a sudden rash of
Help! My code doesn't work! Please tell me how to fix it even though my extended rambling insistence that it doesn't work never once specifies (or even alludes to) what I'm trying to accomplish or the way in which it doesn't work, much less provides any code or other hints for reproducing my results. How do I fix it?
Your question here
#Perl code goes here
I'm not quite sure whether I think that would be an improvement or not. | [reply] [d/l] |
|
|
|
|
|
|
| [reply] [d/l] [select] |
Re: newbies, <code> tags and recognizing perl
by Roy Johnson (Monsignor) on Mar 20, 2008 at 17:09 UTC
|
I made a similar suggestion almost exactly three years ago. You can see the discussion there.
I wonder whether having the submission box pre-loaded with an empty code tag pair would be the suggestion some people need? It would be simpler than parsing their post, and it's an option that could be turned off in user prefs.
Caution: Contents may have been coded under pressure.
| [reply] |
|
|
| [reply] |
Re: newbies, <code> tags and recognizing perl
by CountZero (Bishop) on Mar 20, 2008 at 23:13 UTC
|
++ for thinking about ways to improve our Monastery!As our Monastery-site has always been on the limit of what is still considered acceptable responsiveness, adding such a check will be quite a heavy burden on the servers, I think. Still, from a theoretical point of view, a module such as Algorithm::NaiveBayes could form its basis. Feeding it a significant number of nodes, both with and without code tags will quickly make it distinguish between nodes containing Perl-code and those without. I recently used it to categorize database-records and had a successrate of about 85%. It could easily have been higher but the field which was the basis of the categorization was at the most 70 characters long, contained many "stopwords" and I had 6 categories to choose from.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] |
|
|
Might detecting the presence of ^\s*my\s+\$.+; without <code> having been encountered first be enough to send up a flare?
| [reply] |
|
|
Could be, but if the newbie does not use strict; he is unlikely to have lexical variables and your regex will not trigger.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [d/l] |
Re: newbies, <code> tags and recognizing perl
by GrandFather (Saint) on Mar 21, 2008 at 02:35 UTC
|
| [reply] |
Re: newbies, <code> tags and recognizing perl
by Anonymous Monk on Mar 21, 2008 at 12:03 UTC
|
Isn't there a module for this?
I want a cheese sandwich.
Output:
<code>
| [reply] |