I think in a way most of us are more or less guessing at the code we're writing, until we actually test it. But as a beginner who's only recently started to "speak" Perl, I usually trying to find a way to do what I want, and then look it up in a book to find out the exact syntax, usage, etc. That of course means that whenever I'm coding I have at least two books, and often enough the Perl CD Bookshelf, lying around - or falling to the floor, for that matter.

After some time, the things I have to do again all the time, and of course the basic stuff, just flow freely, but as soon as I want to do something new, I go and look it up - trying to keep it in mind for the next time, of course. And often the most useful resource, is PerlMonks. Although the books tell me how to do things, here I find more specific examples and sometimes even the exact solution I need to my problem, because someone has had it before, posted it in the Seekers of Perl Wisdom and got a helpful answer.

Something else that I find helpful, and in fact do all the time, is going back to my "old" code and see whether I've had the problem somewhere before, and if possible, just copy the code and adapt it.

But then, looking things up doesn't mean the code then actually works. Sometimes I have a problem which I think I know in what direction the solution has to go, and look that up. But then I realise that in fact, while this particular solution would work for another problem, I didn't assess the problem correctly and hence chose the wrong solution. Erm... Am I making sense here?

Anyway, I think looking things up doesn't hurt my pride. Point one, I am a beginner, after all, and point two, even if I weren't, there's always something that I haven't done before and hence haven't got a clue about. Just like you cannot speak a language perfectly, because a) you always make mistakes even in your first language, or neologise, or b) you may speak a dialect, or c), and this is the point, you don't know any kind of jargon which is not from your own field of work. Similarly, if I'd be working on a linux machine, I wouldn't have a clue, and wouldn't concern myself with, any Win32-stuff. (I wish...) Even if you know Perl, you don't know all of it.

--cs


In reply to Re: Never guess at code! by schumi
in thread Never guess at code! by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.