473,383 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

From C# going to c++

Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys just
know tell me.

Thanks for you help anyway!
Jul 7 '07 #1
44 1639

"herr" <he***@hotmail.comwrote in message
news:Ot**************@TK2MSFTNGP05.phx.gbl...
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
Probably not a good idea to rewrite the whole thing. Use a profiler, find
out what portions of the code have performance problems, and rewrite just
those.
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!
Jul 7 '07 #2
herr wrote:
For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly).
I am very skeptical on whether you will see significant
performance improvements by that change.
I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys just
know tell me.
What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?

Arne
Jul 7 '07 #3
I am very skeptical on whether you will see significant
performance improvements by that change.
Then why is it that .net is not used by big software companies like Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.

What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?
I don't know! What is the most used GUI library in the market? The best for
windows XP / Vista platforms.


Jul 7 '07 #4
herr wrote:
>I am very skeptical on whether you will see significant
performance improvements by that change.

Then why is it that .net is not used by big software companies like Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.
I was not aware that Google and Yahoo made desktop apps.

I am very sure that more and more of MS desktop apps will be
coded using .NET (and Adobe also unless they have cross platform
requirements that prevent them from doing so).

The reason they are not already has probably more to do with the cost
of rewriting millions and millions of lines of code than for
performance reasons.
>What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?

I don't know! What is the most used GUI library in the market? The best for
windows XP / Vista platforms.
There are a lot MFC code out there.

But I would consider .NET and WPF a much more future proof
route than MFC.

Arne
Jul 7 '07 #5
On Sat, 07 Jul 2007 10:11:36 -0700, herr <he***@hotmail.comwrote:
Then why is it that .net is not used by big software companies like
Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.
For a variety of reasons, none of which have anything to do with
performance.

Also, I doubt it's true that the companies you mentioned don't use .NET in
any of their applications. For sure, it's not true for Microsoft, though
as is also the case for Adobe, the major desktop applications (e.g.
Microsoft Office programs) aren't going to be in .NET because .NET wasn't
around when the bulk of the code for those applications was written.
>What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?

I don't know! What is the most used GUI library in the market? The best
for
windows XP / Vista platforms.
..NET is IMHO the best GUI library to use on Windows.

If you're not going to use .NET, then you might as well learn the native
Win32 API and stick with that.

Personally, I think the business of "performance issues mainly" is
invalid. Only certain specialized applications would have "performance
issues", and even in those cases that's no reason to abandon .NET
altogether. It _is_ a reason to identify the elements of the application
that are not performing well and do something about it.

But most of your performance problems will turn out to be algorithm design
errors, rather than something inherently slow about .NET, and for the tiny
fraction of things that really are a limitation of .NET, you can implement
those in some other language in a separate module and then call that from
your .NET code. That will allow you to take full advantage of the
services .NET offers without sacrificing performance.

You should, of course, feel free to redevelop your code however you like.
If you want to stop using .NET, that's your perogative. But if you
believe that you will see significant performance gains doing so, I
suspect you are in for some disappointment.

Pete
Jul 7 '07 #6
"Any one can help me on my way to mastering c++ windows software writing?"

Start fixing your problem by identifying exactly what is poor in your C#
application and fixing it one by one. If you have to ask how to write
advanced windows applications in C++ you're not going to get the performance
gain you expect out of doing something in C++; an application can suck no
matter what language you write it in.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ben Rush
Microsoft .NET Consultant
http://www.ben-rush.net/blog
http://www.sideshowsystems.com
"herr" <he***@hotmail.comwrote in message
news:Ot**************@TK2MSFTNGP05.phx.gbl...
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!

Jul 7 '07 #7
OD
Like some others in this thread I'm not sure you will see a big
difference about performances..

I recently wrote a complete test between C# and Delphi 2006, a kind of
benchmark.
Each code does exactly the same thing, one built on BDS 2006, the other
on VS 2005. Each code has been written to respect each language (no
unfair trick to give advantage to one language).
Results are that the C# version is about 25 to 40 % faster than the
Delphi 2006 one (depending on the computer, Intel processors giving
best C# results than AMD ones, but always C# faster than Delphi).

Memory management, strings, maths, file IO, I tested what most
applications are supposed to do when they're working.

So, as I'm knowing C++ is very near Delphi on the performance side (I
tested this a couple of years ago), I think switching to C++ will
decrease the overall performances of your application. And you'll lose
all the benefit of the CLR and the object API of the framework. Win32
API is a mess...

--
OD___
www.e-naxos.com
Jul 7 '07 #8
Thanks guys for your valuable help.

I have one other questions. What is the largest application written in .net?
(except for the Framework itself).

"OD" <webmaster @ e-naxos dot comwrote in message
news:mn.3cc67d77cb45103c.18651@e-naxosdotcom...
Like some others in this thread I'm not sure you will see a big difference
about performances..

I recently wrote a complete test between C# and Delphi 2006, a kind of
benchmark.
Each code does exactly the same thing, one built on BDS 2006, the other on
VS 2005. Each code has been written to respect each language (no unfair
trick to give advantage to one language).
Results are that the C# version is about 25 to 40 % faster than the Delphi
2006 one (depending on the computer, Intel processors giving best C#
results than AMD ones, but always C# faster than Delphi).

Memory management, strings, maths, file IO, I tested what most
applications are supposed to do when they're working.

So, as I'm knowing C++ is very near Delphi on the performance side (I
tested this a couple of years ago), I think switching to C++ will decrease
the overall performances of your application. And you'll lose all the
benefit of the CLR and the object API of the framework. Win32 API is a
mess...

--
OD___
www.e-naxos.com


Jul 7 '07 #9
If you're moving away from .Net, you need to decide what technology you want
to use.

There are several options that come to mind for Windows Forms development:

- You can write a pure C / C++ Win32 application. This is a major pain in
the ass, but is certainly possible. For this, go buy Charles Petzold's book,
"Programming Windows". It's circa 1998 or so - be sure you get the Win32
version, and not the newer C# versions. You'll probably need to end up
buying this book anyway, regardless of which choice you end up making.

- MFC is a good, and very popular choice. There are tons of books out there
on this.

- ATL is probably not the right choice these days - but I don't know the
current status of this technology though, or where it sits in relationship
to MFC.

- You could go with an older Borland product (Delphi or C++ Builder). These
both produce native code - no CLR requried.

- You can use VB6, depending on what you're needing to do.

- There are also a number of libraries out there for C++ you may want to
look at. I've heard good things about qt, although I've never used it.

It's all going to depend on what you're needing to do...

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"herr" <he***@hotmail.comwrote in message
news:Ot**************@TK2MSFTNGP05.phx.gbl...
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!

Jul 7 '07 #10
The size of an application can be determined many ways. You can write an app
in a handful of lines that declares a huge array, or one with many lines,
that uses little memory. We have a couple of systems that are in the 10K to
50K code line range each that are extensions to a commercial GIS product.

"herr" wrote:
Thanks guys for your valuable help.

I have one other questions. What is the largest application written in .net?
(except for the Framework itself).

"OD" <webmaster @ e-naxos dot comwrote in message
news:mn.3cc67d77cb45103c.18651@e-naxosdotcom...
Like some others in this thread I'm not sure you will see a big difference
about performances..

I recently wrote a complete test between C# and Delphi 2006, a kind of
benchmark.
Each code does exactly the same thing, one built on BDS 2006, the other on
VS 2005. Each code has been written to respect each language (no unfair
trick to give advantage to one language).
Results are that the C# version is about 25 to 40 % faster than the Delphi
2006 one (depending on the computer, Intel processors giving best C#
results than AMD ones, but always C# faster than Delphi).

Memory management, strings, maths, file IO, I tested what most
applications are supposed to do when they're working.

So, as I'm knowing C++ is very near Delphi on the performance side (I
tested this a couple of years ago), I think switching to C++ will decrease
the overall performances of your application. And you'll lose all the
benefit of the CLR and the object API of the framework. Win32 API is a
mess...

--
OD___
www.e-naxos.com


Jul 7 '07 #11
"herr" <he***@hotmail.comwrote:
I have one other questions. What is the largest application written in
.net? (except for the Framework itself).
Your decision to use or not use the .Net framework should NOT be based on
what people in this group tell you.

Figure out the requirements you need from a development platform, the look
at the available platforms. This is how you should make your choice.

For 95% (or more!) of applications today, .Net and/or Java are the right
choice. These two offer a good balance of developer productivity, perfomant
and reliable code, and a large talent pool to choose from for staffing and
maintenance purposes. I personaly perfer .Net over Java, but if anyone
starts telling you one is clearly better than the other, then they're just
being silly.

If you have specialized requirements, you may need a more specialized
development environment. Evaluate your requirements, then choose a platform.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins
Jul 7 '07 #12
Chris Mullins [MVP] wrote:
"herr" <he***@hotmail.comwrote:
The number of apps in which "performance" is even an
issue are really pretty few and far between these days.
There a lot of apps with performance problems.

But I agree that there are probably few apps where classic
micro optimizing (like the compilers ability to optimize
a certain for loop) is an issue.

Arne
Jul 8 '07 #13
Performance problems that I run into today tend to be related to:
- Architectural Flaws
- Alrorithm Flaws

It's almost never due to "C++ executes 1.2% faster than C# or Java".

The problems tend to be:
- "We're making 1500+ PLSQL calls, and we should be making 1".
- "We're calling web services synchronously, and making the user wait."
- "We're using distributed Transactions, and one of the participants is a
State Agency running over a 14.4k modem, and they refuse to upgrade."

It's really much more about design and engineering than actualy
knitty-gritty code tuning ...

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Chris Mullins [MVP] wrote:
>"herr" <he***@hotmail.comwrote:
The number of apps in which "performance" is even an
issue are really pretty few and far between these days.

There a lot of apps with performance problems.

But I agree that there are probably few apps where classic
micro optimizing (like the compilers ability to optimize
a certain for loop) is an issue.

Arne

Jul 8 '07 #14
Chris Mullins [MVP] wrote:
Performance problems that I run into today tend to be related to:
- Architectural Flaws
- Alrorithm Flaws

It's almost never due to "C++ executes 1.2% faster than C# or Java".

The problems tend to be:
- "We're making 1500+ PLSQL calls, and we should be making 1".
- "We're calling web services synchronously, and making the user wait."
- "We're using distributed Transactions, and one of the participants is a
State Agency running over a 14.4k modem, and they refuse to upgrade."

It's really much more about design and engineering than actualy
knitty-gritty code tuning ...
Yep.

Arne
Jul 8 '07 #15
herr wrote:
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys just
know tell me.
Beside C# and native C++, there is a third way: C++/CLI, it has the
best of both world. You can use Windows Forms for UI, and native code
for algorithms, and use libraries like boost.

Jul 8 '07 #16
On Sat, 7 Jul 2007 20:41:36 +0330, "herr" <he***@hotmail.comwrote:
>Then why is it that .net is not used by big software companies like Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.
A couple of reasons
1) They have a large library of perfectly functional code that has
been tested for server al years, sometimes decades (like Adobe). There
would be nothing to be gained in doing it from scratch
2) Writing an application in .NET places a requirement for the
customer to have the .NET framework. Forcing a customer to get this
might not be something you want to do, especially if your software is
a small utility
3) Microsoft DO use .NET in their commercial products. Look at
Microsoft CRM or Microsoft SQL Server 2005. Although, truth be told,
SQL Server Management Studio is a *HOWLING DOG*

--
http://bytes.thinkersroom.com
Jul 8 '07 #17
herr wrote:
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!
Hi,

IMHO, if you move to C++, you'll *lose* performance. This is because your
code will become a lot more complex, it'll take longer to write, you'll
discover a LOT more bugs and it will be hard to maintain.

--
Tom Spink
University of Edinburgh
Jul 8 '07 #18
OD
Our friend choice was between unmanaged/managed environments. You're
speaking about java/c# choice, two managed environment. It's clear
differences are not so big in this case.
But meanwhile, you're saying "I prefer .net", so as you're not silly,
you're thinking .net is "best than" java.
Hard to "prefer" without saying "it's best"...

--
OD___
www.e-naxos.com
Jul 8 '07 #19
I read on the internet that only %4 of Windows vista is written in .Net . Is
this really how MS makes use of its own technology, or should we be happy
because there is something like Paint.Net out there?!

IMHO Paint.Net is a nice demonstration of what we can do with .net, but
again, in terms of overall performance, it can't beat PhotoShop or
CorelDraw.
"count0" <ch********@gmail.comwrote in message
news:ep**************@TK2MSFTNGP02.phx.gbl...
herr wrote:
>Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't
really know what to read to learn writing advanced windows applications
with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Beside C# and native C++, there is a third way: C++/CLI, it has the
best of both world. You can use Windows Forms for UI, and native code
for algorithms, and use libraries like boost.

Jul 8 '07 #20
herr wrote:
I read on the internet that only %4 of Windows vista is written in
.Net . Is this really how MS makes use of its own technology, or
should we be happy because there is something like Paint.Net out
there?!
Keep in mind - Vista is 90% (or more ) the same as XP. Surely no one would
expect that Vista was written from scratch.

On the performance side though, I have to agree with most of the respondents
here: Performance is a result of good design, not micro-optimization. My
company produces a desktop app that's a very specialized text editor. It's
written entirely in C# (2.0) and has performance that rivals Notepad (which
is written in C to the win32 API). Our editor kicks the pants off of the
Visual Studio editor performance wise - and that editor is written in native
C++.

If you're having performance problems, learn the nature of the problems and
look for solutions to those problems. Simply jumping head first into an
entirely different programming environment is unlikely to solve the problems
for you.

-cd
Jul 8 '07 #21
I "prefer" both, depending on the requirements of the project. For one
project we need to interface with CORBA objects, so java is prefered. For
one project, we are required to interface with relational databases, so
csharp is preferred.

"OD" wrote:
Our friend choice was between unmanaged/managed environments. You're
speaking about java/c# choice, two managed environment. It's clear
differences are not so big in this case.
But meanwhile, you're saying "I prefer .net", so as you're not silly,
you're thinking .net is "best than" java.
Hard to "prefer" without saying "it's best"...

--
OD___
www.e-naxos.com
Jul 8 '07 #22
heck we have programmers at my office that has programmed for years, when i
was hired i saw how slow there services were....after going through the
code...i find
things like the below
most of there looping looks like this

while true
if (somevalue=somevalue)
{
obj=new business1();
obj.method1();
}
elseif (somevalue=somvalue)
{
obj = new business1();
obj.Method2();
}
} // end while
notice the same object being created each loop
instead of being created once outside the loop
the exec the methods
go through 30000 iterations and thats 30000 new instances
of the same object instead of 1.

there excuse was it works..
funny how lots of people think
MJ
"OD" <webmaster @ e-naxos dot comwrote in message
news:mn.3cc67d77cb45103c.18651@e-naxosdotcom...
Like some others in this thread I'm not sure you will see a big difference
about performances..

I recently wrote a complete test between C# and Delphi 2006, a kind of
benchmark.
Each code does exactly the same thing, one built on BDS 2006, the other on
VS 2005. Each code has been written to respect each language (no unfair
trick to give advantage to one language).
Results are that the C# version is about 25 to 40 % faster than the Delphi
2006 one (depending on the computer, Intel processors giving best C#
results than AMD ones, but always C# faster than Delphi).

Memory management, strings, maths, file IO, I tested what most
applications are supposed to do when they're working.

So, as I'm knowing C++ is very near Delphi on the performance side (I
tested this a couple of years ago), I think switching to C++ will decrease
the overall performances of your application. And you'll lose all the
benefit of the CLR and the object API of the framework. Win32 API is a
mess...

--
OD___
www.e-naxos.com


Jul 8 '07 #23
On Sun, 08 Jul 2007 11:55:59 -0700, MikeJ <ve***********@yahoo.comwrote:
heck we have programmers at my office that has programmed for years,
when i
was hired i saw how slow there services were....
True enough. Time spent programming is no guarantee of quality. A person
can do the same thing wrong for years without ever figuring it out.
[...]
notice the same object being created each loop
instead of being created once outside the loop
the exec the methods
go through 30000 iterations and thats 30000 new instances
of the same object instead of 1.
Of course, it begs the question: what sort of design requires that you
instantiate an object just to call a single method? I can think of
exceptions to the rule, but generally speaking that's the sort of thing
that is better handled by static methods, or in some cases a singleton
class.

That said, my understanding is that instantiating objects over and over in
..NET isn't really all that expensive, relatively speaking. In that loop
you posted, even if you move the instantiation of that one object out of
the loop, there's no reason to believe that calling the methods doesn't
also instantiate new objects as well. So you save one instantiation of
what could be several or even dozens.

Also, I gather that the framework has optimized for this case, caching the
memory blocks needed for objects that are reused frequently. Of course,
that doesn't help with the actual initialization, but objects should
generally be designed so that initialization isn't expensive, and again
those methods could be instantiating plenty of new objects each time as
well.

I agree that the code could be cleaner, but there seem to be greater
things wrong with the design there than where the object gets
instantiated, and there _is_ something to be said for not worrying too
much about performance until there's a proveably slow area of code.

Pete
Jul 8 '07 #24
I agree...ive since re wrote all that code...and
its like 100 times faster...and in this case
there static now

MJ

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sun, 08 Jul 2007 11:55:59 -0700, MikeJ <ve***********@yahoo.comwrote:
>heck we have programmers at my office that has programmed for years,
when i
was hired i saw how slow there services were....

True enough. Time spent programming is no guarantee of quality. A person
can do the same thing wrong for years without ever figuring it out.
>[...]
notice the same object being created each loop
instead of being created once outside the loop
the exec the methods
go through 30000 iterations and thats 30000 new instances
of the same object instead of 1.

Of course, it begs the question: what sort of design requires that you
instantiate an object just to call a single method? I can think of
exceptions to the rule, but generally speaking that's the sort of thing
that is better handled by static methods, or in some cases a singleton
class.

That said, my understanding is that instantiating objects over and over in
.NET isn't really all that expensive, relatively speaking. In that loop
you posted, even if you move the instantiation of that one object out of
the loop, there's no reason to believe that calling the methods doesn't
also instantiate new objects as well. So you save one instantiation of
what could be several or even dozens.

Also, I gather that the framework has optimized for this case, caching the
memory blocks needed for objects that are reused frequently. Of course,
that doesn't help with the actual initialization, but objects should
generally be designed so that initialization isn't expensive, and again
those methods could be instantiating plenty of new objects each time as
well.

I agree that the code could be cleaner, but there seem to be greater
things wrong with the design there than where the object gets
instantiated, and there _is_ something to be said for not worrying too
much about performance until there's a proveably slow area of code.

Pete

Jul 8 '07 #25
ModelBuilder wrote:
I "prefer" both, depending on the requirements of the project. For one
project we need to interface with CORBA objects, so java is prefered. For
one project, we are required to interface with relational databases, so
csharp is preferred.
It may surprise you, but Java actually do have support for
relational databases.

Arne

Jul 9 '07 #26
herr wrote:
I read on the internet that only %4 of Windows vista is written in .Net . Is
this really how MS makes use of its own technology, or should we be happy
because there is something like Paint.Net out there?!

IMHO Paint.Net is a nice demonstration of what we can do with .net, but
again, in terms of overall performance, it can't beat PhotoShop or
CorelDraw.
I don't think MS has official mentioned the numbers, but let
us assume:
XP - 40 MLOC
Vista - 50 MLOC

1) It would require a lot of money (even for MS) to port 40 MLOC
from C++ to .NET.

2) Vista for obvious reasons still have to support Win32 API. It is
much easier to have .NET code call Win32 code than the other way
around.

3) Some of the low level stuff is not suited for managed code.

Arne

PS: I thought Paint.Net was an paint program like PhotoShop in the
same way as WordPad is an editor like Visual Studio ... :-)
Jul 9 '07 #27
Saying I prefer .Net over Java, doesn't come anywhere close to saying .Net
is better than Java. Especially in the context that post, where I explicitly
said Java & .Net are pretty similar.

I prefer English over Spanish, but that doesn't mean English is the best
language. It just happens to be the one I know very well.

Now, Managed Vs. UnManaged for a user application - that's a no brainer.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"OD" <webmaster @ e-naxos dot comwrote in message
news:mn.43647d77e9db3dbc.18651@e-naxosdotcom...
Our friend choice was between unmanaged/managed environments. You're
speaking about java/c# choice, two managed environment. It's clear
differences are not so big in this case.
But meanwhile, you're saying "I prefer .net", so as you're not silly,
you're thinking .net is "best than" java.
Hard to "prefer" without saying "it's best"...

--
OD___
www.e-naxos.com


Jul 9 '07 #28
Gaz
"herr" <he***@hotmail.comwrote in message
news:eg**************@TK2MSFTNGP04.phx.gbl...
>
>I am very skeptical on whether you will see significant
performance improvements by that change.

Then why is it that .net is not used by big software companies like Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.

Technologies are continuously being made that abstract programmers further
and further away from 'the machine'. Long gone are the days where you could
buy 'Advanced Reference Manuals' detailing all the memory address space,
every OS call and all the hardware interrupts and vectors that you could
handle and intercept yourself etc etc. Writing in assembly language was a
pleasure and the whole machine was yours to program as you wish.

But Microsoft have done their damnest to protect 'their' OS and stop
programmers getting within a barge pole of the kernel, you can't easily do
it any more, there isn't even a single tasking 'CLI' mode. .NET is one of
these high level technologies and comes with a complete online programmers
reference library, everyone uses them and you're forced to move along, but
the original Win32 programmers are not. Why program with added layers of
abstraction, once you have the whole Win32 in your head there's no reason to
move on IMO.
Jul 10 '07 #29
Yes, I realize you can use both languages for both requriements. I just
prefer each for the uses that I stated. Probably my java db aversion is a
few years old and needs a revisit though...

"Arne VajhÞj" wrote:
ModelBuilder wrote:
I "prefer" both, depending on the requirements of the project. For one
project we need to interface with CORBA objects, so java is prefered. For
one project, we are required to interface with relational databases, so
csharp is preferred.

It may surprise you, but Java actually do have support for
relational databases.

Arne

Jul 10 '07 #30
"Gaz" <a@b.comwrote:
Why program with added layers of abstraction, once you have the whole
Win32 in your head there's no reason to move on IMO.
I can't decide if you really mean this, or are being sarcastic. At the risk
of looking foolish, I'll go with "really mean it" for $200.

The reason is that most people can do more in 15 minutes with WinForms and
..Net than they could in several days worth of Win32 programming (or even
Java and a good GUI toolkit, or, heck VB6). .Net has taken all the really
common use cases for development and made them very easy to use.This
evolution has taken place over 10+ years, and is very far along.

There's a reason application like VB (3,4,5,6), Delphi, C++ Builder, and MFC
all did so well - it's because Win32 is a slow and painful environment to
work in. Why anyone would choose to code against a "C" API in this day and
age is a mystery to me.

Creating fancy windows? Adding Skins to an application? Click-Once
Deployment? Adding Menu's and Toolbars? Adding a Office Style Ribbon? MDI?
SDI? Animations? Office Automation? File I/O? Socket I/O? Windows Services?
Database Access? All of these are much easier to code in .Net over Win32.
The difference is so vast between the two, that coding in Win32 is no longer
cost effective.

Yes, there are tasks bests suited to pure Win32, but they're few and far
between and the numbers are shrinking.

Before you ask, yes, I spent years building Win32 applications in C++, and
was (at least at one point) very good at it. I'm also very good at building
apps in .Net, and I can say there's no comparison for any of the major use
cases.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins
Jul 10 '07 #31
Is there any profiler for free on the net that you recommmand?
"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:F6**********************************@microsof t.com...
>
"herr" <he***@hotmail.comwrote in message
news:Ot**************@TK2MSFTNGP05.phx.gbl...
>Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't
really

Probably not a good idea to rewrite the whole thing. Use a profiler, find
out what portions of the code have performance problems, and rewrite just
those.
>know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!

Jul 10 '07 #32
It is now 6 years after the time .Net first came out.

I still wait, but you know, all major companies, like Sony, canon, Philips,
Nokia and many others still write software for their products in
c++/MFC/win32 , although there are no legacy codes there for many of their
new applications and their only target platforms is mainly Win XP (was not
..net platform free?!)

You think Google would code its Google Earth, Google Talk, Picasa, Google
Desktop and other products in C# if .Net Framework was preinstalled on
Windows XP ?

I am so Cynic on this issue. I don't think any of these big companies will
ever write their commercial products in .net ( except for some small
utilities list "Disk-to-Phone) by SonyEricsson)

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sat, 07 Jul 2007 10:11:36 -0700, herr <he***@hotmail.comwrote:
>Then why is it that .net is not used by big software companies like
Adobe,
Yahoo, Google and even Microsoft (even in Vista) ? I mean in Desktop
applications.

For a variety of reasons, none of which have anything to do with
performance.

Also, I doubt it's true that the companies you mentioned don't use .NET in
any of their applications. For sure, it's not true for Microsoft, though
as is also the case for Adobe, the major desktop applications (e.g.
Microsoft Office programs) aren't going to be in .NET because .NET wasn't
around when the bulk of the code for those applications was written.
>>What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?

I don't know! What is the most used GUI library in the market? The best
for
windows XP / Vista platforms.

.NET is IMHO the best GUI library to use on Windows.

If you're not going to use .NET, then you might as well learn the native
Win32 API and stick with that.

Personally, I think the business of "performance issues mainly" is
invalid. Only certain specialized applications would have "performance
issues", and even in those cases that's no reason to abandon .NET
altogether. It _is_ a reason to identify the elements of the application
that are not performing well and do something about it.

But most of your performance problems will turn out to be algorithm design
errors, rather than something inherently slow about .NET, and for the tiny
fraction of things that really are a limitation of .NET, you can implement
those in some other language in a separate module and then call that from
your .NET code. That will allow you to take full advantage of the
services .NET offers without sacrificing performance.

You should, of course, feel free to redevelop your code however you like.
If you want to stop using .NET, that's your perogative. But if you
believe that you will see significant performance gains doing so, I
suspect you are in for some disappointment.

Pete

Jul 10 '07 #33
Again. Who cares? The worth of .NET is not proven or disproven by the
decision of "big companies" to use it or not.
And who were the main targets of this technology?
Jul 10 '07 #34
I have one other questions. What is the largest application written
in .net? (except for the Framework itself).
Don't know exactly, but at least MS BizTalk Server is not the smallest
application that is based 100% on .NET (I am not sure, but I think v2002
was still legacy code, for version 2004 they made the big switch...).

Markus
Jul 10 '07 #35
On Tue, 10 Jul 2007 01:56:44 -0700, herr <he***@hotmail.comwrote:
And who were the main targets of this technology?
Who cares? What difference does it make? If the technology is useful,
use it. If it's not, don't.
Jul 10 '07 #36
If you are so convinced and cynical (as you describe yourself) that .NET is
NOT the "best" (whatever that means) for you, then why are you posting here.
Why don't you go to whoever you perceive to be experts in C++ and Win32 API
programming and ask THEM for advice?

Please comment.


"herr" <he***@hotmail.comwrote in message
news:Ot**************@TK2MSFTNGP05.phx.gbl...
Hi all,

For some reasons, I am moving away from managed c# (after using it for 3
years) and want to code my windows application in native C++ (perfomance
issues mainly). I already have a small knowledge of c++, but don't really
know what to read to learn writing advanced windows applications with it.
Any one can help me on my way to mastering c++ windows software writing?
I need some books, tutorials, online communities or what ever you guys
just know tell me.

Thanks for you help anyway!

Jul 10 '07 #37
herr wrote:
I still wait, but you know, all major companies, like Sony, canon, Philips,
Nokia and many others still write software for their products in
c++/MFC/win32 , although there are no legacy codes there for many of their
new applications and their only target platforms is mainly Win XP (was not
.net platform free?!)

You think Google would code its Google Earth, Google Talk, Picasa, Google
Desktop and other products in C# if .Net Framework was preinstalled on
Windows XP ?
Most of the Google apps support Windows, MacOS X and Linux.

With that requirement I can understand that they did consider
alternatives to .NET (and Mono for MacOS X and Linux).
I am so Cynic on this issue. I don't think any of these big companies will
ever write their commercial products in .net ( except for some small
utilities list "Disk-to-Phone) by SonyEricsson)
How many really big new desktop apps has been created within
the last 6 years ?

My guess is: not many.

We know that .NET apps are doing very well as replacement for
VB6 client apps.

We know that ASP.NET are doing very well in business web sites.

Arne
Jul 11 '07 #38
>>What GUI library do you want to code against ? Win32 API ? MFC ?
>>wxWidgets ? Qt ?

I don't know! What is the most used GUI library in the market? The best
for
windows XP / Vista platforms.

There are a lot MFC code out there.

But I would consider .NET and WPF a much more future proof
route than MFC.
No evidence supporting that. Microsoft has indicated a commitment to
maintaining and improving MFC.

WPF will be faster than the raw Win32 API for graphics intensive things,
unless you want to code against DirectX yourself.
>
Arne

Jul 11 '07 #39

"herr" <he***@hotmail.comwrote in message
news:OE**************@TK2MSFTNGP06.phx.gbl...
>
>Again. Who cares? The worth of .NET is not proven or disproven by the
decision of "big companies" to use it or not.

And who were the main targets of this technology?
Database-intensive line-of-business web apps.
Jul 11 '07 #40

"Chris Mullins [MVP]" <cm******@yahoo.comwrote in message
news:uJ**************@TK2MSFTNGP06.phx.gbl...
"Gaz" <a@b.comwrote:
>Why program with added layers of abstraction, once you have the whole
Win32 in your head there's no reason to move on IMO.

I can't decide if you really mean this, or are being sarcastic. At the
risk of looking foolish, I'll go with "really mean it" for $200.

The reason is that most people can do more in 15 minutes with WinForms and
.Net than they could in several days worth of Win32 programming (or even
Java and a good GUI toolkit, or, heck VB6). .Net has taken all the really
common use cases for development and made them very easy to use.This
evolution has taken place over 10+ years, and is very far along.
That's a case for reusing a higher level library, yes. Not for using the
..NET runtime.
>
There's a reason application like VB (3,4,5,6), Delphi, C++ Builder, and
MFC all did so well - it's because Win32 is a slow and painful environment
to work in. Why anyone would choose to code against a "C" API in this day
and age is a mystery to me.
C APIs are incredibly friendly to a huge number of languages. They also
tend not to break binary compatibility because you upgraded the compiler.
Try writing a C# 2.0 plugin for a .NET 1.1 application... I think straight
Win32 API still wins in some scenarios, .NET can still manage to do it, but
no longer any less programming effort.
>
Creating fancy windows? Adding Skins to an application? Click-Once
Deployment? Adding Menu's and Toolbars? Adding a Office Style Ribbon? MDI?
SDI? Animations? Office Automation? File I/O? Socket I/O? Windows
Services? Database Access? All of these are much easier to code in .Net
over Win32. The difference is so vast between the two, that coding in
Win32 is no longer cost effective.
All of the above I might agree with except I/O. Pure Win32 beats .NET by a
handsome margin in the area of usability there, because .NET doesn't allow
completion functions to be run sequentially on the main thread. Sure, some
applications have multiple independent users, but anything where the
connections are coupled doesn't benefit from being forced into using thread
queues.
Jul 11 '07 #41
Ben Voigt [C++ MVP] wrote:
>>>What GUI library do you want to code against ? Win32 API ? MFC ?
wxWidgets ? Qt ?
I don't know! What is the most used GUI library in the market? The best
for
windows XP / Vista platforms.
There are a lot MFC code out there.

But I would consider .NET and WPF a much more future proof
route than MFC.

No evidence supporting that. Microsoft has indicated a commitment to
maintaining and improving MFC.
And why do you think they have found it necessary to do that ?

Because everybody is convinced that MFC has a great future ahead
or because everybody is expecting that MFC could go the way of VB6
as soon as MSO are redone in .NET ?

http://forums.microsoft.com/MSDN/Sho...70938&SiteID=1
http://forums.microsoft.com/MSDN/Sho...80803&SiteID=1

shows some status.

Arne

Jul 15 '07 #42
Ben Voigt [C++ MVP] wrote:
"Chris Mullins [MVP]" <cm******@yahoo.comwrote in message
>There's a reason application like VB (3,4,5,6), Delphi, C++ Builder, and
MFC all did so well - it's because Win32 is a slow and painful environment
to work in. Why anyone would choose to code against a "C" API in this day
and age is a mystery to me.

C APIs are incredibly friendly to a huge number of languages. They also
tend not to break binary compatibility because you upgraded the compiler.
Try writing a C# 2.0 plugin for a .NET 1.1 application... I think straight
Win32 API still wins in some scenarios, .NET can still manage to do it, but
no longer any less programming effort.
It is not obvious to me that there are any difference in
compatibility.

..NET 1.1 code is expected to always work with 2.0

..NET 2.0 code is not expected to always work with 1.1

Win32 API in Win 2000 is expected to always work in 2003.

Win32 API in Win 2003 is not expected to always work in 2000.

Arne
Jul 15 '07 #43

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Ben Voigt [C++ MVP] wrote:
>"Chris Mullins [MVP]" <cm******@yahoo.comwrote in message
>>There's a reason application like VB (3,4,5,6), Delphi, C++ Builder, and
MFC all did so well - it's because Win32 is a slow and painful
environment to work in. Why anyone would choose to code against a "C"
API in this day and age is a mystery to me.

C APIs are incredibly friendly to a huge number of languages. They also
tend not to break binary compatibility because you upgraded the compiler.
Try writing a C# 2.0 plugin for a .NET 1.1 application... I think
straight Win32 API still wins in some scenarios, .NET can still manage to
do it, but no longer any less programming effort.

It is not obvious to me that there are any difference in
compatibility.

.NET 1.1 code is expected to always work with 2.0

.NET 2.0 code is not expected to always work with 1.1

Win32 API in Win 2000 is expected to always work in 2003.

Win32 API in Win 2003 is not expected to always work in 2000.

Arne
That's a huge difference in compatibility. In one case you are talking
about the toolchain, in the other case about the API.

C++ code compiled in VC++ 2005 on Win2003 will run just fine on Win2000,
even if it uses new C++ features introduced in the newer compiler, as long
as you stick to the rather large subset of Win32 functions available in
Win2000.

You can't, however, use VS2005 and the new C# compiler to build code that
will run on .NET 1.1, whether you use the new classes or not. More to the
point, even if the user has .NET 2.0, you can't use C# 2.0 to build a plugin
for an application built with .NET 1.1 -- you can't tell the C# 2.0 compiler
to emit metadata that the old app can understand. Multiple versions of the
C runtime happily coexist in the same process, while multiple .NET runtimes
do not.
Jul 16 '07 #44
Good points!

..NET just has many flaws too.

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:ez**************@TK2MSFTNGP03.phx.gbl...
>
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
>Ben Voigt [C++ MVP] wrote:
>>"Chris Mullins [MVP]" <cm******@yahoo.comwrote in message
There's a reason application like VB (3,4,5,6), Delphi, C++ Builder,
and MFC all did so well - it's because Win32 is a slow and painful
environment to work in. Why anyone would choose to code against a "C"
API in this day and age is a mystery to me.

C APIs are incredibly friendly to a huge number of languages. They also
tend not to break binary compatibility because you upgraded the
compiler. Try writing a C# 2.0 plugin for a .NET 1.1 application... I
think straight Win32 API still wins in some scenarios, .NET can still
manage to do it, but no longer any less programming effort.

It is not obvious to me that there are any difference in
compatibility.

.NET 1.1 code is expected to always work with 2.0

.NET 2.0 code is not expected to always work with 1.1

Win32 API in Win 2000 is expected to always work in 2003.

Win32 API in Win 2003 is not expected to always work in 2000.

Arne

That's a huge difference in compatibility. In one case you are talking
about the toolchain, in the other case about the API.

C++ code compiled in VC++ 2005 on Win2003 will run just fine on Win2000,
even if it uses new C++ features introduced in the newer compiler, as long
as you stick to the rather large subset of Win32 functions available in
Win2000.

You can't, however, use VS2005 and the new C# compiler to build code that
will run on .NET 1.1, whether you use the new classes or not. More to the
point, even if the user has .NET 2.0, you can't use C# 2.0 to build a
plugin for an application built with .NET 1.1 -- you can't tell the C# 2.0
compiler to emit metadata that the old app can understand. Multiple
versions of the C runtime happily coexist in the same process, while
multiple .NET runtimes do not.

Jul 18 '07 #45

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
47
by: Bonj | last post by:
I downloaded the gzlib library from zlib in order to do compression. (http://www.gzip.org/zlib) The prototype of the compression function seems to be int compress (Bytef *dest, uLongf *destLen,...
12
by: Leo Muller | last post by:
I always thought that moving from VB.NET to C# would be very easy. Even though so far it hasn't been hard, there are some annoying things, that may have to do with my visual studio settings. -...
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
14
by: John | last post by:
My friend told me that his company will migrate the VC++ win32 applications to C++ .NET windows applications. I don't understand why since currently Microsoft only supports .NET on windows...
23
by: JohnH | last post by:
I'm just recently come to work for an auto brokerage firm. My position involves performing mysterious rites, rituals and magick in order to get information out of their access database. This is...
3
by: =?Utf-8?B?d2lsa29rb3N0ZW4=?= | last post by:
Dear all, I have the following question: I want to populate a datagridview after my BackGroundWorker has finished. I thought i could use the RunWorkerCompleted event to update my datagridview...
7
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.