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


Groups > comp.os.linux.advocacy > #465351

Re: The substantiation that -highhorse asked for

From owl <owl@rooftop.invalid>
Newsgroups comp.os.linux.advocacy
Subject Re: The substantiation that -highhorse asked for
Date 2018-08-28 22:26 +0000
Organization O.W.L.
Message-ID <klzb03g0a.gh33@rooftop.invalid> (permalink)
References (7 earlier) <4c5c5818-a2e5-41e9-8d20-42549c3749bc@googlegroups.com> <lug8a003a.giu34@rooftop.invalid> <0037d949-20fa-4136-adbe-21b6b0950508@googlegroups.com> <9b8080qhq.ut@rooftop.invalid> <a8d2260c-e66a-40bf-993c-689fe11ff949@googlegroups.com>

Show all headers | View raw


Steve Carroll <fretwizzer@gmail.com> wrote:
> On Tuesday, August 28, 2018 at 3:43:58 PM UTC-6, owl wrote:
>> Steve Carroll <fretwizzer@gmail.com> wrote:
>> > On Tuesday, August 28, 2018 at 3:17:02 PM UTC-6, owl wrote:
>> >> Steve Carroll <fretwizzer@gmail.com> wrote:
>> >> > On Tuesday, August 28, 2018 at 2:09:26 PM UTC-6, owl wrote:
>> >> >> Steve Carroll <fretwizzer@gmail.com> wrote:
>> >> >> > On Tuesday, August 28, 2018 at 1:14:23 PM UTC-6, owl wrote:
>> >> >> >> DFS <nospam@nospam.com> wrote:
>> >> >> >> > On 8/28/2018 1:21 PM, owl wrote:
>> >> >> >> >> DFS <nospam@nospam.com> wrote:
>> >> >> >> > 
>> >> >> >> >>> https://imgur.com/a/JWTIK
>> >> >> >> >>>
>> >> >> >> >>> Linux makes you stupid.
>> >> >> >> >> 
>> >> >> >> >> Those aren't nested if statements.  They are all at the same level.
>> >> >> >> > 
>> >> >> >> > 
>> >> >> >> > I know.  I didn't say they were nested - I said Feeb tried to remember 
>> >> >> >> > how many levels there were in his junky code.  It's no less crappy just 
>> >> >> >> > because it's one level.
>> >> >> >> 
>> >> >> >> If you're dealing with a bunch of ranges, a long if-else sequence
>> >> >> >> might be the only way.
>> >> >> > 
>> >> >> > Unless I'm not understanding what you mean by 'ranges', I'd tend to 
>> >> >> > think that's a situation that'd lend itself to doing it dynamically. My 
>> >> >> > iterated example above had edges cases, that I would think a range 
>> >> >> > example wouldn't be bothered with.
>> >> >> 
>> >> >> anon@lowtide:~/code/ifs$ ./blah -7
>> >> >> a<0
>> >> >> anon@lowtide:~/code/ifs$ ./blah 0
>> >> >> a==0
>> >> >> anon@lowtide:~/code/ifs$ ./blah 7
>> >> >> a>0 && a<=10
>> >> >> anon@lowtide:~/code/ifs$ ./blah 11
>> >> >> a>10 && a<=100
>> >> >> anon@lowtide:~/code/ifs$ ./blah 13
>> >> >> a>10 && a<=100
>> >> >> anon@lowtide:~/code/ifs$ ./blah 14
>> >> >> fourteen is special!  You get a prize!
>> >> >> anon@lowtide:~/code/ifs$ ./blah 15
>> >> >> a>10 && a<=100
>> >> >> anon@lowtide:~/code/ifs$ ./blah 70
>> >> >> a>10 && a<=100
>> >> >> anon@lowtide:~/code/ifs$ ./blah 700
>> >> >> a>100 && a<=1000
>> >> >> anon@lowtide:~/code/ifs$ ./blah 7000
>> >> >> a>1000 && a<=10000
>> >> >> anon@lowtide:~/code/ifs$ ./blah 70000
>> >> >> a>10000 && a<=100000
>> >> >> anon@lowtide:~/code/ifs$ ./blah 700000
>> >> >> a>100000 && a<=1000000
>> >> >> anon@lowtide:~/code/ifs$ ./blah 7000000
>> >> >> a>1000000
>> >> >> anon@lowtide:~/code/ifs$
>> >> > 
>> >> > For stuff like that you're not really saving a lot but there is repetition.
>> >> > Looks to me like, outside of the first two, it's the same thing, no?
>> >> 
>> >> What do you mean "it's the same thing"? 
>> > 
>> > Seems to be a lot of:
>> > 
>> > ifs$ ./blah xxx 
>> > a > yyy && a <= zzz
>> > 
>> 
>> Yes.  As described above.  You said that is a situation that would
>> lend itself to doing it dynamically.  
> 
> I said that "I'd tend to think" it would, not that it necessarily would,
> and I said it like that because I didn't know.
> 
>> Explain how you would do it 
>> without running the tests.
>> 
>> >> As described, it tests for ranges.
>> >> Here it just prints the tested range, but it could do whatever.  The point
>> >> is, practically any code you write that tested for those ranges would end
>> >> up being similar.  The tests would have to be done.
>> >> 
>> >> > And 
>> >> > what's  so "special" about 14?  
>> >> 
>> >> It's an "edge case."
>> > 
>> > Why? 
>> 
>> It just is.  It doesn't matter why.  You said range tests would not
>> bother with edge cases. 
> 
> LOL! I said "I would think" it "wouldn't be bothered with" with them.
> 

The requirements of the program determine how you have to write it.
If you need to test against ranges, there's not much of an alternative to
coding the tests.  Same with "edge cases."  If you have to handle them,
you need to code a handler.

Back to comp.os.linux.advocacy | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-28 08:28 -0400
  Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 09:20 -0700
    Re: The substantiation that -highhorse asked for fr314159@gmail.com - 2018-08-28 11:27 -0700
      Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 11:39 -0700
      Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-29 09:46 -0400
    Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-28 14:52 -0400
      Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 12:20 -0700
  Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 17:21 +0000
    Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-28 14:46 -0400
      Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 19:14 +0000
        Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 12:30 -0700
          Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 20:09 +0000
            Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 13:58 -0700
              Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 21:16 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 14:31 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 21:43 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 15:06 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 22:26 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-28 15:35 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-28 23:14 +0000
                Re: The substantiation that -highhorse asked for Snit <usenet@gallopinginsanity.com> - 2018-08-28 14:57 -0700
            Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-28 23:11 -0400
              Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-29 06:14 +0000
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-29 09:34 -0400
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-29 14:31 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-29 11:01 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-31 12:33 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-31 09:16 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-31 16:53 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-31 10:22 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-31 17:53 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-08-31 11:36 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 13:45 +0000
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 13:59 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-09-01 08:15 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 16:00 +0000
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-09-01 11:20 -0700
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-31 15:00 -0400
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-31 19:40 +0000
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-09-01 10:15 -0400
                Re: The substantiation that -highhorse asked for Steve Carroll <fretwizzer@gmail.com> - 2018-09-01 08:22 -0700
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 16:28 +0000
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-09-01 16:39 -0400
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 22:00 +0000
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-09-01 18:27 -0400
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 22:40 +0000
                Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-09-01 19:09 -0400
                Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-09-01 23:59 +0000
        Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-28 23:01 -0400
          Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-29 06:26 +0000
  Re: The substantiation that -highhorse asked for "F. Russell" <fr@random.info> - 2018-08-28 19:25 +0000
    Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-29 09:32 -0400
      Re: The substantiation that -highhorse asked for fr314159@gmail.com - 2018-08-29 06:46 -0700
        Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-08-29 09:55 -0400
          Re: The substantiation that -highhorse asked for fr314159@gmail.com - 2018-08-29 08:02 -0700
            Re: The substantiation that -highhorse asked for DFS <nospam@nospam.com> - 2018-09-01 10:14 -0400
          Re: The substantiation that -highhorse asked for owl <owl@rooftop.invalid> - 2018-08-29 15:12 +0000

csiph-web