c# is a good way to learn c

O

Olaf Baeyens

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?
 
J

Jeff_Relf

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.
 
J

Jeff_Relf

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.
 
J

Jeff_Relf

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.
 
O

Olaf Baeyens

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:

--------------
 
G

Guest

begin said:
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
 
S

Sean Hederman

Jeff_Relf said:
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.
 
S

Sean Hederman

Jeff_Relf said:
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.
 
S

Sean Hederman

Montrose... said:
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.
 
G

Guest

begin said:
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 >
 
O

Olaf Baeyens

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#.
 
?

=?iso-8859-1?Q?Lin=F8nut?=

Tom Shelton poked his little head through the XP firewall and said:
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.
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.
 
?

=?iso-8859-1?Q?Lin=F8nut?=

billwg poked his little head through the XP firewall and said:
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.
 
S

Sean Hederman

[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).
 
?

=?iso-8859-1?Q?Lin=F8nut?=

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
}
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!
 
?

=?iso-8859-1?Q?Lin=F8nut?=

Tom Shelton poked his little head through the XP firewall and said:
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.
Actually, I disagree :) I have always like the non-gui parts the best.

Does not parse.
 
?

=?iso-8859-1?Q?Lin=F8nut?=

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;
 
?

=?iso-8859-1?Q?Lin=F8nut?=

Olaf Baeyens poked his little head through the XP firewall and said:
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!>
 
O

Olaf Baeyens

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.
 
O

Olaf Baeyens

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. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top