J
Jeff_Relf
Hi Sean_Hederman ( and Tom, Olaf ),
Re: Why I don't like the higher level tools in C++ and C#,
You asked me: << So, if you want to draw a rectangle to the screen,
you directly manipulate the screen buffer I take it ? >>
Try to follow the bouncing ball... will ya ?
The comparison was:
C vs the higher level General_Purpose_Tools found in C++ and C#.
Obviously, I link with stuff like Direct_Draw_7 and OLE sometimes.
In Microsoft C++ 7.1, I use these macros for drawing lines:
#define mt( x, y ) MoveToEx( DC, x, y, 0 )
#define lt( x, y ) LineTo( DC, x, y )
And, while the higher level Tools found in C# don't apeal to me,
the lower level tools, like macros, are oddly Verboten .
For example, how would you write this high/low byte swapper in C # ?
typedef unsigned __int8 * uint_8_P ;
__int32 Swap_32 ( __int32 X ) { uint_8_P P = ( uint_8_P ) & X + 4 ;
return * -- P << 24 | * -- P << 16 | * -- P << 8 | * -- P ; }
LoopTo() and ER(), shown below, are the Tools I prefer,
but C# doesn't allow macros like that.
So how would you write this in C# ?
// Because NNTP servers require newsgroup lists
// to be case sensitive with no spaces
// LowerCaseNG() converts: Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy
// to: alt.os.windows-xp,comp.os.linux.advocacy
#define LOOP while ( 1 )
#define \
LoopTo( StopCond ) \
while ( Ch && ( Ch = ( uchar ) * ++ P \
, Ch2 = ( uchar ) P [ 1 ] \
, Ch ) \
&& ! ( StopCond ) )
typedef char * LnP ; // The name LnP comes from a naming convention I use.
int rv ; // Although it's a global, rv is what I call a Super_Temp.
// ER() and er() are shorthand for Bigg_ER() and Small_er()
__int64 ER( __int64 X, __int64 Y ) { return X > Y ? X : Y ; }
__int64 er ( __int64 X, __int64 Y ) { return X < Y ? X : Y ; }
LnP LowerCaseNG ( LnP Mixed ) { static LnP B; static int Sz_B ;
rv = ER( 200, strlen ( Mixed ) + 1 );
if ( Sz_B != rv ) { free ( B ); B = ( LnP ) malloc( Sz_B = rv ); }
LnP P = Mixed, D = B - 1 ; int Ch = * P --, Ch2 = 0 ;
LoopTo ( 0 ) if ( Ch > 32 && Ch < 128 ) * ++ D = tolower ( Ch );
* ++ D = 0 ; return B ; }
main() {
printf( "%s"
, LowerCaseNG ( "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy" ); LOOP; }
Except for the main() part, the code above is from:
http://www.Cotse.NET/users/jeffrelf/X.CPP
Re: My comment that I don't like the look of String, cout or the STL,
You told me: << Good one. Haven't laughed that hard for a while.
If someone told me some drek like that in an interview,
it'd be sayonara baby, call me when you're mature enough to actually solve
the problems that confront our customers at a reasonable price. >>
Nice delusion, but you're not my employer.
I delivered code just yesterday to a Banking School in Madison Wisconsin.
( I'm the coder, not the designer )
I've held the same job since mid 1993... how about you ?
Only coding has paid my rent ever since the start of 1982... how about you ?
I've never been fired or sued... how about you ?
Being employed has never been a concern of mine... how about you ?
Re: http://www.Cotse.NET/users/jeffrelf/X.CPP
You asked me: << Why didn't you include your:
#define LOOP while ( 1 )
#define Loop( N ) int J = - 1, LLL = N ; while ( ++ J < LLL )
#define LoopXx( Xx ) Xx##P P = 0 ; int J = -1 ; \
Xx##A BB = Xx.BB, EE = Xx.PP + 1, PP = BB - 1 ; \
if ( BB ) while ( ++ J, P = * ++ PP, PP < EE )
or any other of the staggeringly bad C++ code in your example.
Frankly, the only time I've ever seen worse C coding
is in the Obfuscated C contests, and they're trying to write bad code,
not proclaiming it as good code.
One of my developers writes uncommented spaghetti crap like that
and I'd fire them on the spot. >>
Loop() is great shorthand, much better than for(; or whatever it is you use.
I only care about what makes my code more readable,
your delusions about being my employer don't interest me in the least.
Re: Why I don't like the higher level tools in C++ and C#,
You asked me: << So, if you want to draw a rectangle to the screen,
you directly manipulate the screen buffer I take it ? >>
Try to follow the bouncing ball... will ya ?
The comparison was:
C vs the higher level General_Purpose_Tools found in C++ and C#.
Obviously, I link with stuff like Direct_Draw_7 and OLE sometimes.
In Microsoft C++ 7.1, I use these macros for drawing lines:
#define mt( x, y ) MoveToEx( DC, x, y, 0 )
#define lt( x, y ) LineTo( DC, x, y )
And, while the higher level Tools found in C# don't apeal to me,
the lower level tools, like macros, are oddly Verboten .
For example, how would you write this high/low byte swapper in C # ?
typedef unsigned __int8 * uint_8_P ;
__int32 Swap_32 ( __int32 X ) { uint_8_P P = ( uint_8_P ) & X + 4 ;
return * -- P << 24 | * -- P << 16 | * -- P << 8 | * -- P ; }
LoopTo() and ER(), shown below, are the Tools I prefer,
but C# doesn't allow macros like that.
So how would you write this in C# ?
// Because NNTP servers require newsgroup lists
// to be case sensitive with no spaces
// LowerCaseNG() converts: Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy
// to: alt.os.windows-xp,comp.os.linux.advocacy
#define LOOP while ( 1 )
#define \
LoopTo( StopCond ) \
while ( Ch && ( Ch = ( uchar ) * ++ P \
, Ch2 = ( uchar ) P [ 1 ] \
, Ch ) \
&& ! ( StopCond ) )
typedef char * LnP ; // The name LnP comes from a naming convention I use.
int rv ; // Although it's a global, rv is what I call a Super_Temp.
// ER() and er() are shorthand for Bigg_ER() and Small_er()
__int64 ER( __int64 X, __int64 Y ) { return X > Y ? X : Y ; }
__int64 er ( __int64 X, __int64 Y ) { return X < Y ? X : Y ; }
LnP LowerCaseNG ( LnP Mixed ) { static LnP B; static int Sz_B ;
rv = ER( 200, strlen ( Mixed ) + 1 );
if ( Sz_B != rv ) { free ( B ); B = ( LnP ) malloc( Sz_B = rv ); }
LnP P = Mixed, D = B - 1 ; int Ch = * P --, Ch2 = 0 ;
LoopTo ( 0 ) if ( Ch > 32 && Ch < 128 ) * ++ D = tolower ( Ch );
* ++ D = 0 ; return B ; }
main() {
printf( "%s"
, LowerCaseNG ( "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy" ); LOOP; }
Except for the main() part, the code above is from:
http://www.Cotse.NET/users/jeffrelf/X.CPP
Re: My comment that I don't like the look of String, cout or the STL,
You told me: << Good one. Haven't laughed that hard for a while.
If someone told me some drek like that in an interview,
it'd be sayonara baby, call me when you're mature enough to actually solve
the problems that confront our customers at a reasonable price. >>
Nice delusion, but you're not my employer.
I delivered code just yesterday to a Banking School in Madison Wisconsin.
( I'm the coder, not the designer )
I've held the same job since mid 1993... how about you ?
Only coding has paid my rent ever since the start of 1982... how about you ?
I've never been fired or sued... how about you ?
Being employed has never been a concern of mine... how about you ?
Re: http://www.Cotse.NET/users/jeffrelf/X.CPP
You asked me: << Why didn't you include your:
#define LOOP while ( 1 )
#define Loop( N ) int J = - 1, LLL = N ; while ( ++ J < LLL )
#define LoopXx( Xx ) Xx##P P = 0 ; int J = -1 ; \
Xx##A BB = Xx.BB, EE = Xx.PP + 1, PP = BB - 1 ; \
if ( BB ) while ( ++ J, P = * ++ PP, PP < EE )
or any other of the staggeringly bad C++ code in your example.
Frankly, the only time I've ever seen worse C coding
is in the Obfuscated C contests, and they're trying to write bad code,
not proclaiming it as good code.
One of my developers writes uncommented spaghetti crap like that
and I'd fire them on the spot. >>
Loop() is great shorthand, much better than for(; or whatever it is you use.
I only care about what makes my code more readable,
your delusions about being my employer don't interest me in the least.