Hi All,
The question is why should I use C#?
If am developing a windows application, what are the advantages of using C#
versus VC++ (MFC)?
Thanks
AliR. 12 1116
In the end, it depends on the person. There will be some people that
find using MFC much easier than .NET. However, most people find that .NET
is about a gajillion times easier to use than MFC.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"AliR" <Al**@online.nospam> wrote in message
news:cG******************@newssvr25.news.prodigy.n et... Hi All,
The question is why should I use C#? If am developing a windows application, what are the advantages of using C# versus VC++ (MFC)?
Thanks AliR.
I'm not going to get into a language war - use whatever fits your style and
the needs of your application - however, I will say that you will help
yourself if you dump MFC and switch to .NET - with either C# or C++ (or any
of the other languages available).
I used C++/MFC for many years. Then I switched to C#/.NET for personal
projects when that was available, because the C++ support for .NET was pretty
disappointing. Now, C++/.NET is a much more viable solution, and I am
thinking about switching back to C++ again (which is what I use at work all
the time).
"AliR" wrote: Hi All,
The question is why should I use C#? If am developing a windows application, what are the advantages of using C# versus VC++ (MFC)?
Thanks AliR.
"AliR" <Al**@online.nospam> wrote in message
news:cG******************@newssvr25.news.prodigy.n et... The question is why should I use C#? If am developing a windows application, what are the advantages of using C# versus VC++ (MFC)?
That's very difficult to quantify. The "general" consensus of opinion is
that .NET is *MUCH* easier to use than MFC so, logically, you could expand
on that and say that easier to use means quicker to develop, and quicker to
develop means quicker to market, and quicker to market means faster return
on investment...which can only be a good thing... :-)
However, only you can decide whether you find .NET easier (i.e. quicker)
than MFC...
Hello AliR,
(usually I see you in the C++ sections!) Our company has decided to go with
C# for our new devlopment for a few reasons (we still use C++ on a ddaily
basis).
It just works. It makes more sense and you use a lot fewer lines of code to
do the same thing as in C++... Like with the TansparentStatic text... C#
already takes care of that automatically (your class saved my neck on a
deadline though for C++!).
The controls look a lot better.
Version control should be a lot better with the OneClick development
(compared to our current method).
Office automation (what a nightmare) is supposed to be easier and I have
been finding more documentation for it than with C++. ... Actually I have
found more examples with VB.NET which I think we can still incorperate in our
C# code (not sure how that works yet).
From what I have read there is supposed to be more consistancy accross OS's
using C# (or just .NET in general) since it is the same framework. I know we
have had problems in the past between differnt Windows versions with some of
the software we write in C++.
Sockets are supposed to be easier according to my comrade in the next room.
He said something about SSL being built in to the .NET framework whereas we
are having to use a 3rd party library for it in C++.
Alot of these things are just projections and things I have been told to be
true... and with the little programming I have done so far, a lot of it
checks out. I am not a pro though (entry level, small company). Pleaes
don't hold me responsible for these comments if they are in error... these
are the preconceptions I have about it from what I have read, etc... Can any
one confirm these comments?
Rob K
"AliR" wrote: Hi All,
The question is why should I use C#? If am developing a windows application, what are the advantages of using C# versus VC++ (MFC)?
Thanks AliR.
> If am developing a windows application, what are the advantages of using C#
The main reason I moved from VB to java (bear with me for a sec. :>) was
cause it was closer to the OS, lower level power than VB, but not so low as
the C++ layer. I was rather disappointed with java though (just overall,
everything was rough around the edges). Then I started looking at C# and
found it VERY nice! Yes, it is easier IMHO, like others have said. But
what makes it easier?
First thing that comes to mind is NO MORE POINTERS!!!!!!!!! haha But the
truth be told, you still do have them, they're just called references. I
went to VB from C cause I hated pointers! Then after learning more and more
about java, they have pointers as well (like C#, just by another name,
references). So that was a bummer, but then you get over it and move onto
my next point. :>
The major thing that makes C# nice, easy to use, is it allows you to
concentrate on WHAT you're trying to do, not HOW. It's the WHAT that I love
so much! With Visual Studio (any version :>), you can simply draw your
form, double click controls, add handlers, etc. You're into the meat and
doing what you want to do. With C++ I find you spend sooooooo much time
setting things up, setting up the framework, getting the communications,
setting up classes, etc. IMHO, there's soooo much time wasted on the HOW,
by the time you get to the what, you're bored and don't care anymore.
But that's must IMHO. Good luck! :>
Hi Rob,
I am glad the Transparent Static class helped you out. :)
The reason I asked this question here is that, for the past year every time
I talk to a headhunter about jobs they tell me that they haven't ran into a
C++ job in a while, and all the companies that they deal with want C#
programmers.
I have read a book on C# (Teach yourself in 21 days, got it free from
codeguru for my Transparent Listbox), and I am reading the Wrox Beginner C#
..net 2005 now. What I have noticed so far is that it is easy to develop
simple dialog base applications (I don't deny that), but it seems very
difficult when it comes to MDI applications. Specially in regards to Docking
windows, menu/toolbar management. I also find it's event handling a bit
convoluted. It's just not easy to read, and know what events are being
handled and which ones aren't.
So the reason I asked this question here is that I wanted to know why people
prefer C# over C++. I don't have enough expirence with C# to make a good
judgment about the language, but from what I have seen so far I find MFC
easier to deal with, and alot more flexiable than C#. So I wanted to find
out from people who actually use C# what they find like about it.
AliR.
"RobKinney1" <Ro********@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com... Hello AliR,
(usually I see you in the C++ sections!) Our company has decided to go
with C# for our new devlopment for a few reasons (we still use C++ on a ddaily basis).
It just works. It makes more sense and you use a lot fewer lines of code
to do the same thing as in C++... Like with the TansparentStatic text... C# already takes care of that automatically (your class saved my neck on a deadline though for C++!).
The controls look a lot better.
Version control should be a lot better with the OneClick development (compared to our current method).
Office automation (what a nightmare) is supposed to be easier and I have been finding more documentation for it than with C++. ... Actually I have found more examples with VB.NET which I think we can still incorperate in
our C# code (not sure how that works yet).
From what I have read there is supposed to be more consistancy accross
OS's using C# (or just .NET in general) since it is the same framework. I know
we have had problems in the past between differnt Windows versions with some
of the software we write in C++.
Sockets are supposed to be easier according to my comrade in the next
room. He said something about SSL being built in to the .NET framework whereas
we are having to use a 3rd party library for it in C++.
Alot of these things are just projections and things I have been told to
be true... and with the little programming I have done so far, a lot of it checks out. I am not a pro though (entry level, small company). Pleaes don't hold me responsible for these comments if they are in error... these are the preconceptions I have about it from what I have read, etc... Can
any one confirm these comments?
Rob K
"AliR" wrote:
Hi All,
The question is why should I use C#? If am developing a windows application, what are the advantages of using
C# versus VC++ (MFC)?
Thanks AliR.
"AliR" <Al**@online.nospam> wrote in message
news:fU******************@newssvr11.news.prodigy.c om... What I have noticed so far is that it is easy to develop simple dialog base applications (I don't deny that), but it seems very difficult when it comes to MDI applications. Specially in regards to Docking windows, menu/toolbar management.
I can't compare C# with C++, but it's my experience that WinForms C# is
vastly superior to VB6 when it comes to MDI apps. I reckon I can develop an
MDI app in C# in approximately a third of the time it would take me in VB6.
I also find it's event handling a bit convoluted. It's just not easy to read, and know what events are being handled and which ones aren't.
Again, that's not my experience at all. I really like the C# events,
especially when used in conjunction with ASP.NET and all the event bubbling
that goes on there...
I suspect that once you've done it for a while, you'll find that C# is
actually far easier than C++. Docking is pretty simple and I doubt MDI apps
are going to be all that difficult either, though in all honesty, I haven't
done an MDI app yet.
I did C++ for years and I liked it for the power it gave me. But I switched
to C# and after 3 years, I can't even imagine going back to C++. I've had to
for a few things and each time I've found it painful. Dealing with strings,
all the memory management (not that it's completely gone in C#, but it's
MUCH easier).
In C#, I can be 4 to 5 times as productive as in C++.
When it comes down to it, that's the only reason I need. It makes me far
more productive.
Pete
"AliR" <Al**@online.nospam> wrote in message
news:fU******************@newssvr11.news.prodigy.c om... Hi Rob,
I am glad the Transparent Static class helped you out. :)
The reason I asked this question here is that, for the past year every time I talk to a headhunter about jobs they tell me that they haven't ran into a C++ job in a while, and all the companies that they deal with want C# programmers. I have read a book on C# (Teach yourself in 21 days, got it free from codeguru for my Transparent Listbox), and I am reading the Wrox Beginner C# .net 2005 now. What I have noticed so far is that it is easy to develop simple dialog base applications (I don't deny that), but it seems very difficult when it comes to MDI applications. Specially in regards to Docking windows, menu/toolbar management. I also find it's event handling a bit convoluted. It's just not easy to read, and know what events are being handled and which ones aren't.
So the reason I asked this question here is that I wanted to know why people prefer C# over C++. I don't have enough expirence with C# to make a good judgment about the language, but from what I have seen so far I find MFC easier to deal with, and alot more flexiable than C#. So I wanted to find out from people who actually use C# what they find like about it.
AliR.
"RobKinney1" <Ro********@discussions.microsoft.com> wrote in message news:CD**********************************@microsof t.com... Hello AliR,
(usually I see you in the C++ sections!) Our company has decided to go with C# for our new devlopment for a few reasons (we still use C++ on a ddaily basis).
It just works. It makes more sense and you use a lot fewer lines of code to do the same thing as in C++... Like with the TansparentStatic text... C# already takes care of that automatically (your class saved my neck on a deadline though for C++!).
The controls look a lot better.
Version control should be a lot better with the OneClick development (compared to our current method).
Office automation (what a nightmare) is supposed to be easier and I have been finding more documentation for it than with C++. ... Actually I have found more examples with VB.NET which I think we can still incorperate in our C# code (not sure how that works yet).
From what I have read there is supposed to be more consistancy accross OS's using C# (or just .NET in general) since it is the same framework. I know we have had problems in the past between differnt Windows versions with some of the software we write in C++.
Sockets are supposed to be easier according to my comrade in the next room. He said something about SSL being built in to the .NET framework whereas we are having to use a 3rd party library for it in C++.
Alot of these things are just projections and things I have been told to be true... and with the little programming I have done so far, a lot of it checks out. I am not a pro though (entry level, small company). Pleaes don't hold me responsible for these comments if they are in error... these are the preconceptions I have about it from what I have read, etc... Can any one confirm these comments?
Rob K
"AliR" wrote:
> Hi All, > > The question is why should I use C#? > If am developing a windows application, what are the advantages of > using C# > versus VC++ (MFC)? > > > Thanks > AliR. > > >
AliR... If you are a C++ programmer there is no need to change languages
with c++/cli. Just target the .NET framework in C++/cli and call native
code using ItJustWorksInterop.
In the following C++/cli code demonstrating Resource Acquisition Is
Initialization, the destructor will be called when r goes out of scope.
This is an exception safe guarantee.
RAII r;
r.SayHello();
Console::WriteLine(r.I);
Here is C++/cli syntax that a C# programmer should be able to read:
public ref class RAII
{
private:
int i;
bool isDeleted;
public:
RAII() : i(2), isDeleted(false)
{
Console::WriteLine(L"Constructor called.");
}
~RAII() // maps to Dispose
{
if (!isDeleted) { // release once only
// clean up managed resources here.
Console::WriteLine(L"Releasing managed resources.");
this->!RAII(); // clean up unmanaged resources here.
}
this->isDeleted= true;
Console::WriteLine(L"Destructor called.");
// finalize (!RAII) is automagically suppressed
};
!RAII() // maps to Finalize
{
if (!isDeleted)
{
// Clean up unmanaged resources here.
Console::WriteLine(L"Releasing unmanged resources.");
}
Console::WriteLine(L"Finalizer called.");
}
property int I {
void set(int value) {this->i = value;}
int get() {return i;}
}
// this can be called even after this object has been disposed!
// ASSERT isDeleted is false
void SayHello()
{
if (isDeleted) {
throw gcnew System::InvalidOperationException();
}
Console::WriteLine(L"Hello");
}
void Close() {
if (!isDeleted) {
this->~RAII();
}
}
};
Here is a native C++ class with only a managed entry point:
public class Native {
public:
virtual int __clrcall Sum(int ai[], int size) {
int sum=0;
for(int i=0; i< size; i++) {
sum+= ai[i];
}
return sum;
}
};
Here is ItJustWorksInterop:
int SumInteropClrCall(array<int>^ ai) {
pin_ptr<int> ppi= &ai[0];
Native n;
return n.Sum(ppi,ai->Length);
}
Regards,
Jeff
*** Sent via Developersdex http://www.developersdex.com ***
"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:zL******************************@giganews.com ... When it comes down to it, that's the only reason I need. It makes me far more productive.
Yeah - that's pretty much the bottom line...
> The reason I asked this question here is that, for the past year every
time I talk to a headhunter about jobs they tell me that they haven't ran into
a C++ job in a while, and all the companies that they deal with want C# programmers.
I work in both C++/C# and also still use MFC, but I am happy that I do not
have to rely on MFC anymore and I am busy phasing out that MFC part.
C# has a much more clear syntax than C++ so you have less bugs and it also
compiles much faster.
The good news is that C# comes very close to C++, so it is not that hard to
learn C#.
I love programming in C#.
But it is up to you to decide what you want to program in.
VB.NET/C# and C++/CLI are different syntaxes but creates the same functional
program.
And I have to add, with C# no more linker errors like you get in C++ where
you sometimes need a few days to discover why the hell you get these
hunderds of compiler errors and why it occurs. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: William C. White |
last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using
cURL? Our website is hosted on a shared drive and the webhost company...
|
by: Albert Ahtenberg |
last post by:
Hello,
I don't know if it is only me but I was sure that header("Location:url")
redirects the browser instantly to URL, or at least stops the...
|
by: James |
last post by:
Hi,
I have a form with 2 fields.
'A'
'B'
The user completes one of the fields and the form is submitted.
On the results page I want to run a...
|
by: Ollivier Robert |
last post by:
Hello,
I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9
system. The link succeeds but everytime I try to run php, I get...
|
by: Richard Galli |
last post by:
I want viewers to compare state laws on a single subject.
Imagine a three-column table with a drop-down box on the top. A viewer
selects a state...
|
by: Albert Ahtenberg |
last post by:
Hello,
I have two questions.
1. When the user presses the back button and returns to a form he filled
the form is reseted. How do I leave...
|
by: inderjit S Gabrie |
last post by:
Hi all
Here is the scenerio ...is it possibly to do this...
i am getting valid course dates output on to a web which i have designed
....all...
|
by: Jack |
last post by:
Hi All,
What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g.
select x from y where z=:parameter
Which in asp/jsp...
|
by: Sandwick |
last post by:
I am trying to change the size of a drawing so they are all 3x3.
the script below is what i was trying to use to cut it in half ... I
get errors....
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
| |