Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34973

Re: So I did "FizzBuzz", in Java!

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: So I did "FizzBuzz", in Java!
Date Tue, 19 Jul 2016 08:13:58 -0400
Organization A noiseless patient Spider
Lines 26
Message-ID <nml5ih$l1b$1@dont-email.me> (permalink)
References <FizzBuzz-20160717163715@ram.dialup.fu-berlin.de> <nmj00i$jae$1@dont-email.me> <1933e39b-6363-4174-8392-602415a61799@googlegroups.com> <nmj61j$95o$1@dont-email.me> <cc1c596f-a043-4ba7-9e55-b98fc12cc89c@googlegroups.com> <nmjhqe$jj6$1@dont-email.me> <d30c2b2f-0471-4231-9867-19126e5edc13@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 19 Jul 2016 12:14:09 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="2d081e2f7155c28005d4472f67c2f43d"; logging-data="21547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IMUKvF1+8T6YYHOsINHKY"
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
In-Reply-To <d30c2b2f-0471-4231-9867-19126e5edc13@googlegroups.com>
Cancel-Lock sha1:1urm5Rt6tsptdxDIPiFNDH4T+64=
Xref csiph.com comp.lang.java.programmer:34973

Show key headers only | View raw


On 7/19/2016 8:06 AM, Eric Douglas wrote:
> On Monday, July 18, 2016 at 5:31:03 PM UTC-4, Eric Sosman wrote:
>>      - Finally, observe that by transforming a correct program from
>>        IntStream to `for' loop you produced an *incorrect* program!
>>        Faster, yes (even without measurement I'm confident of that),
>>        but incorrect nonetheless.  What price "efficiency," hmm?
>
> Who me bad code?  I just tested the code I modified and it runs fine.  It's just missing the print requirement.

     BINGO!

     Now: If you have a program X that produces correct output, and a
program Y that produces no output, you will notice the defect in Y
the first time you run it.  You will then modify Y to produce Z, which
runs and produces the correct output.

     Question: How fast must Z be to ensure that the combined running
time of Y plus Z is less than that of X?

     ... and that's what I mean about the "price" of efficiency.  The
single unproductive run of Y has already dissipated more time than
the X minus Z speedup can recoup.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: So I did "FizzBuzz", in Java! Daniel Pitts <usenet@coloraura.com> - 2016-07-18 09:26 -0700
  Re: So I did "FizzBuzz", in Java! Eric Douglas <e.d.programmer@gmail.com> - 2016-07-18 10:10 -0700
    Re: So I did "FizzBuzz", in Java! Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-18 14:09 -0400
      Re: So I did "FizzBuzz", in Java! Eric Douglas <e.d.programmer@gmail.com> - 2016-07-18 14:00 -0700
        Re: So I did "FizzBuzz", in Java! Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-18 17:30 -0400
          Re: So I did "FizzBuzz", in Java! Eric Douglas <e.d.programmer@gmail.com> - 2016-07-19 05:06 -0700
            Re: So I did "FizzBuzz", in Java! Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-19 08:13 -0400
              Re: So I did "FizzBuzz", in Java! Eric Douglas <e.d.programmer@gmail.com> - 2016-07-19 05:18 -0700
        Re: So I did "FizzBuzz", in Java! Martin Gregorie <martin@address-in-sig.invalid> - 2016-07-18 21:59 +0000
        Re: So I did "FizzBuzz", in Java! Arne Vajhøj <arne@vajhoej.dk> - 2016-07-18 19:51 -0400
  Re: So I did "FizzBuzz", in Java! Arne Vajhøj <arne@vajhoej.dk> - 2016-07-18 19:46 -0400

csiph-web