c# is a good way to learn c

  • Thread starter Thread starter Montrose...
  • Start date Start date
Hi Olaf, Re: My amazement that someone agreed with my comments on
readability and whitespace preferences, You told me: <<
It is not that we are in discussion that I do not repect you. ;-)
I also listen and learn. You do have valid reasoning.
And I see that you are experienced and actually know what you say. :-) >>

Wow... People in Comp.OS.Linux.Advocacy usually just insult me.
Comp.OS.Linux.Advocacy is really Comp.Ha.Ha, nothing is serious here.
 
Hi Lee_Jackson, HTM_TXT.CPP should be judged by what it does,
not by how hard it is for you to learn it,

You concluded: << Anyways - I looked at your code and decided to stick to
strHTML = Regex.Replace(strHTML,@"(<[^>]+>)",string.Empty); >>

From <<
These are tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
&Unknown is also sent throug untranslated, for obvious reasons. >>

See ! ? C#'s RegEX has made you lazy.

Further, HTM_TXT.CPP simply demos what's in my hyper_custom newsreader,
X.CPP, the parsing it does is very extensive, RegEx wouldn't cut it.
 
Jeff_Relf said:
Hi Bruce_Wood, Re: The kind of code you want,

What programs do you have that run too slow ? None, I'll bet.

And even if you did have speed concerns,
they probably could be solved by just upgrading your LAN,
internet connection, hard drive, DVD burner, printer, etc.

I also bet that you don't spend endless years/money perfecting GUIs,
...second, or even third class, will do,
so C#'s dialog/forms editors are quite good enough for you.

As far as maintaining code... upgrades, bug fixes, etc.,
there's always a learning curve, even with C#.

From showing my code, for example my HTM_TXT.CPP,
which demos how my X.CPP converts HTML files into plain_text files:
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
I found that no one here was willing to take the time to learn
my standard methods... which is totally understandable.

But I also found that no one here could produce anything half as good.
I think that's because the STL and C# make people lazy,
they tend to rely on the built-in stuff too much.
Do you light your candles by rubbing two dry sticks together as well?
The more effective way is to use an electric light fixture, Jeff.

Certainly all that tight, efficient code is locked away in the
infrastructure and legions of dweebs are hard at work optimizing
sections that implement this built-in stuff. The rest of the world is
out solving real problems at a higher level.
 
Wow... People in Comp.OS.Linux.Advocacy usually just insult me.
Comp.OS.Linux.Advocacy is really Comp.Ha.Ha, nothing is serious here.
I always thought that using insults is a way to hide that you are insecure
and have no clue what you are talking about. ;-)
 
Hi Olaf, Re: The code below not working in MS_C_7_1
because it doesn't evaluate the four -- P decrements left to right,
instead, it decrements them all at once, like P -= 4, <<
typedef unsigned char * uint_8_P ;
int Swap_32 ( int X ) { uint_8_P P = ( uint_8_P ) & X + 4 ;
return * -- P << 24 | * -- P << 16 | * -- P << 8 | * -- P ; }
main() { printf( "%x", Swap_32( 0x84838281 ) ); } >>

You suggested: << Try "(" and ")" this might solve the problem. >>

No, I tried that ( * -- P << 24 ) | ( * -- P << 16 ) fails
but ( rv = * -- P << 24 ) | ( rv = * -- P << 16 ) works ( rv is an int ).

You concluded: << I am not going to discuss about macros or not,
because everybody should use the techniques that works best for them.
I tried macro's but I am coming back from them
because I lose track what the code does and hides bugs.
It becomes too abstract for my taste. >>

I like you Olaf... anyone else would've said I was wrong to use macros.
I wrote Loop() twelve years ago, and it's in all of my code everywhere:
#define Loop( N ) int J = - 1, LLL = N ; while ( ++ J < LLL )

So it's as tangible as a rock to me.
 
Jeff_Relf said:
Hi Lee_Jackson, HTM_TXT.CPP should be judged by what it does,
not by how hard it is for you to learn it,

You concluded: << Anyways - I looked at your code and decided to stick to
strHTML = Regex.Replace(strHTML,@"(<[^>]+>)",string.Empty); >>

From <<
These are tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
&Unknown is also sent throug untranslated, for obvious reasons. >>

See ! ? C#'s RegEX has made you lazy.

Jeff did you or did Lee use most time writing the code ? The same goes for
debugging the code by 3. party.

Have you also written your own OS, and every tool you use ? Or are you also
a bit lazy and use stuff other people have made ? :-)
If C# makes you lazy, so does C compared to assembler, and again assembler
compared to just entering mnemonics.

It is always a matter of choice and personal preferences, i would rather get
my job done fast, and hopefully less full of bugs, than writing everything
myself.

/Søren
 
Hi Olaf, You commented: <<
I always thought that using insults is a way to hide that you are insecure
and have no clue what you are talking about. ;-) >>

Very true, it's a weakness... and I too am weak sometimes.

I know a tiny bit about a few things,
others know little bits of other things,
but no one knows much of anything... so why get upset ?
 
Regarding .NET groups it's likely off topic. Try one of the
microsoft.public.vc.* group instead.

TIA.

Patrice
 
Hi Lee_Jackson, HTM_TXT.CPP should be judged by what it does,
not by how hard it is for you to learn it,

I dont want to learn it - its un-natural!!!!
You concluded: << Anyways - I looked at your code and decided to stick to
strHTML = Regex.Replace(strHTML,@"(<[^>]+>)",string.Empty); >>

From <<
These are tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
Hrrrmm Yes it is, and I just tested it to verify.
&Unknown is also sent throug untranslated, for obvious reasons. >>
*shrug* ( said:
See ! ? C#'s RegEX has made you lazy.

Nope, Im naturally lazy. And regex is regex...dont be giving Microsoft
patent department ideas....
Further, HTM_TXT.CPP simply demos what's in my hyper_custom newsreader,
X.CPP, the parsing it does is very extensive, RegEx wouldn't cut it.

And youre hyper custom news reading is creating new threads every time
you change the topic and post - its creating a LOT of clutter in the
NG for me (with freeAgent) and making it difficult to follow what
actually might be interesting threads. PLEASE either fix it or
something
 
Hi Soren_Reinke ( and Lee_Jackson ),
Re: How I create plain text from HTML vs C#'s RegEx,

You asked me: <<
Jeff did you or did Lee [ require more time to write ] the code ?
The same goes for debugging the code by 3. party.

Have you also written your own OS, and every tool you use ?
Or are you also a bit lazy and use stuff other people have made ? :-)
If C# makes you lazy, so does C compared to assembler,
and again assembler compared to just entering mnemonics.

It is always a matter of choice and personal preferences,
I would rather get my job done fast, and hopefully less full of bugs,
than writing everything myself. >>

Writing C++ code is not the same thing as manufacturing a CPU.
As you say, it's whatever I want, and I want LoopTo()'s parsing.

My hyper_custom e-mail.news client. X.CPP, has to decode to 8 bit,
remove automated spam like PGP sigs, vcards and multi_level_quoting, >>,
it has to extract attachments and convert Hotmail.COM's HTML_Only e-mails.

So general purpose, low level parsing, like LoopTo(), is what I prefer.
 
Hi Lee_Jackson, < br> is passed through as a literal,
it is not a valid HTML tag ( because of the space ),

You wrote: << Hrrrmm Yes it is, and I just tested it to verify. >>

I think you're mistaken, I too tested it, and again just now.

You wrote: << shrug (<[^>]+>|&.{0,8};) then
- I was just throwing a lazy example :) >>

Nice try, now use that to translate this correctly:
&lt; &Monkey <br> &amp; &Reg_Ex_Sucks < What>

And don't forget to remove lines that contained nothing but HTML tags.

You told me: << And youre hyper custom news reading
is creating new threads every time you change the topic and post
- its creating a LOT of clutter in the NG for me (with freeAgent )
and making it difficult to follow what actually might be interesting threads.
PLEASE either fix it or something >>

Fix your Forte_Free problem if you want, I don't care.
Forte_Free might have an option to not start threads on topic changes,
but I wouldn't bother looking for it, I'd switch to 40tude_Dialog instead.
 
Hi billwg ( and Bruce_Wood ),
Re: Why I wrote LoopTo(), a general purpose, low level parser,

You asked me: <<
Do you light your candles by rubbing two dry sticks together as well ?
The more effective way is to use an electric light fixture, Jeff.

Certainly all that tight, efficient code is locked away in the
infrastructure and legions of dweebs are hard at work optimizing
sections that implement this built-in stuff.
The rest of the world is out solving real problems at a higher level. >>

I wrote X.CPP because there is nothing the comes even close to being as good.
You're the one using the candle, I'm using the light saber.
LoopTo() is just my preferred parser.
 
Hi Lee_Jackson, < br> is passed through as a literal,
it is not a valid HTML tag ( because of the space ),

You wrote: << Hrrrmm Yes it is, and I just tested it to verify. >>

I think you're mistaken, I too tested it, and again just now.

You wrote: << shrug (<[^>]+>|&.{0,8};) then
- I was just throwing a lazy example :) >>

Nice try, now use that to translate this correctly:
&lt; &Monkey <br> &amp; &Reg_Ex_Sucks < What>

&Monkey of course is not a valid entity- my regex works fine thankyou
(but yes it is lazy - I cant recall what the max length is for a html
character entity).

Iif you choose to strip such tags from html &loose parts of sentances
then thats your business.
And don't forget to remove lines that contained nothing but HTML tags.

You told me: << And youre hyper custom news reading
is creating new threads every time you change the topic and post
- its creating a LOT of clutter in the NG for me (with freeAgent )
and making it difficult to follow what actually might be interesting threads.
PLEASE either fix it or something >>

Fix your Forte_Free problem if you want, I don't care.
Forte_Free might have an option to not start threads on topic changes,
but I wouldn't bother looking for it, I'd switch to 40tude_Dialog instead.

Guess what Jeff? I dont care either.

PLONK!
 
Bruce Wood poked his little head through the XP firewall and said:
There are myriad problems with this.

1. There is only a limited number of gurus to go around.
2. Most gurus don't like writing boring business software.
3. This presumes that the hiring managers can tell which hires are
4. Today's stock-and-trade tools are yesterday's "snake oil." I
5. One of those very, very smart gurus can write me up a business

Some guy who writes elegant C code would be utterly useless to us,
apart from his basic thinking skills and attention to detail.

Similarly, the aforementioned MS guru would completely suck writing
code in my old job, where picky attention to tiny details was the order
of the day, and you built every line of code by hand, counting CPU
cycles as you went. As I said: different domains, different skill sets.

The only point I disagree on is the attention to detail aspect. I think it
is necessary every step of the way.

But otherwise, we got some great real-world posts here, I think.
 
American Pope poked his little head through the XP firewall and said:
Olaf Baeyens wrote:

Is your name really 'Olaf' ?

class clown
{
private:

clown ();

public:

void troll (bool intelligent = false);

};
 
Ku Karlovsky poked his little head through the XP firewall and said:
Graphical: SuperGravity (formerly: Gravity from Microplanet).
Console: SLRN (not to be outfeatured by anyone)

But, but, slrn is one of those damn beta apps with a zero version number
that those Win trolls are always yakking about!
 
Olaf Baeyens poked his little head through the XP firewall and said:
Yes I understand. :-)
I also put my "{" at the end of the line of the if/for/... function.
This way I can seem more code and less white spaces, so I have one big
overview of my working of the function without need to scroll. It is a
matter of tast.

I believe in { coming on the next line. I solve the scrolling problem in
two ways:

1. Shorter functions.

2. Text so small it makes passers-by wonder why I'm not blind yet.

Oh, there's a third way:

3. Ignore the IDE and just use a bunch of console windows.
 
Back
Top