Re: Who owns C#?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23rwIdWUaGHA.4424@xxxxxxxxxxxxxxxxxxxxxxx
No. The standard library is the standard library - it is not part of the
definition of either C or C++ because it doesn't need to be.

Hey, *you're* the guy who used std::string as an example of how they are
"sifferent," by comparing it with System.String. There is no difference.

Yes there is.

std::string is not part of the definition of C++.

System.String is part of the definition of C#


Now, you are trying to argue with me by changing the parameters of your
argument. You switch to *char, which is not comparable to anything in C#,

That was my point:

string in C# IS System.String which is also part of the library/CLI/.NET
Framework or whatever you want to call it.

The nearest thing to a C# string in the C++ LANGUAGE definition is (const)
char* which IS NOT defined in the standard library whereas std::string is
defined ONLY in the library and not referenced by the C++ LANGUAGE spec.

It is possible to have a C++ without a standard library (except for
type_info etc) - I've used it myself for embedded work. It is NOT possible
to have C# without System.String, System.MulticastDelegate etc.

[end of annotations]

since pointers are unsafe code, and not directly supported by the
language. So, now you're comparing apples to oranges. There is *no*
equivalent of *char in C#. Why? Because C# is fully object-oriented, and
C++ is not. C++ supports true primitive data types like int, char, and
byte, while the "equivalents" in C# are not primitive data types at all,
but are derived from base classes. C# supports only objects. This is why
they are referred to as "value types."

So, when you compare apples to apples, that is, STL types and functions in
C++ to System namespace equivalents in C#, you are comparing things that
are conceptually alike. When you compare that which is included in C++
with something which is *not* that, you are comparing apples to oranges.

The typeinfo stuff is different because the compiler itself synthesizes
instances of type_info at compile time and will explicitly generate code
to throw bad_cast.

The compiler is not the language. The C++ language is dependent upon the
STL in the same way that C# is dependent upon the Standard Library. Again,
the Standard Library is a specification. The fact that the STL
specification is part of a C++ compiler doesn't mean that C++ is not
dependent upon the STL. In fact, C# is also indirectly dependent upon
stdio, without which there would *be* no data types, just bits.

In other words, there is no difference between what you term "overlap
between language and framework" in C# and the "overlap between language
and framework" in C++ and C.

I think that what you seem to find objectionable is the fact that C# is a
higher-level language than C++. But C++ is a higher-level language than C,
which is a higher-level language than Assembler, which is a higher-level
language than machine language. The only difference is a matter of degree.
As to why that difference exists, you would have to trace back the history
of programming. Each successively higher level of language has arisen out
of the need to optimize the time spent in development on increasingly
complex applications, on increasingly faster machines.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Nick Hounsome" <News@xxxxxxxxxxxxxxxxxx> wrote in message
news:eBL3g.19953$tc.13568@xxxxxxxxxxxxxxxxxxxxxxxxxxxx

"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uZ63%23$SaGHA.508@xxxxxxxxxxxxxxxxxxxxxxx
There is an area of overlap between language and framework. It exists
in C++ as well but it is much smaller (basically just
type_info,bad_cast,bad_typeid and exception).

In C# the language and framework are much more closely entwined because
all the basic types are structs so, for example, "System.String" is
part of the C# language whereas "std::string" is not part of the C++
language.

This just doesn't fly. Note the "std::" in the C++ string class
reference. This is a reference to the STL. The STL is the C++ equivalent
of the stdio library used in C and the System NameSpace (the "Standard
Library") according to ECMA) in C#. There is no difference. Each version
of the language has a core set of functionlity for which a Standard
Library is defined and used.

No. The standard library is the standard library - it is not part of the
definition of either C or C++ because it doesn't need to be.

The C++ compiler does not understand ANY class or function in the C or
C++ libraries other than those I mentioned any more than it understands
one that you write. In particular std::string gets no special treatment
compared to any other class.

The typeinfo stuff is different because the compiler itself synthesizes
instances of type_info at compile time and will explicitly generate code
to throw bad_cast.

C# on the other hand explicitly understands all the basic type
classes/structs. For example <string s = "hello";> results in IL to call
the System.String constructor where as <char* s = "hello";> does not use
the standard library at all.
Also, everything derives from System.Object and the compiler must know
this implicitly - There is no equivalent knowledge in a C++ compiler to
link a class to anything in the standard library.



The biggest difference here is that the Standard Library is not specific
to the C# language, whereas the STL and stdio are specific to the older
flavors of C. In .Net, the Standard Library is language-neutral, part of
the CLI.


The .NET Framework is not specific to C# but C# IS specific to the .NET
framework - For example you could not change the System.String
constructors without changing C# whereas you can do what you like to
std::string and it will require no changes whatsoever to any C++ compiler
or, more simply, it is impossible to remove the System.Int32 class from
the framework because "int" really is System.Int32 whereas in C++ "int"
is just "int".

C++ generates type_info in the same way that C# generates System.Type
objects.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Nick Hounsome" <News@xxxxxxxxxxxxxxxxxx> wrote in message
news:yJG3g.153219$8Q3.1299@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
There is an area of overlap between language and framework. It exists
in C++ as well but it is much smaller (basically just
type_info,bad_cast,bad_typeid and exception).

In C# the language and framework are much more closely entwined because
all the basic types are structs so, for example, "System.String" is
part of the C# language whereas "std::string" is not part of the C++
language.

"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OYOiaNNaGHA.2368@xxxxxxxxxxxxxxxxxxxxxxx
Yeah, actually, the C# language is *not* part of the framework. There
are compilers and class libraries for C# in the framework, but it is
important to distingusih between the language itself and the various
tools and devices for implementing it. The language itself is actually
just a specification, a protocol, a set of rules, concepts, and ideas.

This is a point that a lot of people seem to get stuck on. Some people
even get the idea that Visual Studio is somehow part of the C#
language. The language is much more abstract than that.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Alvin Bruney" <www.lulu.com/owc> wrote in message
news:uoUI0JKaGHA.1192@xxxxxxxxxxxxxxxxxxxxxxx
With C# it's not quite as bad. The language itself is not MS
specific but some of the framework exposes MS specific stuff.
Such as???

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"Nick Hounsome" <News@xxxxxxxxxxxxxxxxxx> wrote in message
news:Awn3g.27760$xt.18335@xxxxxxxxxxxxxxxxxxxxxxxxxxxx

"Sathyaish" <sathyaish@xxxxxxxxx> wrote in message
news:1145962030.221646.325550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Who owns the language C#? I'm not talking about the compiler, but
about
the language? Who owns it - Microsoft or the ECMA? I see there are
two
specifications to each version:

1. One that comes out from Microsoft; and
2. Another that is a follow up from ECMA TC39 (ECMA-334) that is
revised after every release from Microsoft.

What's the deal?

The usual MS obfuscation. They want to tell the world that they are
nice guys using open standards but in practice they're not.

MS don't own C++ either but none of their header files will work
with an ISO standard compiler so effectively they have a separate
language.

With C# it's not quite as bad. The language itself is not MS
specific but some of the framework exposes MS specific stuff.
















.



Relevant Pages

  • Re: advantages of forth over other languages
    ... Well, I think you've highlighted at least one issue that the OP might have meant: you've described a situation where you not only have to know C, you also have to know about the public interfaces and exports of those libraries, and you have to learn the extremely arcane syntax of another language: make. ... When comparing and contrasting languages, we should be careful to compare apples with apples. ... One need only remember those first-year students who knew but were confronted with an unfamiliar development environment. ... In fact, if you survey some of the threads over on comp.lang.c you will find a not insignificant percentage of them are related to folks trying to figure out the linker, the environment or something completely separate from the language and compiler. ...
    (comp.lang.forth)
  • Re: C# as a programming language
    ... is nothing without the Framework, just like Java is nothing without its ... The original post is not comparing C# with other .NET ... I meant to say that the Common Language Runtime Library of the ... The CLR or CLI might well be ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Who owns C#?
    ... type_info,bad_cast,bad_typeid and exception). ... In C# the language and framework are much more closely entwined because ... everything derives from System.Object and the compiler must know this ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: thought: C, dynamic types, and closures
    ... If one often blame C to be a low level language similar to a super assembler, it should be worthwhile to raise C to the level of the other high level OO languages. ... I am completely rewriting an cleaning the macros of COS during my spare time. ... At that point, I thought you were talking about an extended C language, i.e., compiler grammar or parser/lexer modification, and not a library and/or set of includeable files needed to implement object oriented paradigms... ... Motivation The C Object System is a small framework which adds an object-oriented layer to the C programming language [1, ...
    (comp.lang.misc)
  • Announcing MetaCC framework
    ... MetaCC is a framework for compiler construction implemented in Java. ... The ultimate goal of MetaCC framework is to make a programming language ...
    (comp.compilers)