There are nicer ways to say some of the other things you said.

You're right. But, if you wanted me to say everything nicely, you need to pay me. If you want my advice for free, then take it the way I say it.

I have no idea which code I'm working with. Both versions, however, use a flag to indicate that a valid type has been entered. Both versions don't store how many of that type the block should be. The former is a style mistake and the latter is a programming error.

As for specs ... had you written a spec, you would have realized that you're not storing the 20 of 20KB. You would also have realized that you have no way of parsing "20 KB " or "1.3GB ". Those are serious mistakes that were commented upon by no-one else.

This also ties back in to the tone I used - I found a serious design flaw. You can either complain that I didn't sugar-coat it or you can take it and make your program be the best it can be. I don't expect effusive thanks, but I can and do expect a little humility. You were the one who posted your code asking for constructive criticism, so expect constructive criticism. Don't expect me to hold your hand. (Again, that's what you get when you pay me, not when you get your advice for free.) I tend to follow the merlyn school of thought when it comes to this. :-)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


In reply to Re4: why is this code bad under -w option? by dragonchild
in thread why is this code bad under -w option? by Grygonos

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.