I've actually been wondering about this for a while, but a back'n'forth between
merlyn and myself in regards to
Using formats for 2-columnprinting made me want to pursue this.
Before I post any code, I test it. I do this for two reasons, the primary one being that I am not so good that I can just "wing it". Oh, sure, a print statement or something is easy, but for *anything* that involves a regex, I test it. I have to, or I'll look dumber than usual when it doesn't work. The other reason is a matter of personal pride. I like code that works. I'm embarrased when I write code that doesn't, and frankly, I don't like to feel embarrased. Pride in workmanship kinda thing, I guess (It may not be pretty, but by Dog, it WILL work!)
I am not criticizing people that don't test. Mind you, in the
Using formats for 2-columnprinting,
merlyn said from the start that it was untested "except in his head" (and I still want to know what version he's running...). I cut'n'pasted the code mostly because it didn't have a 'use strict'. To be honest, I'm very suspect of code that doesn't, and I like to see if it will actually run or not. In this case, a little back and forth determined that our local wizard had forgotten/didn't know that
@### combined with
~~ wouldn't work together.
Which brings me to my main point. How many of you that post code actually run it (presuming that it's not disclaimered)? How many of you can't resist reformatting someone elses code when you do post it? (Me, I hate opening braces on the same line as a statement. It's gotta come underneath the verb). I also put a space between a function and it's paranthesis, but no space between the paran, and it's argument.
Looking back through a few posts where I've posted code, I see that I almost always "touch" it to make it more readable, as I define readable. I see a few other people that do that, also. I find this rather amusing, in some ways, like we either are so abhorred by the way it looks we must change it, or we have to "brand" it with our style.
What are your opinions? What do you do? And how many of you try out the code that people post here, whether it's full blown applications, or two line fragments?
--Chris
e-mail jcwren
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.