Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Best of Cozzi: Find and Replace

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Best of Cozzi: Find and Replace

    ** This thread discusses the article: Best of Cozzi: Find and Replace **
    heck, we may have been sniffing around the same battlefield. Hoo-Ah, bubba!

    Comment


    • #17
      Best of Cozzi: Find and Replace

      ** This thread discusses the article: Best of Cozzi: Find and Replace **
      Sarge: Here's what I think is wrong with Bob's article: He shows us 4 lines of code and claims he can do better with a procedure call. Sure, that 1 procedure call may be slightly easier to code, but the performance of that procedure sucks, and that puts it mildly. See that 32000A VARYING return value? Even if you're dealing with relatively short values, you're still copying 32000 bytes of data on each procedure return. (And that's not even getting into all the other extra overhead within the procedure). Not only that, but look at the comment for parameter "bOptions". According to the comment, value "FR_WORD" is not yet implemented. Actually, that comment doesn't even match what's written in the text of the article! In other words, is Bob really doing anyone any favors by posting this code?

      Comment


      • #18
        Best of Cozzi: Find and Replace

        ** This thread discusses the article: Best of Cozzi: Find and Replace **
        In case anyone cares, freeform was not added to make code more readable. For all us old-timers, readability comes with formatted code. If you like freeform so much, why not us it when writing reports at work After all, there's noreason 2 follownormalwriting standards of indentingthe firstline ofa paragraph orusing punctuationorleaving wordswithspaces between them. Itcanstillbereadevenifyouviolatethe normalstandardsandyoucouldsavepaperinfreeform

        Comment


        • #19
          Best of Cozzi: Find and Replace

          ** This thread discusses the article: Best of Cozzi: Find and Replace **
          hi hans: i'm not defending bob's code. i would have done many things different, including writing in /free. of course the "backward compatible" code is nice for those who cannot use /free in their shop. my point was directed to the vehemence of the attack by bubba against bob, or anybody for that matter. -sarge

          Comment


          • #20
            Best of Cozzi: Find and Replace

            ** This thread discusses the article: Best of Cozzi: Find and Replace **
            nakeddave wrote: > In case anyone cares, freeform was not added to make code more > readable. For all us old-timers, readability comes with formatted > code. > > If you like freeform so much, why not us it when writing reports at > work After all, there's noreason 2 follownormalwriting standards of > indentingthe firstline ofa paragraph orusing punctuationorleaving > wordswithspaces between them. Itcanstillbereadevenifyouviolatethe > normalstandardsandyoucouldsavepaperinfreeform "Free form" doesn't mean "not formatted". It means formatted in a way that makes it most readable. You say that indenting the first line of a paragraph is a normal writing standard. That is free-form writing, being able to indent the first line of a paragraph; fixed-form writing would not allow you to do any indentation at all.* Similarly, following normal coding standards requires indenting the code to reflect the structure of the code; for example the code conditioned by an IF operation should be indented. Free-form allows such indentation; fixed-form does not. The "ICanDoThatInOneLine" abominations that you sometimes see are not caused by writing in free-form; they are equally possible in fixed form. Free-form doesn't mean saving space; formatting code in the most readable way sometimes requires more lines, not fewer. It's possible to code fixed-form RPG in an elegant way. For example, I have seen beautiful fixed-form RPG code written by Scott Klement. But Scott's free-form code is even more beautiful. I have also seen terrible free-form code. But I suspect that the fixed-form code written by those programmers would be even more awful to read. * I see by your writing that you don't always follow the indent-first-sentence standard. Neither do I; I prefer using blank lines to separate my paragraphs. Luckily we aren't using a fixed-form word processor. Snicker.

            Comment


            • #21
              Best of Cozzi: Find and Replace

              ** This thread discusses the article: Best of Cozzi: Find and Replace **
              It's possible to code fixed-form RPG in an elegant way. For example, I have seen beautiful fixed-form RPG code written by Scott Klement. But Scott's free-form code is even more beautiful. While I have some reservations about using the word "beautiful" for any programming language, I agree that Scott's work is quite elegant. But more than that, it's pragmatic; his conventions make you more productive as a programmer. For example, I refer to the following technique as "KlementParms": myProc(Parm1: Parm2); Note the space between the colon and the following parameter. This allows the RPG editor in WDSC (whose cursor positioning algorithms are still a little immature) to properly "tab" between parameters using the shift-arrow. I modify it a little bit by preceding the first parameter with a space as well, but the idea came from copying^h^h^h^h^h^h^h studying some of Scott's work. This is the modified version: myProc( Parm1: Parm2); Joe

              Comment

              Working...
              X