c# is a good way to learn c

T

Tom Shelton

Tom Shelton poked his little head through the XP firewall and said:


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.

Don't get me wrong... I still like C++, though I haven't had much call to use
it in the last 3 or 4 years....
You never know.

Know you don't. But, there seems to be too much bias to make you ever
stop and look at it.

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 difference is that I almost never have to
:) The only time I do stuff like the above is when I find that I can
create a faster implementation that way via profiling. In fact, the
above snippit of C# code is something like 400x faster then the
equivalent varifiable code.

C# is not the great baby sitter that Java is. That's one of the reasons
I like it - and have really liked Java.
 
T

Tom Shelton

tab poked his little head through the XP firewall and said:


Big deal. They sound like doofuses. They problem don't even know how to
use the STL. You could probably beat them just as well if you used straight
C.


I don't do GUIs at the moment. Other people do it here, using Qt.


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

American Pope

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

Well...actually the real workhorses are all written in COBOL and RPG-III.

What c++, c#, java and VB fight over are the 15 percent 'glamour'
applications that corporations spent at the high end of their budget.
 
S

Sean Hederman

[Snip]
I understand the dates, my friend. It is the juxtaposition of assertions
to
which I object:
1. The Linux kernel is not based on UNIX. It was written from scratch
with
some knowledge of Minix. It has since acquired a few UNIX traits, but
most true UNIX guys still sneer at the Linux kernel.

Ah, finally a real argument. The Linux kernel is very similar in
architecture to UNIX, and very dissimilar to Minix (see the Tanenbaum/Linus
flamefest). It uses the same fork() copy that made sense on a PDP-7, but
doesn't really in this day and age. The same file-based security system
(hacked up a bit but still recognisable) that is so coarse-grained and
inflexible. I wasn't asserting that Linux was *completely* copied from UNIX,
but the architecture is pretty much the same. About the biggest shift away
from the traditional UNIX architecture is the vastly improved modularity.
2. The C used for Linux is, as far as I can tell, pretty much ISO C99 with
some GNU extensions. Unitl recently you could only use this C, gcc, to
compile the Linux kernel (now you can also use Intel's fine compiler.)
Since ISO C99 was ratified around 1999, and contains much more
complexity
and features over the original C (which I first encountered only about
25
years ago), I would hardly say that Linux is written in a 33-year-old
programming language.

So by that argument a programming language is as old as it's most recent
incarnation? Okay.
They can do that. Nonetheless, when you develop for certain project (e.g.
the Linux kernel and the devices drivers) you *will* use C, and it
will be formatted using kernel coding conventions.

Naturally, I never said otherwise.
For better or worse, it is essentially a Microsoft product. Microsoft is
being more reasonable about the openness of C# than Sun is about Java, and
there is one Linux C# project, and C# does have some 3rd party support, as
I
understand it.

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.
So is C++, which is what we use for our Windows users and servers.

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

Montrose...

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

Wow...you make a lot of assumptions.

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

Arkady Duntov

Yes but the Linux kernel is also based on a 40-year old architecture

Your statement is more or less true but it's irrelevant. Saying Unix (or
Linux) isn't new doesn't say anything bad (or bad) about them. Linux is
certainly based, at least in part, on a design originally from the 1960s,
and its because the basic design is simple, useful, and effective. Unix
and Linux itself have both undergone major changes since their
originations.
so I suppose writing it in a 33-year old programming language> makes a
certain sick kind of sense...

Similarly, the C programming language is still in use because its basic
design is simple, useful, and effective for its intended purpose.
The thing is that C has it's place, but it's certainly not every place. If
you were to tell me that I should write business solutions using C, I'd
have to ask what you were smoking.

This is the "tab" argument, using the "solution" buzzword, but completely
lacking in detail. If performance is critical, and must be predictable,
languages like C (and C++) are indispensable. When these are not primary
considerations, C (or C++) may well be a bad choice.
 
O

Olaf Baeyens

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.
As for being old, we'll come back to laugh at you for using C# when C++0x is
available, and you're a doddering old man like myself.
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.
 
J

Jeff_Relf

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.

cout and the STL are pure garbage and should not be used, I say.
All the same, I use C++ ( MS_C_7 )
as it allows be to declare variables in_between statements.

I also use C++'s & a lot as references look cleaner than pointers.

C has been around for a long time,
and will continue to be around long after C# and Java are forgotten.

The higer a language is,
e.g. VBA scripts in MS_Word, the shorter it's lifespan.

The problem with high_level languages like C# and Java
is that they never quite reach the status of being a genuine standard,
as few can agree on what the higher level stuff should look like.

Higer level code is always specialized and often full of unfixable bugs.

P.S. Experienced C coders don't require weeks just to create a button.
 
A

American Pope

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

Jeff_Relf

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 ?

C#'s high level routines are compromises, where people say:
A-a-aw, hell, it's good enough, I'll just go with it.

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

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

Tom Shelton

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

Jeff_Relf

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

Olaf Baeyens

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,....
 
M

Montrose...

Olaf said:
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.
 
J

Jeff_Relf

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

Olaf Baeyens

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

Olaf Baeyens

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

Michael Gray

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

Guest

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

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

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