Board index » cppbuilder » Re: ".NET" for Dummies !

Re: ".NET" for Dummies !


2004-09-17 02:05:29 PM
cppbuilder11
Quote
Fortunately, I sought the signs years ago. Hence I'm not using the VCL.
Hm. So you donīt have to use .NET either ?
Quote

>>isn't it? This means you need to fake multiple inheritance.
>
>Why ? - you can still use multiple object inheritance with your "native"
>c++ objects

But in this case it is not a .Net app, isn't it?

Itīs not a portable .NET application - meaning it wonīt necessarily run under
e.g. Mono and the code cannot be used directly by other .NET applications
- but itīs C++ code compiled to IL code and therefore needs the framework to run.
(At least the IL compiler)
Quote
Hence, C++/CLI != C++

It *removes* features. An efficient Common Lisp implementation is
very difficult or impossible to achieve. As said above, they needed
to invent a C++ *dialect* (plese don't call it an extension) for
attracting the hordes of C++ programmers out there. This clearly says
that .Net *restricts* programming languages.
You have that, if you want call it so, "restriction" only when your are using other .NET code
or your code has to be used from other .NET code.
I can us managed objects, but iīm not forced to - only when iīm using other .NET code.
For example C++/CLI gives you some features C++ doesnīt have,
e.g. specifying the underlying type of enumerations.
Quote

So I need to go outside of C++ for being a .Net citizen, but C++ is
not restricted when I target .Net.

The interface to the .NET world is restricted, the C++ side isnīt - besides
some minor complains of the compiler (e.g. __fastcall will be ignored -
but that isnīt C++ standard either).
I admit that accessing memory of VCL objects is easier than that of .NET
objects from C++ code. But thatīs by design, since .NET objects are manged
objects which may be moved around by the managed heap manager,
you have to pin them before you are able to access their memory
(e.g. array) from native C++, therefore C++/CLI is easier.
Quote

Yes, the common object architecture dictated by .Net.

Yes - you need a standard so that different languages my interoperate.
Currently you have to map all C++ objects to handle functions so that
they may be used from other languages or use some other standards
like CORBA or COM.
In .NET you simply reference the DLL and use the C++/CLI objects directly.
And, yes, the C++ objects still cannot be used directly.
Quote
And what happens if the concept of "object" is absolutely alien for a
certain programming language? It suddenly becomes an obsolete language
just because old' Anders is still suffering from Object Obsession?

This language will have to do the same as currently C code is doing,
map the objects to single functions and use handles to represent the objects.
Quote

This is a job for the OS.
Yes - if the technology of virtual PCīs advances i would have no problem with native
code running in an virtual environment.
Quote

A great achievement, indeed! My point is that eliminating certain
problems associated with Assembler and its high level derivatives is
just that: fixing the "faults" of certain programming
languages. Security is a lot more than this. No programming language
nor runtime model will turn your app onto a secure one. However, MS is
preaching about how .Net apps are "secure" as if all were done by just
using .Net. This is the kind of ignorance exploit we are accustomed to
to see coming from certain corporations.

Even Java code isnīt 100% secure, since the virtual machine is written in
native code. But itīs more secure than native code. The same is to .NET
Quote

For the sole reason of not using pointers, an application doesn't
turn safe. "Safe" on the mouth of MS is just a buzzword.
Yes but you canīt control C++ code, but you can control .NET code
during compilation (e.g. when you are running a .NET application in the
internet area). You may remove all code calling restricted areas or
deny the application to run.
Quote

[snip]

>>Turning a general-purpose computer into a restricted virtual machine
>>benefits only those who are interested on restricted virtual
>
>Under a virtual machine i understand an application interpreting
>byte code

... or native code

>or assembly code of a different processor,

No, that's an *emulator* <big evil grin>

Sigh - itīs both an emulator and a virtual machine ;-9
Quote
Again I ask: Can I mix *real* C++ with C++/CLI on the same function?
On the same code statement?
You currently have some restrictions in writing so called mixed code objects.
E.g. derivation and using handles in native objects - that will be added in future versions.
[snip]
Andre
 
 

Re:Re: ".NET" for Dummies !

"Andre Kaufmann" <## XXXX@XXXXX.COM ##>writes:
[snip]
Quote
Even Java code isnīt 100% secure, since the virtual machine is written in
native code. But itīs more secure than native code. The same is to .NET
I'll repeat again, just in case it was not clear: the language or
runtime of an application doesn't make it secure or insecure. A Java
app running on a bug-free Java VM can be insecure, on a thousand
different ways. Same for .NET.
[snip]
--
Oscar
 

Re:Re: ".NET" for Dummies !

That depends on how you define security code injection via stack overflow
cannot occur in a properly written Java runtime by definition.
But i wouldnīt bet on it for 100%.
I think you canīt divide code in 2 classes, secure and insecure.
And thatīs what i wrote: more secure
Java and .NET code is more secure than native compiled code,
i didnīt wrote that both make it possible to write 100%
secure code.
The point is at which level the code may be controlled and restricted,
i would call native code running in a virtual machine secure so perhaps
this would be an option for native code downloaded from the web.
Besides i currently donīt need managed code or the security of .NET,
since i donīt write applications for the web / webserver.
But itīs easier to write applications, when you donīt have to care that much
about memory allocation / deallocation or if you compile 100+ source code
files in a few seconds.
Though i still like C++, simply canīt live without templates.
Andre
"Oscar Fuentes" < XXXX@XXXXX.COM >wrote in message news: XXXX@XXXXX.COM ...
Quote
"Andre Kaufmann" <## XXXX@XXXXX.COM ##>writes:

[snip]

>Even Java code isnīt 100% secure, since the virtual machine is written in
>native code. But itīs more secure than native code. The same is to .NET

I'll repeat again, just in case it was not clear: the language or
runtime of an application doesn't make it secure or insecure. A Java
app running on a bug-free Java VM can be insecure, on a thousand
different ways. Same for .NET.

[snip]

--
Oscar
 

{smallsort}

Re:Re: ".NET" for Dummies !

"Mark Jacobs" <markj atty critical dotty co dotty uk>wrote:
Quote
It basically allows moronic management staff to have a bash at programming, and that, to me, is a very
dangerous thing.
Visual Basic made that possible years ago and as AFAIK, the sky has
not yet fallen. ;-)
--------------------
FLUSH THE JOHNS NOVEMBER 2004!
 

Re:Re: ".NET" for Dummies !

Oscar Fuentes < XXXX@XXXXX.COM >writes:
Quote
>I wouldnīt call adding language features penalization.

It *removes* features. An efficient Common Lisp implementation is
very difficult or impossible to achieve. As said above, they needed
to invent a C++ *dialect* (plese don't call it an extension) for
attracting the hordes of C++ programmers out there. This clearly
says that .Net *restricts* programming languages.
As I walked away understanding, the .NET features add extensions to
the language, and if you don't use them your code is not affected.
Further, the .NET features work together with the standard C++
features. That is, you're not limited to having two subsystems in
your program, the "pure" C++ and the "managed" C++ sections. For
example, you can use C++ templates (including STL) on managed C++
garbage-collected pointers, and so on.
While I don't know all the details, I feel that they did an excellent
job of adding the features in a non-intrusive way.
Quote
So I need to go outside of C++ for being a .Net citizen, but C++ is
not restricted when I target .Net.
You can have a mixed environment of native and managed code.
NOTE: I'm not advocating .NET, and am certainly not one to like
Microsoft to widen its monopoly. However, they are fast-tracking the
standardization of these extensions, and in theory they should (or
could) be available in non .NET environments as well, provided the
compiler/runtime correctly implement the langauge features.
Some things that I really like that the extensions offer:
* the ability to declare that a function overrides a virtual
function. If it turns out that it doesn't actually override a
virtual function from the base class, it's a compile-time error.
* the ability to declare that a virtual function does NOT override
a virtual function. (It's "new")
* the ability to declare a class cannot be a base class. ("sealed")
* optional garbage collection in a non-intrusive way. Stroustrup has
wanted this in C++ for years... and it does not HAVE to be
implemented by .NET, I think.
I am concerned about Microsoft's recent history of collecting patents
and then trying to inject their patented "intellectual property" into
standards. If they sandbag these language extensions as patented
extensions, then I'll be thorougly disgusted with them, but so far I'm
really looking forward to the features, though I'd like them to be
implemented in a non .NET environment as well. :)
--
Chris (TeamB);