C

  • Thread starter Thread starter bernice.blackledge
  • Start date Start date
B

bernice.blackledge

vs C++# Is C# better than C++?

What are the advantages of C++ over C# and vice versa?


(e-mail address removed)
 
this is not a simple answer.

c# is like java, visual basic, and c++ combined. C# offers a managed
environment but is not very portable. really the only one that uses C#
is Microsoft. it really depends on your application and the life of the
code

chirag
 
What are the advantages of C++ over C# and vice versa?

if you use native C++ you get the following
development times 3 times slower, performance 5% better (sometimes 10%)

if you use managed C++ well it's genereally not worth it (slower
development (much more character to type the same instructions and a not as
good intellisense) and same perf because same runtime/instruction set),
except when using 'advanced' (syntaxically speaking) legacy C API .
In which case Managed C++ shine :-)
 
Lloyd said:
if you use native C++ you get the following
development times 3 times slower, performance 5% better (sometimes 10%)

if you use managed C++ well it's genereally not worth it (slower
development (much more character to type the same instructions and a not as
good intellisense) and same perf because same runtime/instruction set),
except when using 'advanced' (syntaxically speaking) legacy C API .
In which case Managed C++ shine :-)

Another thing you should mention is distribution. C++ has .net beat
there. The framework is a 20 MB download and requires a reboot. Also,
..net assemblies are very easy to disassemble for reverse engineering
purposes.
 
Another thing you should mention is distribution. C++ has .net beat
there. The framework is a 20 MB download and requires a reboot. Also,

ho.. yeah.. right... but bpure (unmanaged) C++ only
.net assemblies are very easy to disassemble for reverse engineering
purposes.
I think this one is over hyped.
 
Lloyd said:
I think this one is over hyped.

Ever used Reflector? <g>

No it is not over hyped. As an example, look at trial software. People
are happy to give you a time limited or feature limited version of their
library if it is compiled native code. Yes, a cracker could change it to
work, but the DLL is still substancially the same as the original. A
developer trying to steal the intellectual property of an algorithm will
find it so difficult that they may as well spend the time creating their
own version. How many .NET library vendors will give out a free trial
version of their library?

Imagine you want a routine to perform some action - say, the spectral
analysis of a collection of data. You could download a trial version of
a native library that does this and the library would limit you to just
a few data items. If you like it, you buy it and use it in your app. If
you download a .NET trial library you can use Reflector to get the
source code for the algorithm, determine the code that limits the
dataset, alter and then compile the code as part of your app without
paying the writer a penny. No one will know where you got that code
from, because its now part of your assembly. It is a nightmare for
library developers.

Richard
 
.net assemblies are very easy to disassemble for reverse engineering
Ever used Reflector? <g>
yes, regularly.
What I mean is using a big library is hard enough with the documentation.
So I don't consider much of a problem looking at the decompiled
(uncommented) code.
Not too mention VS.NET is shipped with an inbuild obfuscator which makes the
code quite difficult to read.
No it is not over hyped. As an example, look at trial software. People are
happy to give you a time limited or feature limited version of their
library if it is compiled native code. Yes, a cracker could change it to
so?
I also found plenty of trial of .NET products...
work, but the DLL is still substancially the same as the original. A
developer trying to steal the intellectual property of an algorithm will
find it so difficult that they may as well spend the time creating their
own version. How many .NET library vendors will give out a free trial
version of their library?
well I would say I haven't yet found a .NET library/tool which have no trial
version...
Imagine you want a routine to perform some action - say, the spectral
analysis of a collection of data. You could download a trial version of a
native library that does this and the library would limit you to just a
few data items. If you like it, you buy it and use it in your app. If you
download a .NET trial library you can use Reflector to get the source code
for the algorithm, determine the code that limits the dataset, alter and
then compile the code as part of your app without paying the writer a
penny. No one will know where you got that code from, because its now part
of your assembly. It is a nightmare for library developers.

well if the value of your library is just one function, I think it's
reasonable you don't make much sales.
although you argue this one function might be the result of many days of
mathematical work.
fair enough...
but, while your argument is valid only in this particular case I would say
nothing prevent you to write a multi module DLL, with an embeded native DLL
for the few algorithms you implement.


On the other hand I bought DevComponent's library with the source code (for
fun).
I prefer post question on the support newsgroup than bothering looking at
the code most of the time (it's so big...)
Also a pirated version don't benefit from upgrade.
And if you don't upgrade your library, expect to be, if not pirated, copied
by competitor and/or opensource and/or freeware anyway....
 
Ever used Reflector? <g>
sorry, I meant:
many time. always the same no argument <g>...

;-)
 
Lloyd said:
well if the value of your library is just one function, I think it's
reasonable you don't make much sales.

No you misunderstand me. I know plenty of .NET libraries that are not
offered as trial code. I also know of many shareware authors who have
told me that this aspect of .NET is preventing them from moving to the
platform. Even my forceful insistence that the security aspects of .NET
alone makes it worth while is not enough to change their minds.

Richard
 
well if the value of your library is just one function, I think it's
No you misunderstand me. I know plenty of .NET libraries that are not
offered as trial code. I also know of many shareware authors who have told
me that this aspect of .NET is preventing them from moving to the
platform. Even my forceful insistence that the security aspects of .NET
alone makes it worth while is not enough to change their minds.
Allright, I see.
However I would like to convince you (so you could convince them ;-)
That this is a false problem!

BTW I don't know who you were trying to convince, but I believe the
productivity
improvment of .NET (much more feature in much less time with much less bug)
should be more appealing than the security improvment.

BTW, I think you're unfair in your article where you said that Microsoft
lost confidence in .NET.
After all Aero is not even finished yet, no surprise it's not much use yet.
Not too mention OS level code would certainly stick to C for still a long
while.

And I would like to point out that, by the time Aero, uh.. their new file
system (WinFX?) and
new communication api would be released (forget the names :-/), they would
be .NET only...

Anyway one thing is certain: As far as I'm concerned I certainly gain more
and more confidence
with .NET everyday.....
And can't see no reason to go back...
 
And I would like to point out that, by the time Aero, uh.. their new file
system (WinFX?) and
new communication api would be released (forget the names :-/), they would
be .NET only...

I don't believe so - they will certainly be wrappers around API function
written in C.
Can you proof this claim?
 
Richard Grimes said:
No you misunderstand me. I know plenty of .NET libraries that are not
offered as trial code. I also know of many shareware authors who have
told me that this aspect of .NET is preventing them from moving to the
platform. Even my forceful insistence that the security aspects of .NET
alone makes it worth while is not enough to change their minds.

Well, there will always be people who can't evaluate benefit and risk
effectively - who think that decompilation is only available to managed
code, and that it will actually have a significant effect on their
business. There have always been plenty of people who refuse to move
over to Java and .NET because they don't want their code to be
"interpreted", too... :(
 
Lloyd said:
BTW I don't know who you were trying to convince, but I believe the
productivity
improvment of .NET (much more feature in much less time with much
less bug) should be more appealing than the security improvment.

<gasp> someone who thinks there is something more important than
security?

Seriously, you should live and breathe security. 'Productivity' which
means cutting as many corners to get the code out as quickly as
possible, is the reason why there are so many exploits in current
software that allow hackers to '0wn boxen'. Please reconsider and put
security at the top of your priority list.
BTW, I think you're unfair in your article where you said that
Microsoft lost confidence in .NET.

Thats my interpretation of the results, I would dearly love Microsoft to
provide evidence that refutes my conclusion.
After all Aero is not even finished yet, no surprise it's not much
use yet. Not too mention OS level code would certainly stick to C for
still a long while.

There is not .NET in the desktop in Vista, so there's no .NET in Aero.
I've been told that that situation will not change, which is why I
performed the measurements. I will perform the measurements on beta 2
when it comes out. Believe me, I will be the first to congratulate
Microsoft is they add substancially more .NET to Vista beta 2, however,
I have little confidence that this will happen. My prediction (and
please return to this when beta 2 comes out) is that there will be a
couple more .NET applications that will do fairly trivial things, and
everything that is important in the OS will be native code.
And I would like to point out that, by the time Aero, uh.. their new
file system (WinFX?) and

WinFS. That won't be in the release of Vista, it will be supplied as a
separate upgrade to Vista. I haven't looked at the new version of WinFS
yet. I did an extensive study of the old version and it was far too
layered, the schema was very complicated requiring multiple joins for
the most trivial of queries. No wonder it was so slow.
new communication api would be released (forget the names :-/), they
would be .NET only...

Indigo. Yes its .NET, but it has little to do with Vista. Indigo will be
available for XP. Oh and I found no evidence of anything in Vista using
Indigo.
Anyway one thing is certain: As far as I'm concerned I certainly gain
more and more confidence
with .NET everyday.....
And can't see no reason to go back...

Its a pity Microsoft does not have your confidence <g>

Richard
 
And I would like to point out that, by the time Aero, uh.. their new file
I don't believe so - they will certainly be wrappers around API function
written in C.
Can you proof this claim?
Mhhh..
what do you think of these quotes from:
http://msdn.microsoft.com/library/en-us/dnlong/html/wpf101.asp?frame=true

"Windows Presentation Foundation (formerly known as "Avalon") is the new
strategic graphics subsystem in Windows that provides a unified approach to
user interface, 2D and 3D graphics, documents and media. Built on the .NET
Framework foundation and ..."

And this picture:
http://msdn.microsoft.com/library/en-us/dnlong/html/wpf101_01.gif

Clearly show that Avalon is not underneath .NET but above.
Also I would be curious as to how you write (efficient) C wrapper around a
..NET (complex) API.

or maybe this page about Indigo:
http://msdn.microsoft.com/library/en-us/dnlong/html/progindigoch3.asp?frame=true
"Setting Up for Indigo
To set up for Indigo development, you must install Indigo and its
prerequisites. Indigo is part of WinFX, the Microsoft Windows managed code
development framework. You need all of the following to program with Indigo:

a.. An operating system that supports Indigo
b.. Microsoft .NET Framework 2.0
c.. Windows Application Pack (WAP)
d.. A development environment "
 
Well I dare you to convince me!
You shall be put in the right perspective.
I'm writing no server software, just desktop application with full trust.
I'm accessing no WebServices.
What security is for me?

Hum... truth to tell I was thinking to you use security feature around a
plugin architecture I'm planning to write. But I'm not there yet...
Seriously, you should live and breathe security. 'Productivity' which
Again..
I don't *believe* security is that much an issue if you write isolated,
desktop only, application.

I also think than the security should mainly be on the server side. If you
ever write client code only, I don't think that's much an issue.

However I perfectly agree that security (and as easy and fine grained as
..NET security) is paramount as soon as you start to communicate with the
world outside.

That said what I was meaning and my assumptions were the following:
- Not everyone write server software
- I even believe, and maybe I'm quite wrong here, that many people don't
write server software at all, or rarely.
and I was speaking in this context, in which productivity is (clearly IMHO)
the paramount, not security.
There is not .NET in the desktop in Vista, so there's no .NET in Aero.
look at my answer to cody.
that's my counter argument to these assertions.
unless you assume that years of development going into Avalon & Indigo are
juste wasteful effort in technology they don't trust?
WinFS. That won't be in the release of Vista, it will be supplied as a
separate upgrade to Vista. I haven't looked at the new version of WinFS
yet. I did an extensive study of the old version and it was far too
layered, the schema was very complicated requiring multiple joins for the
most trivial of queries. No wonder it was so slow.
Can't say for sure as I haven't tested it myself.
But as far as the channel9 video went, I found it quite convincing ;-)
 
Lloyd said:
Mhhh..
what do you think of these quotes from:
http://msdn.microsoft.com/library/en-us/dnlong/html/wpf101.asp?frame=true

"Windows Presentation Foundation (formerly known as "Avalon") is the
new strategic graphics subsystem in Windows that provides a unified
approach to user interface, 2D and 3D graphics, documents and media.
Built on the .NET Framework foundation and ..."

You access it via .NET, that is not necessarily the same as 'built on
..NET'. If you think about it, at some point Avalon must talk to a device
driver, and they are native code C or C++. The point about Avalon is not
that it was .NET, but that it was not Windows windowing. Th idea was
that it would 'talk to the graphics card' (umm, talk to the graphics
card device driver) and by pass Windows windowing. However, the last
version I checked was still based on Windows message loops and so had
all of the problems that Windows windowing have. Sometime in the future
I will do a more complete analysis.
And this picture:
http://msdn.microsoft.com/library/en-us/dnlong/html/wpf101_01.gif

Clearly show that Avalon is not underneath .NET but above.
Also I would be curious as to how you write (efficient) C wrapper
around a .NET (complex) API.

Its not hard, you host the runtime. This is what VS.NET does. VS.NET is
*not* a managed application but it uses managed controls like the
property grid - it does that by hosting the runtime.

Richard
 
Richard,

I followed your links to your workshop on security. From there, I
followed links to a bio that basically says you've given up on .Net.
(http://www.grimes.demon.co.uk/bio.htm)

I see you in the forums, so I'm curious, have you really given up on
..Net? What were the original reasons for giving up on .Net. As someone
would has spent a lot of time and effort and entry on .Net, it would
seem valuable to know why you decided to abandon .Net; and equally
valuable to know if you have reconsidered and still believe .Net to be
something great / good / decent.

--Brian
 
Brian said:
I followed your links to your workshop on security. From there, I
followed links to a bio that basically says you've given up on .Net.
(http://www.grimes.demon.co.uk/bio.htm)

Hmm, I have rephrased that. It was more of a statement to the publishers
and conference organizers. I have given up writing and speaking about
..NET. From the rest of the site you'll see that I have been very busy
over the last years writing articles and speaking at 4 or 5 conferences
a year. The problem is that the payment is appalling. Consider what you
would pay as a delegate, and then realise that for one talk I would get
perhaps a third or a quarter of that. If I take a week to write a talk,
that is not a reasonable income. Technical magazines and conferences
really don't consider that the payment is anything more than beer money,
as a writer or speaker you are expected to regard the opportunity as a
way to promote yourself. Maybe I am being too English here, but I regard
a talk or an article as an outright piece of work and expect to be paid
for the work I do. Microsoft are the worst because they don't pay
(unless you take steps to make sure that they do). They treat it as a
privilege for you to work for them. I have had enough of such things.
Now I do .NET for payment, or if I do it for free, I do it on my own
terms like articles on my site or answering posts on newsgroups.

Richard
 
Ahh, yes, that makes more sense.


Richard said:
Hmm, I have rephrased that. It was more of a statement to the publishers
and conference organizers. I have given up writing and speaking about
.NET. From the rest of the site you'll see that I have been very busy
over the last years writing articles and speaking at 4 or 5 conferences
a year. The problem is that the payment is appalling. Consider what you
would pay as a delegate, and then realise that for one talk I would get
perhaps a third or a quarter of that. If I take a week to write a talk,
that is not a reasonable income. Technical magazines and conferences
really don't consider that the payment is anything more than beer money,
as a writer or speaker you are expected to regard the opportunity as a
way to promote yourself. Maybe I am being too English here, but I regard
a talk or an article as an outright piece of work and expect to be paid
for the work I do. Microsoft are the worst because they don't pay
(unless you take steps to make sure that they do). They treat it as a
privilege for you to work for them. I have had enough of such things.
Now I do .NET for payment, or if I do it for free, I do it on my own
terms like articles on my site or answering posts on newsgroups.

Richard
 
Back
Top