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


Groups > comp.os.linux.advocacy > #384441 > unrolled thread

Technical challenge for DFS

Started byIncubus <incubus9536612@gmail.com>
First post2016-12-16 07:18 -0800
Last post2016-12-21 07:14 -0600
Articles 20 on this page of 45 — 14 participants

Back to article view | Back to comp.os.linux.advocacy


Contents

  Technical challenge for DFS Incubus <incubus9536612@gmail.com> - 2016-12-16 07:18 -0800
    Re: Technical challenge for DFS DFS <nospam@dfs.com> - 2016-12-16 11:32 -0500
      Re: Technical challenge for DFS DFS <nospam@dfs.com> - 2016-12-16 11:37 -0500
      Re: Technical challenge for DFS Incubus <incubus9536612@gmail.com> - 2016-12-16 08:50 -0800
      Re: Technical challenge for DFS Steve Carroll <fretwizzer@gmail.com> - 2016-12-16 09:32 -0800
    Loop(100) Jeff-Relf.Me <@.> - 2016-12-17 12:34 -0800
      Re: Loop(100) DFS <nospam@dfs.com> - 2016-12-18 00:44 -0500
        Command Line jockies use plenty of aliases, no ? ! Jeff-Relf.Me <@.> - 2016-12-17 21:59 -0800
      Re: Loop(100) moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-19 17:20 +0000
        I don't worry about "optimizations", don't need to. Jeff-Relf.Me <@.> - 2016-12-19 10:56 -0800
          Re: I don't worry about "optimizations", don't need to. Steve Carroll <fretwizzer@gmail.com> - 2016-12-19 11:23 -0800
          Re: I don't worry about "optimizations", don't need to. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-20 12:30 +0000
            Other people's code is hard to learn/modify. Jeff-Relf.Me <@.> - 2016-12-20 06:06 -0800
              Re: Other people's code is hard to learn/modify. Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-12-20 15:31 +0100
                Re: Other people's code is hard to learn/modify. chrisv <chrisv@nospam.invalid> - 2016-12-20 09:04 -0600
              Re: Other people's code is hard to learn/modify. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-20 15:06 +0000
                What The Fuck is wrong with your peers ? ! Jeff-Relf.Me <@.> - 2016-12-20 09:59 -0800
                  Re: What The Fuck is wrong with your peers ? ! moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-20 23:22 +0000
                    I won, bigly. Jeff-Relf.Me <@.> - 2016-12-20 16:15 -0800
                      Re: I won, bigly. DFS <nospam@dfs.com> - 2016-12-21 00:01 -0500
                        AutoFormatting hides the fingerprints. Jeff-Relf.Me <@.> - 2016-12-21 02:55 -0800
                          Re: AutoFormatting hides the fingerprints. Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-12-21 14:33 +0100
                          Re: AutoFormatting hides the fingerprints. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-22 03:21 +0000
                            My code is dense, and hard to read, like the Washington Post. Jeff-Relf.Me <@.> - 2016-12-22 02:36 -0800
                              Re: My code is dense, and hard to read, like the Washington Post. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-22 21:22 +0000
                                Re: My code is dense, and hard to read, like the Washington Post. chrisv <chrisv@nospam.invalid> - 2016-12-23 07:54 -0600
                                  Re: My code is dense, and hard to read, like the Washington Post. flatfish+++ <flatfish@linuxmail.org> - 2016-12-23 09:35 -0500
                                    Re: My code is dense, and hard to read, like the Washington Post. Marek Novotny <marek.novotny@marspolar.com> - 2016-12-23 08:46 -0600
                                    Re: My code is dense, and hard to read, like the Washington Post. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-23 16:21 +0000
                                      My code is dense, and hard to read, like the Washington Post. Jeff-Relf.Me <@.> - 2016-12-23 08:52 -0800
                                        Re: My code is dense, and hard to read, like the Washington Post. moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-12-23 19:12 +0000
                                          Re: My code is dense, and hard to read, like the Washington Post. chrisv <chrisv@nospam.invalid> - 2016-12-23 13:27 -0600
                                            Re: My code is dense, and hard to read, like the Washington Post. Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-12-23 20:56 +0100
                                              Re: My code is dense, and hard to read, like the Washington Post. Snit <usenet@gallopinginsanity.com> - 2016-12-23 13:32 -0700
                                                Re: My code is dense, and hard to read, like the Washington Post. Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-12-23 22:40 +0100
                                                  Re: My code is dense, and hard to read, like the Washington Post. Snit <usenet@gallopinginsanity.com> - 2016-12-23 15:19 -0700
                                                    Re: My code is dense, and hard to read, like the Washington Post. Steve Carroll <fretwizzer@gmail.com> - 2016-12-23 14:30 -0800
                                                  My C++ Coding Standards ( apologies to Bjarne Stroustrup ). Jeff-Relf.Me <@.> - 2016-12-23 17:06 -0800
                                                    Re: My C++ Coding Standards ( apologies to Bjarne Stroustrup ). Peter Köhlmann <peter-koehlmann@t-online.de> - 2016-12-24 10:40 +0100
                                              Re: My code is dense, and hard to read, like the Washington Post. jmfbahciv <See.above@aol.com> - 2016-12-24 14:04 +0000
                                  Someday, if you're lucky, you'll know the freedoms I enjoy. Jeff-Relf.Me <@.> - 2016-12-23 08:05 -0800
                                  Re: My code is dense, and hard to read, like the Washington Post. GreyCloud <mist@cumulus.com> - 2016-12-23 13:49 -0700
                      Re: I won, bigly. Silver Slimer <.m@nsn.s> - 2016-12-21 09:09 -0500
                      Re: I won, bigly. benj <benj@nobody.net> - 2016-12-21 17:37 -0500
                    Re: What The Fuck is wrong with your peers ? ! chrisv <chrisv@nospam.invalid> - 2016-12-21 07:14 -0600

Page 1 of 3  [1] 2 3  Next page →


#384441 — Technical challenge for DFS

FromIncubus <incubus9536612@gmail.com>
Date2016-12-16 07:18 -0800
SubjectTechnical challenge for DFS
Message-ID<f55d5858-3f4b-4644-871e-06d06439a2b5@googlegroups.com>
Without using a web search, please answer the following.

In C or C++ using the following code:

for (int i = 0; i < 100; ++i)
{
    ...
}

What is the advantage of using '++i' instead of 'i++' bearing in mind i is not being assigned when the unary operator is used?

[toc] | [next] | [standalone]


#384457

FromDFS <nospam@dfs.com>
Date2016-12-16 11:32 -0500
Message-ID<o314sp$81q$1@dont-email.me>
In reply to#384441
On 12/16/2016 10:18 AM, Incubus wrote:
> Without using a web search, please answer the following.
>
> In C or C++ using the following code:
>
> for (int i = 0; i < 100; ++i)
> {
>     ...
> }
>
> What is the advantage of using '++i' instead of 'i++' bearing in mind i is not being assigned when the unary operator is used?


I don't know about any advantage of one over the other.

I do/did know

i++ returns i then increments
++i increments then returns i

I've always used the 'post-decrement' format i++ or i+=1 (occasionally 
i+=2,3...)


After researching, I see any differences between the two formats are 
optimized away by the compiler.

http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c

[toc] | [prev] | [next] | [standalone]


#384458

FromDFS <nospam@dfs.com>
Date2016-12-16 11:37 -0500
Message-ID<o3155p$91h$1@dont-email.me>
In reply to#384457
On 12/16/2016 11:32 AM, DFS wrote:


> I've always used the 'post-decrement' format
                         ---------------

post-increment

[toc] | [prev] | [next] | [standalone]


#384462

FromIncubus <incubus9536612@gmail.com>
Date2016-12-16 08:50 -0800
Message-ID<a3defae2-6de2-415d-ae11-9efe609038b9@googlegroups.com>
In reply to#384457
On Friday, December 16, 2016 at 4:32:48 PM UTC, DFS wrote:
> On 12/16/2016 10:18 AM, Incubus wrote:
> > Without using a web search, please answer the following.
> >
> > In C or C++ using the following code:
> >
> > for (int i = 0; i < 100; ++i)
> > {
> >     ...
> > }
> >
> > What is the advantage of using '++i' instead of 'i++' bearing in mind i is not being assigned when the unary operator is used?
> 
> 
> I don't know about any advantage of one over the other.
> 
> I do/did know
> 
> i++ returns i then increments
> ++i increments then returns i
> 
> I've always used the 'post-decrement' format i++ or i+=1 (occasionally 
> i+=2,3...)
> 
> 
> After researching, I see any differences between the two formats are 
> optimized away by the compiler.
> 
> http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c

Any modern compiler should optimise so that they are equivalent rather than perform a copy that gets thrown away when using the post-increment operator but preferring the pre-increment operator is the best way to be sure.

As a matter of programming practice, it is also better to prefer the pre-increment operator in such a loop because we might not always be using an int; we might be using an iterator or some other class that overloads the ++ operators where we can't guarantee that an unnecessary copy won't be made.

[toc] | [prev] | [next] | [standalone]


#384475

FromSteve Carroll <fretwizzer@gmail.com>
Date2016-12-16 09:32 -0800
Message-ID<2eca3005-f915-4b03-a6b2-b27b435c8126@googlegroups.com>
In reply to#384457
On Friday, December 16, 2016 at 9:32:48 AM UTC-7, DFS wrote:
> On 12/16/2016 10:18 AM, Incubus wrote:
> > Without using a web search, please answer the following.
> >
> > In C or C++ using the following code:
> >
> > for (int i = 0; i < 100; ++i)
> > {
> >     ...
> > }
> >
> > What is the advantage of using '++i' instead of 'i++' bearing in mind i is not being assigned when the unary operator is used?
> 
> 
> I don't know about any advantage of one over the other.
> 
> I do/did know
> 
> i++ returns i then increments
> ++i increments then returns i
> 
> I've always used the 'post-decrement' format i++ or i+=1 (occasionally 
> i+=2,3...)

Doug Crockford (javascript guy who came up with json) recommends using this even if the value is 1 (i+=1), but he's known for getting sorta religious about things.

[toc] | [prev] | [next] | [standalone]


#384649 — Loop(100)

FromJeff-Relf.Me <@.>
Date2016-12-17 12:34 -0800
SubjectLoop(100)
Message-ID<Jeff-Relf.Me@Dec.17--0.34P.Seattle.2016>
In reply to#384441
Incubus wrote:
>   for (int i = 0; i < 100; ++i)
>     [...]
> What is the advantage of using '++i' instead of 'i++' ?

I see no need to optimize integer increments.
My loops look like this:

  wchar _T[999], *P = _T ;

  Loop(3) { int Y = J ;
    Loop(4) P += Str( P, L"( %d, %d )%s", J, Y, J == LLL - 1 ? L"\n" :  L" " );  }

  printf( _T );

Given:

  #define  Loop( N )  int LLL = ( N ), J = -1 ; while ( ++J < LLL )
  #define  StrF  fwprintf
  typedef  wchar_t  wchar ;

Output:

  ( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 )
  ( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 )
  ( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 )

[toc] | [prev] | [next] | [standalone]


#384683 — Re: Loop(100)

FromDFS <nospam@dfs.com>
Date2016-12-18 00:44 -0500
SubjectRe: Loop(100)
Message-ID<o357l8$a2f$1@dont-email.me>
In reply to#384649
On 12/17/2016 03:34 PM, Jeff-Relf.Me wrote:
> Incubus wrote:
>>   for (int i = 0; i < 100; ++i)
>>     [...]
>> What is the advantage of using '++i' instead of 'i++' ?
>
> I see no need to optimize integer increments.
> My loops look like this:
>
>   wchar _T[999], *P = _T ;
>
>   Loop(3) { int Y = J ;
>     Loop(4) P += Str( P, L"( %d, %d )%s", J, Y, J == LLL - 1 ? L"\n" :  L" " );  }
>
>   printf( _T );
>
> Given:
>
>   #define  Loop( N )  int LLL = ( N ), J = -1 ; while ( ++J < LLL )
>   #define  StrF  fwprintf
>   typedef  wchar_t  wchar ;
>
> Output:
>
>   ( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 )
>   ( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 )
>   ( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 )



Strange code, as always.  You'll have to come back from the grave to 
maintain it.


My loops are more traditional:

-----------------------------------------------
python 3.5
-----------------------------------------------
import sys
rows = int(sys.argv[1])
cols = int(sys.argv[2])
for i in range(0,rows):
   for j in range(0,cols):
     print('( '+str(j)+', '+str(i)+' ) ',end='')
   print()
-----------------------------------------------
[dfs@manjaro dev]$ python loops.py 2 2
( 0, 0 ) ( 1, 0 )
( 0, 1 ) ( 1, 1 )

[dfs@manjaro dev]$ python loops.py 8 4
( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 )
( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 )
( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 )
( 0, 3 ) ( 1, 3 ) ( 2, 3 ) ( 3, 3 )
( 0, 4 ) ( 1, 4 ) ( 2, 4 ) ( 3, 4 )
( 0, 5 ) ( 1, 5 ) ( 2, 5 ) ( 3, 5 )
( 0, 6 ) ( 1, 6 ) ( 2, 6 ) ( 3, 6 )
( 0, 7 ) ( 1, 7 ) ( 2, 7 ) ( 3, 7 )

[dfs@manjaro dev]$ python loops.py 8 8
( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 ) ( 4, 0 ) ( 5, 0 ) ( 6, 0 ) ( 7, 0 )
( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 ) ( 4, 1 ) ( 5, 1 ) ( 6, 1 ) ( 7, 1 )
( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 ) ( 4, 2 ) ( 5, 2 ) ( 6, 2 ) ( 7, 2 )
( 0, 3 ) ( 1, 3 ) ( 2, 3 ) ( 3, 3 ) ( 4, 3 ) ( 5, 3 ) ( 6, 3 ) ( 7, 3 )
( 0, 4 ) ( 1, 4 ) ( 2, 4 ) ( 3, 4 ) ( 4, 4 ) ( 5, 4 ) ( 6, 4 ) ( 7, 4 )
( 0, 5 ) ( 1, 5 ) ( 2, 5 ) ( 3, 5 ) ( 4, 5 ) ( 5, 5 ) ( 6, 5 ) ( 7, 5 )
( 0, 6 ) ( 1, 6 ) ( 2, 6 ) ( 3, 6 ) ( 4, 6 ) ( 5, 6 ) ( 6, 6 ) ( 7, 6 )
( 0, 7 ) ( 1, 7 ) ( 2, 7 ) ( 3, 7 ) ( 4, 7 ) ( 5, 7 ) ( 6, 7 ) ( 7, 7 )




-----------------------------------------------
ANSI C
-----------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int rows = atoi(argv[1]);
	int cols = atoi(argv[2]);
	for(int i=0;i<rows;i++) {
	  for(int j=0;j<cols;j++) {
	    printf("( %d, %d ) ",j,i);
	  }
	  printf("\n");
	}
}
-----------------------------------------------

dfs@manjaro dev]$ ./loops 2 2
( 0, 0 ) ( 1, 0 )
( 0, 1 ) ( 1, 1 )

[dfs@manjaro dev]$ ./loops 8 4
( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 )
( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 )
( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 )
( 0, 3 ) ( 1, 3 ) ( 2, 3 ) ( 3, 3 )
( 0, 4 ) ( 1, 4 ) ( 2, 4 ) ( 3, 4 )
( 0, 5 ) ( 1, 5 ) ( 2, 5 ) ( 3, 5 )
( 0, 6 ) ( 1, 6 ) ( 2, 6 ) ( 3, 6 )
( 0, 7 ) ( 1, 7 ) ( 2, 7 ) ( 3, 7 )

([dfs@manjaro dev]$ ./loops 8 8
( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 ) ( 4, 0 ) ( 5, 0 ) ( 6, 0 ) ( 7, 0 )
( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 ) ( 4, 1 ) ( 5, 1 ) ( 6, 1 ) ( 7, 1 )
( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 ) ( 4, 2 ) ( 5, 2 ) ( 6, 2 ) ( 7, 2 )
( 0, 3 ) ( 1, 3 ) ( 2, 3 ) ( 3, 3 ) ( 4, 3 ) ( 5, 3 ) ( 6, 3 ) ( 7, 3 )
( 0, 4 ) ( 1, 4 ) ( 2, 4 ) ( 3, 4 ) ( 4, 4 ) ( 5, 4 ) ( 6, 4 ) ( 7, 4 )
( 0, 5 ) ( 1, 5 ) ( 2, 5 ) ( 3, 5 ) ( 4, 5 ) ( 5, 5 ) ( 6, 5 ) ( 7, 5 )
( 0, 6 ) ( 1, 6 ) ( 2, 6 ) ( 3, 6 ) ( 4, 6 ) ( 5, 6 ) ( 6, 6 ) ( 7, 6 )
( 0, 7 ) ( 1, 7 ) ( 2, 7 ) ( 3, 7 ) ( 4, 7 ) ( 5, 7 ) ( 6, 7 ) ( 7, 7 )

[toc] | [prev] | [next] | [standalone]


#384684 — Command Line jockies use plenty of aliases, no ? !

FromJeff-Relf.Me <@.>
Date2016-12-17 21:59 -0800
SubjectCommand Line jockies use plenty of aliases, no ? !
Message-ID<Jeff-Relf.Me@Dec.17--9.59P.Seattle.2016>
In reply to#384683
You ( DFS ) replied ( to me ):
> >   wchar _T[999], *P = _T ;
> >   Loop(3) { int Y = J ;
> >     Loop(4) P += Str( P, L"( %d, %d )%s", J, Y, J == LLL - 1 ? L"\n" :  L" " );  }
> >
> >   printf( _T );
> >
> > Given:
> >
> >   #define  Loop( N )  int LLL = ( N ), J = -1 ; while ( ++J < LLL )
> >   #define  Str  swprintf  //  Not: StrF  fwprintf
> >   typedef  wchar_t  wchar ;
> >
> > Output:
> >
> >   ( 0, 0 ) ( 1, 0 ) ( 2, 0 ) ( 3, 0 )
> >   ( 0, 1 ) ( 1, 1 ) ( 2, 1 ) ( 3, 1 )
> >   ( 0, 2 ) ( 1, 2 ) ( 2, 2 ) ( 3, 2 )
> 
> Strange code, as always.  
> You'll have to come back from the grave to maintain it.
> My loops are more traditional: [[...]]

Command Line jockies use plenty of aliases, no ? !

> alias ll='ls -l'

I'm the same, but mine are called macros (#define).

I use C code where/when most others would use a set of command lines.

[toc] | [prev] | [next] | [standalone]


#384946 — Re: Loop(100)

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-12-19 17:20 +0000
SubjectRe: Loop(100)
Message-ID<o394s3$e6h$3@pcls7.std.com>
In reply to#384649
Jeff-Relf.Me <@.> writes:

>Incubus wrote:
>>   for (int i = 0; i < 100; ++i)
>>     [...]
>> What is the advantage of using '++i' instead of 'i++' ?

>I see no need to optimize integer increments.

A good compiler will optimize better than you can, anyway.

>My loops look like this:

...

>Given:

>  #define  Loop( N )  int LLL = ( N ), J = -1 ; while ( ++J < LLL )

A tiny example of the type of bizarre coding styles I've had to deal
with that makes code difficult to maintain.

This is quite minor and if I had to maintain code where this was the
only strange coding example in it, I'd actually be relieved/happy.
Add in a bunch of other oddball stuff and it becomes hard to follow.

But for grins, I'll ask you, why not a "for (J=0; J < LLL; J++)"
based construct which was designed for such loops?

And what was the advantage of "J = -1; while ( ++J ..." where the
intent was to go through the loop with J == 0 the first time. I
see no reason other than to confuse the next guy.  Maybe job
security for you?  A good compiler will optimize the assign to -1
away to a clear, on hardware where a clear/set to 0 is a bit faster
than setting to a nonzero constant.  That's irrelevant unless the
loop itself was in a larger loop and the code was being squeezed
for every microsecond.

[toc] | [prev] | [next] | [standalone]


#384988 — I don't worry about "optimizations", don't need to.

FromJeff-Relf.Me <@.>
Date2016-12-19 10:56 -0800
SubjectI don't worry about "optimizations", don't need to.
Message-ID<Jeff-Relf.Me@Dec.19--10.56A.Seattle.2016>
In reply to#384946
You ( Michael Moroney ) asked me:
> why not a "for (J=0; J < LLL; J++)"
> based construct which was designed for such loops?

I simply don't like it, I much prefer while(), 
with the i++ happening _at_the_start_ of the loop.

But that's just me; -- you do it your way,
with your macros/aliases/definitions.
Now, if you can't do that, fine,
at least you're getting paid.

I'm getting paid, and loving it.

> A good compiler will optimize the assign to -1
> away to a clear, on hardware where a clear/set to 0 
> is a bit faster than setting to a nonzero constant.

I don't worry about "optimizations", don't need to;
I don't have separate release/debug modes.

P.S. I'm enjoying Leonard Cohen's "Boogie Street".
  He wrote it in 2001, after being in 
  a Japanese Budhist monestarty for 6 years.

  He said the monestary was all about living
  with No privacy... out on Boogie Street.
  https://www.youtube.com/watch?v=rswKZ0PNY_0

[toc] | [prev] | [next] | [standalone]


#384994 — Re: I don't worry about "optimizations", don't need to.

FromSteve Carroll <fretwizzer@gmail.com>
Date2016-12-19 11:23 -0800
SubjectRe: I don't worry about "optimizations", don't need to.
Message-ID<2568ceec-af5a-4fad-b652-535f1d79405d@googlegroups.com>
In reply to#384988
On Monday, December 19, 2016 at 11:56:34 AM UTC-7, Jeff-Relf.Me wrote:
> You ( Michael Moroney ) asked me:
> > why not a "for (J=0; J < LLL; J++)"
> > based construct which was designed for such loops?
> 
> I simply don't like it, I much prefer while(), 
> with the i++ happening _at_the_start_ of the loop.
> 
> But that's just me; -- you do it your way,
> with your macros/aliases/definitions.
> Now, if you can't do that, fine,
> at least you're getting paid.
> 
> I'm getting paid, and loving it.
> 
> > A good compiler will optimize the assign to -1
> > away to a clear, on hardware where a clear/set to 0 
> > is a bit faster than setting to a nonzero constant.
> 
> I don't worry about "optimizations", don't need to;
> I don't have separate release/debug modes.
> 
> P.S. I'm enjoying Leonard Cohen's "Boogie Street".
>   He wrote it in 2001, after being in 
>   a Japanese Budhist monestarty for 6 years.
> 
>   He said the monestary was all about living
>   with No privacy... out on Boogie Street.
>   https://www.youtube.com/watch?v=rswKZ0PNY_0

LC... a great loss to the music world. One of my favorite bass players, Roscoe Beck, played with him pretty much up until the end (Beck has played with some of my favorite guitarists, Robben Ford, Eric Johnson and Stevie Ray Vaughan... actually both Vaughan brothers).

[toc] | [prev] | [next] | [standalone]


#385190 — Re: I don't worry about "optimizations", don't need to.

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-12-20 12:30 +0000
SubjectRe: I don't worry about "optimizations", don't need to.
Message-ID<o3b89q$nfe$1@pcls7.std.com>
In reply to#384988
Jeff-Relf.Me <@.> writes:

>I don't worry about "optimizations", don't need to;
>I don't have separate release/debug modes.

I'm pointing out the maintainability issues, not efficiency.  For
example, your x.exe source is a mess, maintainability wise. Fortunately,
nobody else will ever have to maintain it.

What you do for a living, on the other hand...

My earlier gig was a mess, as I mentioned.  Partly due to age, partly due
to "clever" code jockeys all doing their thing...

[toc] | [prev] | [next] | [standalone]


#385220 — Other people's code is hard to learn/modify.

FromJeff-Relf.Me <@.>
Date2016-12-20 06:06 -0800
SubjectOther people's code is hard to learn/modify.
Message-ID<Jeff-Relf.Me@Dec.20--6.06A.Seattle.2016>
In reply to#385190
For anything larger than "Hello World",
other people's code is hard to learn/modify.

My Loop() macro neither helps nor hurts that.

[toc] | [prev] | [next] | [standalone]


#385224 — Re: Other people's code is hard to learn/modify.

FromPeter Köhlmann <peter-koehlmann@t-online.de>
Date2016-12-20 15:31 +0100
SubjectRe: Other people's code is hard to learn/modify.
Message-ID<o3bf8u$qt5$1@dont-email.me>
In reply to#385220
 wrote:

> For anything larger than "Hello World",
> other people's code is hard to learn/modify.

Wrong. People who write code which is hard to maintain by others have no 
business programming at all

> My Loop() macro neither helps nor hurts that.

*One* such Macro might not. Your horrible code consists of *lots* of those 
stupid constructs. You are not a "programmer". You shit your lunatic macros 
all over the place

[toc] | [prev] | [next] | [standalone]


#385233 — Re: Other people's code is hard to learn/modify.

Fromchrisv <chrisv@nospam.invalid>
Date2016-12-20 09:04 -0600
SubjectRe: Other people's code is hard to learn/modify.
Message-ID<rbhi5clt51m5ns06us00kq05g7fmtjk2cb@4ax.com>
In reply to#385224
Peter Köhlmann wrote:

> Relf wrote:
>>
>> For anything larger than "Hello World",
>> other people's code is hard to learn/modify.

If the code was written by a brain-damaged sociopath, like you, sure.

>Wrong. People who write code which is hard to maintain by others have no 
>business programming at all

If someone is paying you to code, it's a *job requirement* to design
the code to be maintainable by others.  Failure to do so would be a
breach of professional ethics.

>> My Loop() macro neither helps nor hurts that.
>
>*One* such Macro might not. Your horrible code consists of *lots* of those 
>stupid constructs. You are not a "programmer". You shit your lunatic macros 
>all over the place

Relf is one of those shit programmers who gets-off on making his code
inscrutable to others.

-- 
"(chrisv) claims (Relf's) code is shitty. Let's see him substantiate
it with some facts and a code analysis."  -  trolling fsckwit
"Ezekiel"

[toc] | [prev] | [next] | [standalone]


#385235 — Re: Other people's code is hard to learn/modify.

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-12-20 15:06 +0000
SubjectRe: Other people's code is hard to learn/modify.
Message-ID<o3bhcr$d8m$1@pcls7.std.com>
In reply to#385220
Jeff-Relf.Me <@.> writes:

>For anything larger than "Hello World",
>other people's code is hard to learn/modify.

No, not really.  I am working with a high quality code base now.
Code got/gets reviewed by peers before becoming part of the code
stream.  Kooky macros won't make the cut, as the reviewers would
respond with "WTF is that?"

Most of the code is rather easy to follow.

[toc] | [prev] | [next] | [standalone]


#385278 — What The Fuck is wrong with your peers ? !

FromJeff-Relf.Me <@.>
Date2016-12-20 09:59 -0800
SubjectWhat The Fuck is wrong with your peers ? !
Message-ID<Jeff-Relf.Me@Dec.20--9.59A.Seattle.2016>
In reply to#385235
You ( Michael Moroney ) told me:
> Code got/gets reviewed by peers before becoming part of the code
> stream.  Kooky macros won't make the cut, as the reviewers would
> respond with "WTF is that?"

What The Fuck is wrong with your peers ? !

Command Line jockies use plenty of aliases, no ? !

> alias ll='ls -l'

I do the same, only mine are called macros (#define).

I use C code where/when others use command lines.

[toc] | [prev] | [next] | [standalone]


#385380 — Re: What The Fuck is wrong with your peers ? !

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-12-20 23:22 +0000
SubjectRe: What The Fuck is wrong with your peers ? !
Message-ID<o3ceg5$9d8$1@pcls7.std.com>
In reply to#385278
Jeff-Relf.Me <@.> writes:

>You ( Michael Moroney ) told me:
>> Code got/gets reviewed by peers before becoming part of the code
>> stream.  Kooky macros won't make the cut, as the reviewers would
>> respond with "WTF is that?"

>What The Fuck is wrong with your peers ? !

Nothing.  This is a professional software development group.  We
frequently have to get into each others' code. More relevant, we
have to get into code written by people long gone. We have to write
knowing someday, someone else will come along to fix a bug or add a
feature or whatever.

We use macros all the time.  Good clear macros are valuable.  K00ky
macros don't make the cut, nobody even tries.

>Command Line jockies use plenty of aliases, no ? !

>> alias ll='ls -l'

People do whatever they want in their login file. It's stuff others
will have to deal with that matters.

Simple, clear stuff like that definition are fine.  Confusing stuff
isn't.

Maybe I should try to slip something like that loop macro in my next
reviewed code and see what others have to say about it....

[toc] | [prev] | [next] | [standalone]


#385394 — I won, bigly.

FromJeff-Relf.Me <@.>
Date2016-12-20 16:15 -0800
SubjectI won, bigly.
Message-ID<Jeff-Relf.Me@Dec.20--4.15P.Seattle.2016>
In reply to#385380
My code was challenged by old school ( FORTRAN ) professors
and young, high priced, programmers from MicroSoft's Visual Studio team.

They all lost; I won, bigly.
I'm not bragging, it's just true.

If you can, try to use macros more.

[toc] | [prev] | [next] | [standalone]


#385451 — Re: I won, bigly.

FromDFS <nospam@dfs.com>
Date2016-12-21 00:01 -0500
SubjectRe: I won, bigly.
Message-ID<o3d28c$7c2$1@dont-email.me>
In reply to#385394
On 12/20/2016 07:15 PM, Jeff-Relf.Me wrote:
> My code was challenged by old school ( FORTRAN ) professors
> and young, high priced, programmers from MicroSoft's Visual Studio team.
>
> They all lost; I won, bigly.
> I'm not bragging, it's just true.
>
> If you can, try to use macros more.


It's nice to win.

What was the challenge?

Who competed?

What were the rules?

What was the prize?

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.os.linux.advocacy


csiph-web