473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

c# is a good way to learn c


After working in c# for a year, the only conclusion I can come to is
that I wish I knew c.

All I need is Linux, the gnu c compiler and I can do anything.

Web services are just open sockets hooked up to interfaces.

The Gtk is more than enough gui.

Jul 21 '05
354 15416
On 2005-04-07, Olaf Baeyens <ol**********@skyscan.be> wrote:
However, since I learned C first, and, while doing so, took great care to
develop pretty good habits in that language, C++ turned out to be a

natural
progression for me.

My first language was assembler and I learned C by looking at the assembler
code generated. This way I could optimize the C code even more. Now in C+ I
still look at the assembly code to see if my functions is fast enough and to
determine how to change it to help the compiler to optimize it even faster.
But I rarely program in assembler these days only to implement MMX.

I did look a C# generated assembler code, and I am not refering to ILASM but
to the real processor dependend assembler code and I am still very suprised
to see how nice the C# code gets converted to the raw processor power code.
It is really near C++ code. Any slowdowns is mostly related to using some
library functions or bad programming. Ofcourse using Interop and using
properties ans stuff, it also slows down, but so would C++ if you use
properties.


Properties don't slow down your code in the simple case:

public int MyProperty
{
get
{
return this.myProperty;
}
set
{
this.myProperty = value;
}
}

This case is inlined by the compiler - so there is no method call
overhead. And, looking at my code - this is the most common case :)

--
Tom Shelton
Jul 21 '05 #51

Hi Chinese_Pope, Ya writ: << C is the answer and it always will be. >>

And the most recent version of that, according to Microsoft, is C++,
because they're not going the C99 route.

C++ is just as low as C, because cout and the STL are optional.

Jul 21 '05 #52
> P.S. Experienced C coders don't require weeks just to create a button.

I was making it sounding a little bit more dramatic. :-)
I was not referring to the button itself, but about the code behind that
button that should interoperate with the user interface.
E.g. active feed-back like a status bar, progress bar,....

---
http://www.skyscan.be
Jul 21 '05 #53
Olaf Baeyens wrote:
No one can predict the future.
Just wait and see. But at least I would advice you to look at C# otherwise
you risk to be outdated if the market moves in that direction. You don't
learn it overnight.


I thouroughly agree.

I can easily see a 'tipping point' for c# where java will all but be
eradicated.
Jul 21 '05 #54

Hi Olaf_Baeyens, Re: My comment that experienced C coders
don't require weeks just to create a button,

You told me: << I was making it sounding a little bit more dramatic. :-)
I was not referring to the button itself, but about the code behind that
button that should interoperate with the user interface.
E.g. active feed-back like a status bar, progress bar. >>

It takes years to really perfect code,
because testing dwarfs the time it took to bang out the code.

During those years, short-sighted compromises,
like using C#, Java, COM or HTML, can come back to bite you,
....beacuse the C++ guy could sneek up behind you and offer a better product.

Jul 21 '05 #55
> Properties don't slow down your code in the simple case:

The C# way maybe not but if I remember the properties in C++ the methods
must be virtual.

--
http://www.skyscan.be
Jul 21 '05 #56
> First you're all like low-level and stuff, and then you subscribe to a
garbage language like c++

c is the answer and it always will be.

c/unix/linux is the lingua franca of the whole world.


How odd that a lot of people claming that C is the top and linux is the top
tend to use fake names in the posts?
And that people that are more realistic actually are more brave to user
their real names.

--
http://www.skyscan.be
Jul 21 '05 #57
begin virus.scr Olaf Baeyens wrote:
First you're all like low-level and stuff, and then you subscribe to a
garbage language like c++

c is the answer and it always will be.

c/unix/linux is the lingua franca of the whole world.


How odd that a lot of people claming that C is the top and linux is the
top tend to use fake names in the posts?
And that people that are more realistic actually are more brave to user
their real names.


How come that you think that JBailo is actually a linux user?
Jul 21 '05 #58
> Nah, I just wrote the C++ socket library and an XDR packet library
implementation for our group, not to mention a unit test library, an NT
service base class, our audio library, a dictionary XML markup language library, and a library of string, filename, and other odds and ends. All in C++.

It sounds pretty impressive.

Just wondering:
* Did you create eveything from scratch and or did you start with an
existing library and added a few lines?
* Is it actually used, useable and more bug free?
* And if you move to another company, is that code readable so that someone
else can take over and extend it?

---
http://www.skyscan.be
Jul 21 '05 #59
On Thu, 07 Apr 2005 01:18:27 -0700, American Pope
<am***********@vatican.us> wrote:
Jeff_Relf wrote:
Hi Olaf_Baeyens ( and Linonut ),

Microsoft C++ is really it's latest version of MS_C,
as Microsoft is not supporting the latest C standard, C99.


First you're all like low-level and stuff, and then you subscribe to a
garbage language like c++

c is the answer and it always will be.

c/unix/linux is the lingua franca of the whole world.

all variants as pasty-faced dough languages for corporate pretty boys
who tote around UML diagrams in "architectural meetings".

:

Real men program in machine code through binary toggle switches on
front panels.
'C' is for wimps.
Jul 21 '05 #60

Hi Tom_Shelton ( and Olaf Baeyens ),

I like low_level coding, not because it's faster ( although it usually is ),
but because it, and only it, does what I want.

I'll write slower code if I think it makes the source code look better.
The look of the souce code is very important to me,
hence I don't use things like String, cout or the STL.

Also, for greater readability, I put the simplest code in the true part,
e.g.:
// Because it's in another timezone,
// subtract one from the_day_of_the_month ( Day_There ),
// rolling back to the earlier month, if required.

Day_There = Day_There > 1 ? Day_There - 1 : DpM [ M = ! M ? 11 : M - 1 ]

The code above is from:
http://www.Cotse.NET/users/jeffrelf/X.CPP

Re: public int MyProperty {
get { return this.myProperty; }
set { this.myProperty = value; } }

get()s and set()s in classes like that are too ugly to live... too nested.

Jul 21 '05 #61

Hi Olaf_Baeyens ( and Peter_Kohlmann, Bailo ),

You asked: << Odd, why would somone name a screen saver with my name in it
and send as an attachment it to this newsgroup ? >>

Pete started his post with: << begin virus.scr Olaf Baeyens wrote: >>
I he does that because of his brain tumor, I believe.

Also, Pete, as a demo of Linux's Knode in action,
redirected your post to parts unknown... again, I blame it on his tumor.

You asked: << How odd that a lot of people claming that C is the top
and linux is the top tend to use fake names in the posts ?
And that people that are more realistic
actually are more brave to user their real names. >>

Jeff_Relf is my given name, I was born in Seattle at the start of 1960.
Bailo, a.k.a. Chinese_Pope, is a rapid nymshifter in Comp.OS.Linux.Advocacy .

C# might well be the best language for certain things,
just not the things that do.

Jul 21 '05 #62

Hi Michael_Gray, Ya writ: << Real men program in machine code
through binary toggle switches on front panels. C is for wimps. >>

No, Real men design and forge their own CPUs, using ores dug out by hand.

Jul 21 '05 #63
> You asked: << Odd, why would somone name a screen saver with my name in
it
and send as an attachment it to this newsgroup ? >>

Pete started his post with: << begin virus.scr Olaf Baeyens wrote: >>
I he does that because of his brain tumor, I believe.
Odd that the "virus.scr Olaf Baeyens wrote" part ended up as an attachment
in Outlook express.
And who is JBailo???

But the real message would have looked like this I assume:

--------------begin virus.scr Olaf Baeyens wrote:
First you're all like low-level and stuff, and then you subscribe to a
garbage language like c++

c is the answer and it always will be.

c/unix/linux is the lingua franca of the whole world.


How odd that a lot of people claming that C is the top and linux is the
top tend to use fake names in the posts?
And that people that are more realistic actually are more brave to user
their real names.


How come that you think that JBailo is actually a linux user?

Jul 21 '05 #64
begin virus.scr Olaf Baeyens wrote:
You asked: << Odd, why would somone name a screen saver with my name in it
and send as an attachment it to this newsgroup ? >>

Pete started his post with: << begin virus.scr Olaf Baeyens wrote: >>
I he does that because of his brain tumor, I believe.

Odd that the "virus.scr Olaf Baeyens wrote" part ended up as an attachment
in Outlook express.


What do you think is odd about that? After all OE is a POS, a steaming one
at hat
And who is JBailo???


A retard. Posts under dozens of different names, to escape killfiles
He is no linux user, although he often pretends to be one. That only fools
widiots

< snip >

end
--
begin untitled1.pif
Hi. I'm a real nasty virus. Download me
end

Jul 21 '05 #65
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...

Hi Tom_Shelton ( and Linønut ),

What do you do if there's a bug, or something You think is bug,
in C#'s high_level routines ? What if they just don't do what you want ?
Report it as a bug and/or write your own high-level routine using low-level
C# (i.e. unsafe code/interop/pinvoke) just like you would in any programming
language.
C#'s high level routines are compromises, where people say:
A-a-aw, hell, it's good enough, I'll just go with it.
Really? Which of the developers of those libraries told you that?
If you want the best code, if you want code that can stand the test of
time,
you need MS C++ 7.1 ( which is, de facto, the latest C from Microsoft ).
The "best" code? I thought the quality of code was independent of the
language. I can write better code in VB.NET than many people can in C++. The
best language for the job depends on the job, and frankly I've written
business systems in many languages, and I've found C# to be more than
adequate for the job, and it gives me more productivity than C++.
Besides, it's not like MS_C has no libraries to draw on,
e.g. no Direct_Draw_7, or no COM.

If you're not picky, or you just don't have the experience under your
belt,
you can go with C#, Java... or even HTML, for that matter.


Please, do you really believe that the more experienced you are the more you
tie yourself to one solution? Are you trying to assert that C# developers by
definition have less experience than C++ developers? Keep in mind that many
C# developers come from a C++ background. I'd say that having a "religious"
devotion to one programming language is the surest sign of a developers
immaturity, not which language they happen to use.
Jul 21 '05 #66
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...

Hi Tom_Shelton ( and Olaf Baeyens ),

I like low_level coding, not because it's faster ( although it usually
is ),
but because it, and only it, does what I want.
So, if you want to draw a rectangle to the screen, you directly manipulate
the screen buffer I take it?
I'll write slower code if I think it makes the source code look better.
The look of the souce code is very important to me,
hence I don't use things like String, cout or the STL.
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.
Also, for greater readability, I put the simplest code in the true part,
e.g.:
// Because it's in another timezone,
// subtract one from the_day_of_the_month ( Day_There ),
// rolling back to the earlier month, if required.

Day_There = Day_There > 1 ? Day_There - 1 : DpM [ M = ! M ? 11 : M - 1 ]

The code above is from:
http://www.Cotse.NET/users/jeffrelf/X.CPP
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.
Re: public int MyProperty {
get { return this.myProperty; }
set { this.myProperty = value; } }

get()s and set()s in classes like that are too ugly to live... too nested.

Jul 21 '05 #67
"Montrose..." <ro***@trower.rocks> wrote in message
news:42**************@trower.rocks...
Given that it was recently shown that only 25 percent of corporations
installed SP2 for XP what makes you think everyone's in a rush to install
.NET?


Most people couldn't care less to be honest. They buy a CD or a solution and
they install it. They generally don't give a damn whether it's .NET or not.
Jul 21 '05 #68
begin virus.scr Sean Hederman wrote:
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...

Hi Tom_Shelton ( and Olaf Baeyens ),

I like low_level coding, not because it's faster ( although it usually
is ),
but because it, and only it, does what I want.


So, if you want to draw a rectangle to the screen, you directly manipulate
the screen buffer I take it?


Why do you think that any "discussion" with this Relf cretin should be on
topic in a linux group? That idiot has less knowledge how to code than a
demented cow of nuclear energy. And he is a windows user, with absolutely
no linux knowledge.
So, get lost

< snip Relf garbage >
Jul 21 '05 #69
> Please, do you really believe that the more experienced you are the more
you
tie yourself to one solution? Are you trying to assert that C# developers by definition have less experience than C++ developers? Keep in mind that many C# developers come from a C++ background. I'd say that having a "religious" devotion to one programming language is the surest sign of a developers
immaturity, not which language they happen to use.

A good developer will adapt to what he has available.
A good developer will probably mix different technologies and languages in
order get the project done.
A good developer will probably try newer technologies and OS'es in order to
understand what is good or not.
A good developer does not live in the past when everything was better, but
evolves to what user wants.

Any other stuff I have forgotten?

PS: Personaly I would program in Assembler, because that would prove my real
skill and I love doing it, but sadly enought we live in a world where skill
is not that important but what you produce in a resonable interval that is
competitive. So my second choice is C#.
Jul 21 '05 #70
Tom Shelton poked his little head through the XP firewall and said:
On 2005-04-06, Linønut <linønu*@bone.com> wrote:

That would be extremely difficult to prove.

3 Words - Time To Market.
I don't buy that. Not at all. Not when C++ is so easy to use for an
experienced programmer.


I think it has been born out by the fact that C++ is almost no where in
the development of inhouse line of buisness applications. Almost all of
those are VB or Java.


"inhouse line of business applications" -- can you give me some examples of
such applications, as I'm not familiar with this particular application
niche.
Know you don't. But, there seems to be too much bias to make you ever
stop and look at it.
Tom, I don't have time to stop and look at it. Between work (which is at a
stage right now when it is boring as hell [documentation, and not even
design documentation at that]), soccer, a soccer web-site (very basic,
pure HTML), house/lawn stuff, and journals, and then trying to catch up on
sleep, of which there is never enough, and then the pollen kicking my ass,
and then this fricking newsgroup........

(prolonged whining from Linønut and catcalls of "You think you're
something special?" from the penis gallery)

All useless whining aside, my suspicion is that, at some point, I will get
training, and all parties here will agree that it be MCAD training, because
we have another project group that uses C#/.NET heavily and they may at some
point have work available.

So, although C# isn't high on my personal list, it looms at work.
Yep - that's C#. And what the! It's using pointers!


So what?


Well, there seems to be this bias that C++ is the great and almighty
language because it allows direct memory manipulation... Well, other
then mutiple inheritance, I can't really think of much I can't do in C#
that I could do in C++.


The attraction of C++ for me is manifold:

o a mature language
o standards-based
o in wide-spread use
o Free and open tools for it
o A tremendous and deep library, including the STL and locale support

That doesn't mean that other languages don't have similar attributes.
However, I started early down the C path, and C++ is my language. There are
features of Java and C# that look interesting, but nothing that says, "Oh
yeah, I gotta dump 25 years of study and switch."

I'm impressed that a C++ guru like Herb Sutter is interested in C#, but it
will take a real need for it to get me into it.
C# is not the great baby sitter that Java is. That's one of the reasons
I like it - and have really liked Java.


--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #71
billwg poked his little head through the XP firewall and said:
Linønut wrote:
So is C++, which is what we use for our Windows users and servers.


C++ is wonderful for native Windows code, nut, but you better get .NET
if you want to be relevant next week! Being philosophic about linux and
Windows and even languages is fine for argument, but if you want to keep
up with the wave, you have to surf and today that means .NET and that
really means C# or VB.Net. So if you have to walk the plank, which one
do you choose?


Save your marketing shpiel for the pointy-haired boss.

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #72
"Olaf Baeyens" <ol**********@skyscan.be> wrote in message
news:42***********************@news.skynet.be...
[Snip]
PS: Personaly I would program in Assembler, because that would prove my
real
skill and I love doing it,


You love programming Assembler? I've done it, I'm glad I did it, and I'm
very, very happy I don't have to do it again (touch wood).
Jul 21 '05 #73
Sean Hederman poked his little head through the XP firewall and said:
So by that argument a programming language is as old as it's most recent
incarnation? Okay.
Of course. How many functions like this do you see nowadays?

int myfunc (s, i)
char * s;
int i;
{
// do some stuff that might accidentally modify s
}
However, I am loath to give up the STL, for example.


The upcoming version of .NET has an STL-like library called STL.NET.
Needless to say it has to be somewhat different because of the differences
between generics and templates.


I'm sure, as time goes on, that this library will get all its kinks worked
out.
Since they're Windows (and by implication Windows-only, since that was my
implication) users why exactly are you using a language that means a
guaranteed slower development and guaranteed more bugs? To me, it just
doesn't make sense. C++ has it's place, but standard Windows business apps
are not one of them.


Because it doesn't guarantee slower development and more bugs, in our hands.

Also, we aren't doing "standard Windows business apps", we're doing
client/server stuff on a small network and reading information of off
ancient hardware.

Next you'll be telling me we should be using LabView!

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #74
Tom Shelton poked his little head through the XP firewall and said:
On 2005-04-06, Linønut <linønu*@bone.com> wrote:
Nah, I just wrote the C++ socket library and an XDR packet library
implementation for our group, not to mention a unit test library, an NT
service base class, our audio library, a dictionary XML markup language
library, and a library of string, filename, and other odds and ends. All
in C++.


Most of which exist as native .NET components... And would never have
to be written in C# because they already exist. This is what I meant by
Time-To-Market. With C#, you spend more time worrying about the problem
then writting socket libraries and service base classes...

Sockets - System.Net and System.Net.Sockets
Service base class - System.ServiceProcess.ServiceBase (along with a
whole bunch of classes to support the manipulation of services).
Unit Testing - NUnit (not part of .NET properly, but it is a freely
available product written entirely in C#)
String - System.String, System.Text, System.Text.RegularExpressions
FileName - System.IO, System.IO.Path
XML stuff - System.XML. I'm not sure what your's does exactly, but I'm
sure there is something close or would be simpler to implement.

I'm not dissing you. I'm just pointing out that there is a reason that
VB and Java were more popular for buisness programming... Less bugs, and
less time to market.


I've been burned too many times by crap libraries (MFC is the best example)
to blithely adopt someone else's code. In fact, our socket code, for
example, is based on Common C++. Worked for us.

Yet, when I looked into it deeper (and made some fortuitous discoveries on
google), I found some features of that library (and our use of it) that were
not optimal. I stripped down the CC++ sockets code to bare essentials,
eliminated exception handling, fixed some bugs, added a run-time error
logging, incorporated some really fast code for dealing with threads, wrote
a wrapper for some synch objects (and added condition variables, which Win32
lacks).

Much happier with the library now.

Oh, I forgot to mention I did a lot of the work on my own time, so in part
this was simply a fun project. And I may be able to get a tech article or
two out of it, to get some more freakin' CSDP points.

Anyway, I guess that sounds like idle boasting. What I'm trying to get
across is that you can't always rely on black-box code (even if the source
is available). It can be problematic.

Also, libraries are best if they provide building blocks, because that's
really all they can do well in the general case. Our socket libraries do
involve a C++ wrapper around C. However, they also implement our particular
model for doing things, and you will not (most likely) find it ready-made in
some library.
Yeah, a side application, that's the right term.

There's more to programming than "kewl apps" and GUIs. In fact, the GUI
code is by far the easiest part of most applications.


Actually, I disagree :) I have always like the non-gui parts the best.


Does not parse.

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #75
Tom Shelton poked his little head through the XP firewall and said:
public int MyProperty
{
get
{
return this.myProperty;
}
set
{
this.myProperty = value;
}
}


Actually, this looks pretty neat, much cleaner-looking than defining
const MyProperty & operator = (int i) and operator int ().

I assume C# allows statement such as:

a = b = c = d;

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #76
Olaf Baeyens poked his little head through the XP firewall and said:
First you're all like low-level and stuff, and then you subscribe to a
garbage language like c++

c is the answer and it always will be.

c/unix/linux is the lingua franca of the whole world.


How odd that a lot of people claming that C is the top and linux is the
top tend to use fake names in the posts? And that people that are more
realistic actually are more brave to user their real names.


Ridiculuous statement.

I do it for two reasons:

1. It really cuts down on the spam I get, in a major way.

2. I tend to curse a lot when I write, or get obnoxious, and
it is unpleasant to google for your own name and see some
of your more insane postings. <oy vey!>

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.
Jul 21 '05 #77
> You love programming Assembler? I've done it, I'm glad I did it, and I'm
very, very happy I don't have to do it again (touch wood).

Yes I really love it. It is my first nature to program in assembler.

I started with Z80, then 8080, 8085, 6500, 6800, 6809, 68000,..., before I
learned C.
Later I learned 8088,... 80486 including real mode and protected mode.

Right now I only use my assembler knowledge to check how the code I create
compiles to machine language so I can help the compiler to create even more
optimized code. But I do not lose time to optimize code that is not time
critical. User friendlyness is in most cases my prefered way of optimizing.
Jul 21 '05 #78
> Most people couldn't care less to be honest. They buy a CD or a solution
and
they install it. They generally don't give a damn whether it's .NET or not.

True, but the problem is that it is not that easy to install the .NET on a
machine that has not yet installed it.
How many different language .NET framework redistributables exist for v1.1?
All of the above 20 MB.
And this is a big pitfall in accepting to install the .NET framework by the
users.

The problem is that users like my grandmother gets an heart attact if you
say to her that she needs to go to windows update and then install the .NET
framework.

If your users are only English people, then you can provide a simpler
installer that automatically installs the English .NET framework, but what
do you do if the user is German? French? Force that user to install then
English version?

But once the .NET framework is installed as part of the OS, in the future,
then everything will be just fine. :-)
Jul 21 '05 #79

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.

Jul 21 '05 #80
Linønut wrote:

"inhouse line of business applications" -- can you give me some examples of
such applications, as I'm not familiar with this particular application
niche.
Heavens, nut, you're totally missing the boat! Too much time spent
defending the OSS initiatives probably.

This kind of stuff is the mainstay of programming and the reason that
Microsoft and Sun and IBM and all the others are so filthy rich while
you get assigned to documentation duties.

As an example, take a company that wants to automate their accounts
payable system for reimbursing salesmen for their excessive travel and
entertainment account expenses. They will do an "inhouse business
application" using their own staff, if the company is large enough, or a
local "consultant" if they don't have their own staff.

The system would be designed with a database piece, e-mail notification
piece, website webform piece, etc. These are the kinds of applications
that Java was created for and is principally used for and also where
..NET mostly lives.

What Microsoft has done is flesh out the java language, which was sort
of a subset of C++ to begin with, a little, but mostly the .NET
framework means the System namespace functions that make it so easy for
an applications person to conjure up a highly functional business app.
You have to see it to understand it.

If you are familiar with C++ in system situations, as you say, think
about what it takes to connect a program to a database, authenticating
the user and keeping him in a safe sandbox, querying for necessary
information and presenting it for edit/create/update. It takes some
code and takes some iterations and takes some time, no matter how great
you are at C++ and the interfaces you have to access.

With .NET and C# or VB.NET (doesn't matter, they are the same thing in
the end) you just graphically access a data connection and stored
procedure and whatever presentation controls make sense, dragging them
onto the form and giving them names if you don't like DataConnection1,
and DataAdapter2, and suchlike naming. The .NET plumbing is
automatically hooked up by simple wizard-generated code and you are
ready to test.

..NET goes beyond java in dumbing down the computer science to a point
where it is simple rote actions and all you need to know is application
dependent information, such as what you want the application to do
vis-a-vis the business. This so-called business logic still needs to be
directly coded into the application's forms or modules, but you can get
away with knowing next to nothing at all about the plumbing behind the
scenes.

Jul 21 '05 #81
Sean Hederman wrote:
Tried a couple of other newsreaders, didn't like them. Got any good
suggestions that run on Windows?


Agent or Free Agent.

Jul 21 '05 #82
Jeff_Relf wrote:
Hi Olaf_Baeyens, Re: My comment that experienced C coders
don't require weeks just to create a button,

You told me: << I was making it sounding a little bit more dramatic. :-)
I was not referring to the button itself, but about the code behind that
button that should interoperate with the user interface.
E.g. active feed-back like a status bar, progress bar. >>

It takes years to really perfect code,
because testing dwarfs the time it took to bang out the code.

During those years, short-sighted compromises,
like using C#, Java, COM or HTML, can come back to bite you,
...beacuse the C++ guy could sneek up behind you and offer a better product.

A lot of hypothetical results and not much logic there, Jeff.

With C# the button is already designed and you just drag it into the
product from a list and place it on a form that uses it. The code
behind it is mostly there automatically. You can give it a name that
you like, else the IDE will give it a unique name anyway. It likes to
start with Button1.

Jul 21 '05 #83

Hi Linonut, Re: Why you don't use your real name,

I use my real name, and, although I have written some embarrassing stuff,
I can't think of who'd care about that or why.

Also, I barely remember what spam is, I get so little of it.

On_the_fly e-mail aliases via Cotse.NET kills spam dead.
Aliases allow me to precisely identify all senders,
....I kill the sender's alias if he bothers me.

My hyper_custom e-mail client, X.EXE, automatically assigns aliases.

Firefox, of course, blocks all pop-ups and makes Flash Click_to_play.

Jul 21 '05 #84
American Pope wrote:
Jeff_Relf wrote:


*plonk*

Jul 21 '05 #85
Sean Hederman wrote:
"Jeff_Relf" <Me@Privacy.NET> wrote in message


*plonk* for feeding a cross-posted troll.

Jul 21 '05 #86

Hi Olaf_Baeyens, Re: Pete's: << begin virus.scr Olaf Baeyens wrote: >>,
Ya told me: << Odd that the " virus.scr Olaf Baeyens wrote " part
ended up as an attachment in Outlook express. >>

That's an Outlook flaw. I recomend that you use 40tude_Dialog instead.

You asked me: << And who is JBailo ??? >>

I have No idea, but I think he's the Don Quixote of Linuxdom.
His/Her real name is Joan_Fickle_Bailo .
I love his posts because he's the only one 'round here that talks about:
Food, music, sex, jokes, computers, physics, Seattle, securities, etc.

Everyone else is too worried about being Off_Topic .

Re: Peter_Kolemann's insane posts, You asked: <<
But the real message would have looked like this I assume: ... >>

Use Google's advanced search to find Pete's:
news:d3*************@news.t-online.com
and then click the link that shows you the Original article.

Jul 21 '05 #87
>> Hi Olaf_Baeyens, Re: Pete's: << begin virus.scr Olaf Baeyens wrote:
,
Ya told me: << Odd that the " virus.scr Olaf Baeyens wrote " part
ended up as an attachment in Outlook express. >>

That's an Outlook flaw. I recomend that you use 40tude_Dialog instead.

Outlook flaw or not, his mesages are the only ones that I cannot read.
And I am not going to decode every message he sends.

But I am wondering why the "virus.scr" part is included in the text?
A "virus"= something bad.
A ".scr" = screen saver on Windows machines.

And a "virus.scr" seems to look like a screen saver containing a virus from
the point of simple user view.
Especially when found in the attachment and when clicked has a attachment
filename: "virus.scr Olaf Baeyens wrote"

Unless it is his intention to scare people or shock people, it is not a very
wise choice to keep it like that even when it is a bug in Outlook express.
Jul 21 '05 #88

Hi billwg, Re: How a C++ coder could easily beat a C# coder,
You told me: << A lot of hypothetical results and not much logic there, Jeff.
With C# the button is already designed
and you just drag it into the product
from a list and place it on a form that uses it.
The code behind it is mostly there automatically.
You can give it a name that you like,
else the IDE will give it a unique name anyway.
It likes to start with Button1. >>

C#'s dialog editor stinks.
Your Button1, for example, is just a window of the BUTTON class,
and it doesn't scale well to different screens.

Fonts are often too small or too large,
and text often doesn't fit inside the Button1, for example.

My X.CPP employs only one window, created by a call to CreateWindowExA().
The window is always maximized, with only Win_XP's Start bar showing,
it has no pop-ups as a rule.

Black is always the background color, even when highlighting,

The font is always 80 columns, monospaced,
with nothing automatically wrapped, as a rule
....wrapping is done only by hand.

Of course X has no editor at the moment, it uses Visual_Studio,
so who am I to talk ?

But just the Idea of writting my own editor,
using only one window, appeals to me.

Jul 21 '05 #89

Hi Olaf_Baeyens, Re: Peter_Kolemann's tolling,
You told me: << Outlook flaw or not,
his mesages are the only ones that I cannot read.
And I am not going to decode every message he sends. >>

You're not missing anything trust me. He does that to annoy people.
He redirects people's relies to him to parts unknown for the same reason.

You asked me: <<
But I am wondering why the "virus.scr" part is included in the text ?
A "virus"= something bad. A ".scr" = screen saver on Windows machines.

And a "virus.scr" seems to look like
a screen saver containing a virus from the point of simple user view.
Especially when found in the attachment
and when clicked has a attachment filename: "virus.scr Olaf Baeyens wrote"

Unless it is his intention to scare people or shock people,
it is not a very wise choice to keep it like that
even when it is a bug in Outlook express. >>

People tell him that all the time,
that's about that only thing he enjoys talking about,
....you just made his day.

Jul 21 '05 #90
Olaf Baeyens wrote:
Unless it is his intention to scare people or shock people, it is not a very
wise choice to keep it like that even when it is a bug in Outlook express.


Idiot. It's obviously intentional.

Jul 21 '05 #91
In article <xt********************@comcast.com>, Linønut wrote:
Tom Shelton poked his little head through the XP firewall and said:
public int MyProperty
{
get
{
return this.myProperty;
}
set
{
this.myProperty = value;
}
}


Actually, this looks pretty neat, much cleaner-looking than defining
const MyProperty & operator = (int i) and operator int ().

I assume C# allows statement such as:

a = b = c = d;


Yes...

--
Tom Shelton
Jul 21 '05 #92
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...
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 ; }
Ummm, actually it does nothing of the sort. Swapping the high and low bytes
of the number 32 gives me 536870912, and your result is 538976288. And in C#
the code would be:
int swapped = System.Net.IPAddress.NetworkToHostOrder(unswapped) ;

So, not only is your code wrong, but I can get the *correct* result in one
line. Oh and by the way I tested NetworkToHostOrder and it *does* swap the
bytes correctly.

[Snip a whole bunch of crappy macro-infested spaghetti code] main() {
printf( "%s"
, LowerCaseNG ( "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy" ); LOOP; }
string name = "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy";
Console.Write(name.ToLower());
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 ?
Nope, been headhunted 4 times in that period though.
Only coding has paid my rent ever since the start of 1982... how about you
?
Coding is my sole means of support, has been since I left varsity, and I
live a very comfortable life, if that's what you're asking.
I've never been fired or sued... how about you ?
Being employed has never been a concern of mine... how about you ?
Nope and nope.

[Snip more "code"] Loop() is great shorthand, much better than for(;;) or whatever it is you
use.
Um, and having LOOP and Loop defined? You don't think that's a bad idea.
Look, if you want to write BASIC, it's much easier just to get a BASIC
compiler than to try to #define C++ into it.
I only care about what makes my code more readable,
You honestly believe that drek is readable? No comments, spaghetti code,
#define abuse that should be criminal, and non-semantic variable names.
your delusions about being my employer don't interest me in the least.

Jul 21 '05 #93
"Linønut" <"=?iso-8859-1?Q?lin=F8nut?="@bone.com> wrote in message
news:xt********************@comcast.com...
I assume C# allows statement such as:

a = b = c = d;


Yes it does
Jul 21 '05 #94
"Montrose..." <ro***@trower.rocks> writes:
Olaf Baeyens wrote:
No one can predict the future.
Just wait and see. But at least I would advice you to look at C# otherwise
you risk to be outdated if the market moves in that direction. You don't
learn it overnight.


I thouroughly agree.

I can easily see a 'tipping point' for c# where java will all but be
eradicated.


It won't be any time soon, though. After all, COBOL is still being used
for a lot of new development, and Java is getting to be just as embedded.

--
Tukla, Squeaker of Chew Toys
Official Mascot of Alt.Atheism
Jul 21 '05 #95
"Linønut" <"=?iso-8859-1?Q?lin=F8nut?="@bone.com> wrote in message
news:HN********************@comcast.com...
Sean Hederman poked his little head through the XP firewall and said:
C++ has it's place, but standard Windows business apps
are not one of them.
Because it doesn't guarantee slower development and more bugs, in our
hands.


Never once had a dangling pointer, unreclaimed memory, or a buffer overflow
then? C# has an easier syntax with less typing for the most part, so
logically if one was as proficient in C# as in C++, one's productivity would
be higher. This excludes the various visual designers and the powerful
libraries.
Also, we aren't doing "standard Windows business apps", we're doing
client/server stuff on a small network and reading information of off
ancient hardware.
Unless there's serious resource constraints/portability requirements, C#
should be able to do that easily.
Next you'll be telling me we should be using LabView!

--
When all you have is a hammer, everything looks like a nail.
When all you have is Microsoft software, everything looks like Windows.

Jul 21 '05 #96
"Olaf Baeyens" <ol**********@skyscan.be> writes:

< snip >
And that people that are more realistic actually are more brave to user
their real names.


How is that "brave"?

--
Tukla, Squeaker of Chew Toys
Official Mascot of Alt.Atheism
Jul 21 '05 #97
Sean Hederman wrote:
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...
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 ; }

Ummm, actually it does nothing of the sort. Swapping the high and low bytes
of the number 32 gives me 536870912, and your result is 538976288. And in C#
the code would be:
int swapped = System.Net.IPAddress.NetworkToHostOrder(unswapped) ;


The one thing that Relf's code does has hands down is speed.

For example, he built a search module that can find all matches in < 1ms.

I rewrote the search in c#.net, c#.mono (run on Linux) and java (run on
windows/linux).

In each case the search was from one ( ~10ms ) to two orders of
magnitude ( ~100ms ) ( java being the fastest and c#.mono being the
slowest ). .Net's problems with Regex have been documented around the
web. And when I looked at the mono source code it was using a modified
verion of a standard text search algorithm, whereas Relf had written his
own search...my guess is that he used a far less efficient algorithm.

In a situation where you want to substitute the .Net libraries for c,
you then have to accept order of magnatude decrease in performance?!

So, not only is your code wrong, but I can get the *correct* result in one
line. Oh and by the way I tested NetworkToHostOrder and it *does* swap the
bytes correctly.

[Snip a whole bunch of crappy macro-infested spaghetti code]
main() {
printf( "%s"
, LowerCaseNG ( "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy" ); LOOP; }

string name = "Alt.OS.Windows-XP, Comp.OS.Linux.Advocacy";
Console.Write(name.ToLower());

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 ?

Nope, been headhunted 4 times in that period though.

Only coding has paid my rent ever since the start of 1982... how about you
?

Coding is my sole means of support, has been since I left varsity, and I
live a very comfortable life, if that's what you're asking.

I've never been fired or sued... how about you ?
Being employed has never been a concern of mine... how about you ?

Nope and nope.

[Snip more "code"]
Loop() is great shorthand, much better than for(;;) or whatever it is you
use.

Um, and having LOOP and Loop defined? You don't think that's a bad idea.
Look, if you want to write BASIC, it's much easier just to get a BASIC
compiler than to try to #define C++ into it.

I only care about what makes my code more readable,

You honestly believe that drek is readable? No comments, spaghetti code,
#define abuse that should be criminal, and non-semantic variable names.

your delusions about being my employer don't interest me in the least.


Jul 21 '05 #98
"Sean Hederman" <em*******@codingsanity.blogspot.com> writes:

< snip >
Tried a couple of other newsreaders, didn't like them. Got any good
suggestions that run on Windows?


I used Forte Free Agent for many years, even after I'd switched to
Linux (ran it under Win4Lin). Of course, I don't use killfiles....

--
Tukla, Squeaker of Chew Toys
Official Mascot of Alt.Atheism
Jul 21 '05 #99
In article <42**************@vatican.us>, American Pope wrote:
Sean Hederman wrote:
"Jeff_Relf" <Me@Privacy.NET> wrote in message
news:Je***********************@Cotse.NET...
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 ; }

Ummm, actually it does nothing of the sort. Swapping the high and low bytes
of the number 32 gives me 536870912, and your result is 538976288. And in C#
the code would be:
int swapped = System.Net.IPAddress.NetworkToHostOrder(unswapped) ;


The one thing that Relf's code does has hands down is speed.


Fast code that doesn't work is pretty much usless.

--
Tom Shelton
Jul 21 '05 #100

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: tada991 | last post by:
Hello Everyone, I just purchased Visual Studio .Net Architect 2003 and want to know what's a good book for begginers to start with. I know nothing about programming whatsoever, but I do have a...
29
by: RAY | last post by:
Hi , my boss has asked I sit in on an interview this afternoon and that I create some interview questions on the person's experience. What is C++ used for and why would a company benefit from...
22
by: Ramzy Darwish | last post by:
Hello, I have a Bachelors in CS and a Masters in Comp. Graphics. In all of my schoolwork, I used C and C++ and thought that I had a pretty good understanding of the language(s). But now, as I...
11
by: Sam | last post by:
Hi All I don't know anything about C# and I'm planning to learn the language. Does anyone know any good book out there that explains things well? Any suggestion is greatly appreciated ...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
269
by: Montrose... | last post by:
After working in c# for a year, the only conclusion I can come to is that I wish I knew c. All I need is Linux, the gnu c compiler and I can do anything. Web services are just open sockets...
15
by: Alex L Pavluck | last post by:
I am new to programming other than SAS. I read that C# is a good starting language and I have started to create some simple programs with C# 2005 express edition. Can someone let me know if this...
6
by: Jamiil | last post by:
I am not a programmer by any means, but a dedicated aficionado. I have good understanding of Java and C/C++, and now I would like to learn javascript->ajax, but I don't know where to start. My HTML...
5
by: vinnie | last post by:
i wish to start programming with OOP, but i have no experience: can anyone tell me what book should i buy to learn it? I have a good knowledge of programming, but absolutely zero of OOP. Also,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.