Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: Buttons? Pin
Heath Stewart12-Jan-04 3:14
protectorHeath Stewart12-Jan-04 3:14 
GeneralPictureBox - Getting current mouse location Pin
MrEyes12-Jan-04 0:13
MrEyes12-Jan-04 0:13 
GeneralRe: PictureBox - Getting current mouse location Pin
Heath Stewart12-Jan-04 3:08
protectorHeath Stewart12-Jan-04 3:08 
GeneralRe: PictureBox - Getting current mouse location Pin
MrEyes12-Jan-04 3:25
MrEyes12-Jan-04 3:25 
GeneralShould I change C++ to C# Pin
TWS_Dave11-Jan-04 22:27
TWS_Dave11-Jan-04 22:27 
GeneralRe: Should I change C++ to C# Pin
Mazdak11-Jan-04 22:39
Mazdak11-Jan-04 22:39 
GeneralRe: Should I change C++ to C# Pin
Michael P Butler11-Jan-04 23:12
Michael P Butler11-Jan-04 23:12 
GeneralRe: Should I change C++ to C# Pin
Heath Stewart12-Jan-04 2:53
protectorHeath Stewart12-Jan-04 2:53 
The biggest difference is that .NET runs under a managed runtime, i.e. the Common Language Runtime (CLR) manages all memory and enforces certain constraints such as code-access security and native function calls. Of course, C/C++ has a runtime but that really provides simple execution.

As someone else mentioned, the base class library - the library that ships as part of the .NET Framework is lacking. This "lack" of functionality is redeemed by being able to P/Invoke (call native functions), control marshaling, and to perform COM interop very well (since .NET is a progression of - not a replacement for - COM).

The most important thing to understand is that C# is just one of many languages used to write .NET applications. All the compilers produce Intermediate Language (or IL, like Java bytecode, if you're familiar with that) except for the VC++ compiler which - with the /clr switch - is capable of create mixed mode assemblies where native instructions are embedded. The IL from any language is still contrained by the Common Type System (CTS) and the CLR and, hence, can be used by any other language that targets the CLR, but there might be some slight differences since some compilers optimize better / differently from language to language, and because some compilers don't support certain conventions in the language (like VB.NET cannot yet support unsigned integers or unsafe contexts).

I would recommend - as someone else hinted - that you don't just jump on board the .NET wagon. Understand the framework first. Also decide if you need to move the application. Remember, you would then have to deploy an average 20 MB runtime to each client and worry about versioning (versions in .NET are actually used to resolve Types whereas with native DLLs they're just for informational purposes).

If you do want to move to .NET development, I do recommend C#. If you already have a large codebase of libraries, you can turn-on the /clr switch in your project options in VS.NET 2002 and higher for your C++ to produce a mixed-mode assembly and use those in your application development, though you should eventually rewrite those libraries in pure .NET using whatever language you like. Managed C++ is still C++ so - as you know - there's a lot of extra code you have to write but not near as bad as C++ because you don't have to worry about memory as long as you use 100% managed code. C# is also syntactically similar to C++ so you shouldn't have too many problems picking it up.

So, when you think about .NET development, don't think of it so much in terms of languages but in terms of the base class library, IL and the CLR, and CTS. The language is just a means to an end, where those ends are almost the same and can be used by any other means (i.e., a library written in C# can be used by a library written in VB.NET which can be written by an appliction written in PERL.NET).

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Should I change C++ to C# Pin
Rocky Moore12-Jan-04 10:55
Rocky Moore12-Jan-04 10:55 
GeneralRe: Should I change C++ to C# Pin
TWS_Dave13-Jan-04 23:16
TWS_Dave13-Jan-04 23:16 
GeneralRe: Should I change C++ to C# Pin
Giles14-Jan-04 11:23
Giles14-Jan-04 11:23 
GeneralFolder Browser Dialog Pin
Itanium11-Jan-04 20:46
Itanium11-Jan-04 20:46 
GeneralRe: Folder Browser Dialog Pin
aneye11-Jan-04 21:55
aneye11-Jan-04 21:55 
GeneralRe: Folder Browser Dialog Pin
Heath Stewart12-Jan-04 2:10
protectorHeath Stewart12-Jan-04 2:10 
GeneralPaging - Performance - Scalability Pin
Mohamad Al Husseiny11-Jan-04 20:04
Mohamad Al Husseiny11-Jan-04 20:04 
GeneralRe: Paging - Performance - Scalability Pin
Heath Stewart12-Jan-04 2:26
protectorHeath Stewart12-Jan-04 2:26 
GeneralRe: Paging - Performance - Scalability Pin
Mohamad Al Husseiny12-Jan-04 21:53
Mohamad Al Husseiny12-Jan-04 21:53 
GeneralRe: Paging - Performance - Scalability Pin
Guillermo Rivero12-Jan-04 6:47
Guillermo Rivero12-Jan-04 6:47 
GeneralFileSystemObject in VB returns the wrong value when used from .NET Pin
RickardB11-Jan-04 16:46
RickardB11-Jan-04 16:46 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
Heath Stewart12-Jan-04 1:52
protectorHeath Stewart12-Jan-04 1:52 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
RickardB12-Jan-04 13:41
RickardB12-Jan-04 13:41 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
RickardB12-Jan-04 17:26
RickardB12-Jan-04 17:26 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
RickardB12-Jan-04 20:47
RickardB12-Jan-04 20:47 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
RickardB14-Jan-04 0:00
RickardB14-Jan-04 0:00 
GeneralRe: FileSystemObject in VB returns the wrong value when used from .NET Pin
Heath Stewart14-Jan-04 3:31
protectorHeath Stewart14-Jan-04 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.