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


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

Re: Ping sbd: another programming challenge for your developmentally challenged children

From deplorable owl <owl@rooftop.invalid>
Newsgroups comp.os.linux.advocacy
Subject Re: Ping sbd: another programming challenge for your developmentally challenged children
Date 2016-10-27 01:21 +0000
Organization O.W.L.
Message-ID <ahjgdki0o03.ae@rooftop.invalid> (permalink)
References (9 earlier) <nup7ef$siq$3@dont-email.me> <ahjdgoe9.faf@rooftop.invalid> <nuqhu5$rrk$1@dont-email.me> <ahjdlbie.ag@rooftop.invalid> <20161027014543.7ec70bfd@maxa-pc.cpe.bvcom.net>

Show all headers | View raw


Melzzzzz <mel@zzzzz.com> wrote:
> On Wed, 26 Oct 2016 20:42:28 +0000 (UTC)
> deplorable owl <owl@rooftop.invalid> wrote:
> 
>> DFS <nospam@dfs.com> wrote:
>> > On 10/26/2016 1:22 AM, deplorable owl wrote:  
>> >> DFS <nospam@dfs.com> wrote:  
>> >>> On 10/22/2016 12:34 PM, deplorable owl wrote:
>> >>>  
>> >>>> I don't like forced indentation.  That's why I don't like
>> >>>> python.  
>> >>>
>> >>>
>> >>> The .py is always right!
>> >>>
>> >>> Consistent indentation improves readability, and as you know code
>> >>> is much more often read than written.
>> >>>
>> >>>
>> >>> Is it actually the forced indenting that bothers you, or the amt
>> >>> of whitespace?
>> >>>  
>> >> 
>> >> No, it's the forced indentation.  I indent my own code most of the
>> >> time  
>> > 
>> > But python forces it, and you're a proud programmer who won't EVER
>> > be told what to do!
>> > 
>> >   
>> >> unless it's really short, but even then while debugging I'll often
>> >> drop in test code left-flushed so that it stands out from the rest.
>> >> I don't need some nanny making me pretty up my code a certain way.
>> >> Why does the freaking source need to have a "look" to it?  If it
>> >> looks bad, reformat before you start to read it.  
>> > 
>> > Appearance isn't why indentation is required.  You can indent 1
>> > space if you want.
>> >   
>> 
>> One space or a hundred, it's still all about appearance.
>> 
>> 
>> > 
>> >   
>> >>> You can reduce the whitespace somewhat by writing 2-statement
>> >>> lines where reasonable.
>> >>>
>> >>> for i in range(len(d)): p.append(d[i][1])
>> >>>
>> >>>
>> >>> And you can probably change your editor's default tab indentation
>> >>> to 2 or 3 spaces, if the standard 4 looks like too much
>> >>> whitespace. 
>> >> 
>> >> Also, python loops are just retarded.
>> >> What the hell is wrong with a simple indexed for loop that python
>> >> makes you go through this contrived mess:
>> >> 
>> >> i=0
>> >> while i < whatever
>> >>   something 
>> >>   i+1
>> >> 
>> >> or else with some bullshit with range() or enumerate().  
>> > 
>> > 
>> > What's wrong with 'for i in range(0,101,10)'?
>> > 
>> >   
>> 
>> Do this without jumping through hoops:
>> for (i=0; i<count && blah[i]>i ;i++)
>> 
> 
> Of course while loop is for conditions like that, but for loop is best
> used for iterations through container. eg in Rust it is preferred way
> and C++ also introduced such. 
> 

Well, depending on how you construct the while loop, it's essentially the
same a for loop.  My basic gripe with python is how unintuitive and tedious
the code is:

C:
for (i=0; i<count && blah[i]>i ;i++)
{
  whatever();
}

vs

Python:
for i,val in enumerate(blah):
  if i<count and blah[i]>i
    whatever()
  i+=1

# same as "if i<count and val>i"

Not to mention how unbelievably slow python is.

For example, with some printing of values:

C array:
   int blah[]={9,8,7,6,5,4,3,2,1,0};

and

Python list:
blah=[9,8,7,6,5,4,3,2,1,0]


anon@lowtide:~/code/for$ ./wah
blah[0]: 9
blah[1]: 8
blah[2]: 7
blah[3]: 6
blah[4]: 5
anon@lowtide:~/code/for$ ./tah.py
blah[0]: 9
blah[1]: 8
blah[2]: 7
blah[3]: 6
blah[4]: 5
anon@lowtide:~/code/for$ 

anon@lowtide:~/code/for$ time ./dowah 1000 >out.wah

real	0m0.409s
user	0m0.024s
sys	0m0.076s
anon@lowtide:~/code/for$ time ./dotah 1000 >out.tah

real	0m11.478s
user	0m7.908s
sys	0m2.120s
anon@lowtide:~/code/for$ 

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


Thread

Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-06 11:42 -0400
  Re: Ping sbd: another programming challenge for your developmentally challenged children Adlbifhr Mjduhgfks <am@random.us> - 2016-10-06 20:00 +0000
    Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-06 19:31 -0400
      Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 00:20 +0000
        Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-06 20:55 -0400
          Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 01:04 +0000
            Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-06 22:11 -0400
              Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 02:19 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-06 23:20 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 03:33 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 00:02 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 04:22 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children fr314159@gmail.com - 2016-10-07 08:08 -0700
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-07 10:42 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-08 03:13 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-08 03:19 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Chris Ahlstrom <OFeem1987@teleworm.us> - 2016-10-08 05:37 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 07:09 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <mel@zzzzz.com> - 2016-10-10 14:11 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 07:37 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-10 16:56 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Silver Slimer <.m@nsn.s> - 2016-10-08 10:26 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-08 10:48 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Steve Carroll <fretwizzer@gmail.com> - 2016-10-08 07:58 -0700
                Re: Ping sbd: another programming challenge for your developmentally challenged children Silver Slimer <.m@nsn.s> - 2016-10-08 15:04 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-09 10:24 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-08 15:28 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Chris Ahlstrom <OFeem1987@teleworm.us> - 2016-10-08 15:41 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-08 19:57 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Silver Slimer <.m@nsn.s> - 2016-10-08 17:23 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Silver Slimer <.m@nsn.s> - 2016-10-08 10:24 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-08 10:44 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-08 17:11 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-08 13:46 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-08 20:01 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children ronb <ronb02NOSPAM@gmail.com> - 2016-10-08 23:23 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Chris Ahlstrom <OFeem1987@teleworm.us> - 2016-10-08 20:43 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 01:15 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 01:13 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children ronb <ronb02NOSPAM@gmail.com> - 2016-10-09 02:08 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 02:13 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Chris Ahlstrom <OFeem1987@teleworm.us> - 2016-10-09 08:15 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 07:27 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children ronb <ronb02NOSPAM@gmail.com> - 2016-10-08 23:22 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-08 22:54 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 15:13 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-10-09 18:14 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 16:19 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-10-09 18:25 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 07:21 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 10:50 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children Snit <usenet@gallopinginsanity.com> - 2016-11-01 10:09 -0700
                Re: Ping sbd: another programming challenge for your developmentally challenged children William Poaster <wp@dev.null> - 2016-10-09 22:29 +0100
                Re: Ping sbd: another programming challenge for your developmentally challenged children Marek Novotny <marek.novotny@marspolar.com> - 2016-10-09 13:38 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-09 23:58 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 07:29 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children William Poaster <wp@dev.null> - 2016-10-10 13:41 +0100
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 12:25 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-10 13:33 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 10:51 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children chrisv <chrisv@nospam.invalid> - 2016-10-10 12:45 -0500
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 16:35 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children Silver Slimer <.m@nsn.s> - 2016-10-10 18:54 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 21:56 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-10 22:48 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Jim Polaski <jpolaski@linuxmail.org> - 2016-10-11 00:02 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 21:58 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children GreyCloud <Cumulus@mist.com> - 2016-10-10 21:58 -0600
                Re: Ping sbd: another programming challenge for your developmentally challenged children Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-10-07 17:56 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 13:25 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Adlbifhr Mjduhgfks <am@random.us> - 2016-10-08 00:12 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-08 10:40 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-10 13:34 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-07 04:15 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 16:37 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-10-07 20:34 +0200
          Re: Ping sbd: another programming challenge for your developmentally challenged children Steve Carroll <frelwizzen@gmail.com> - 2016-10-07 11:10 -0700
    Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-20 11:20 -0400
      Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-21 08:53 +0000
        Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <mel@zzzzz.com> - 2016-10-21 13:19 +0200
        Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-21 10:45 -0400
          Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-22 01:06 +0000
            Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <Melzzzzz@zzzzz.com> - 2016-10-22 02:15 +0000
              Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-22 02:40 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <mel@zzzzz.com> - 2016-10-22 05:00 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-22 16:34 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <mel@zzzzz.com> - 2016-10-22 23:14 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children Chris Ahlstrom <OFeem1987@teleworm.us> - 2016-10-22 18:24 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-25 23:20 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-26 05:22 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-26 11:26 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-26 20:42 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children Melzzzzz <mel@zzzzz.com> - 2016-10-27 01:45 +0200
                Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-27 01:21 +0000
            Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-22 09:33 -0400
              Re: Ping sbd: another programming challenge for your developmentally challenged children deplorable owl <owl@rooftop.invalid> - 2016-10-22 16:50 +0000
  Re: Ping sbd: another programming challenge for your developmentally challenged children "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-10-06 21:25 +0000
  Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 16:30 +0000
    Re: Ping sbd: another programming challenge for your developmentally challenged children Steve Carroll <fretwizzer@gmail.com> - 2016-10-07 09:44 -0700
      Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 17:20 +0000
        Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 15:24 -0400
          Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 20:01 +0000
            Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 16:50 -0400
              Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 21:37 +0000
                Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 17:54 -0400
                Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 22:11 +0000
    Re: Ping sbd: another programming challenge for your developmentally challenged children DFS <nospam@dfs.com> - 2016-10-07 13:51 -0400
      Re: Ping sbd: another programming challenge for your developmentally challenged children Sandman <mr@sandman.net> - 2016-10-07 18:13 +0000
  Re: Ping sbd: another programming challenge for your developmentally challenged children Steve Carroll <frelwizzen@gmail.com> - 2016-10-07 11:10 -0700

csiph-web