View Full Version : Thoughts on C#
cjv
19th August 2002, 23:12
Hi,
Putting aside any personal opinions about Microsoft for a minute, I must say that my first impressions of C# as a language is rather positive and mono is coming along nicely for *nix.
Coming from a strong C/C++/*nix/Win32 background I was never too fond of Java and VMs in general, but after coding some simple sort algos (bubble, insert) in C++ vs. C#, the results were shocking. The C# MSIL code actually performed almost 50% faster than pure native optimized x86 code!
I admit I did only limited testing, but I am convinced that the performance is definately acceptable and will only get better in time.
C# allows GUI design like Delphi, but the C#/.NET skills will most likely be in demand in the work world(unfortunately)..when I finish school.
My only question...how many people would actually download the 20+meg .NET runtime if it was needed to run a utility that appeared to be useful? Say, some sort of gknot type of program (just as an example)
Coming from North America/broadband, I can say that 20 megs is nothing, but I am wondering if it is really a good idea to develop GUI utilities in C# that I intend to share with others?..or would just sticking with a Delphi frontend / partial C backend (my current strategy) be more appropriate for the end user.
Any opinions are welcome...
cjv
Nic
19th August 2002, 23:28
A colleage at work is quite smitten by it & has re-written one of his most important apps in it...(due to its ease & the fact you dont get memory leaks with C# ;) )
However, although C# does appear to be good, it does have huge (20meg is huge IMO) runtime & does take a good few seconds the first time you load an App. I think C# might be better for the developer to write the GUI but not better for the user....
But im not very familiar with it yet, but unless something specifically needs or could be done alot quicker in C#, I think ill stick with C++ (Im not too fond of Java either ;) )
Cheers,
-Nic
stax76
20th August 2002, 00:19
.NET developing is pure fun, but forget about somebody try to hear about a .NET program until MS comes up with a new version of a popular soft that includes the .NET Framework like Internet Explorer, Windows, a service pack for Windows or something like that. People keep asking me if .NET is something like a alien soft, you wouldn't believe me if I told you how many people asking me if I really think I need 20 MB to running a program
Emp3r0r
22nd August 2002, 06:06
I was well into learning java @ the university by the time the C# whitepaper was first released. I for one jumped on the .NET bandwagon for 12 dollars shipping back in the VS.NET beta 1 days. First time I coded in C# was like heaven. I had a massive AWESOME framework to work with. Everything I was interested in could be done as easy as pie: ASP, XML, Windows programming. It is so simple with the framework. I believe once directX.NET is out everyone will have runtimes if microsoft hasn't forced it on everyone's computer already. The most positive thing about C# is it being as standardized as Javascript, oh yea, AND free! One more thing, the code runs fast even though it is JIT. I think since everything breaks down into the CLR (Common Language Runtime) it is easier to optimize the MSIL code that gets compiled. I see a bright future for C#!
stax76
24th August 2002, 01:44
I believe once directX.NET is out everyone will have runtimes if microsoft hasn't forced it on everyone's computer already
XP SP1 will include the Framework and is scheduled at the end of the year, every serious XP user will install that, so times are getting better for .NET developers :)
Darksoul71
29th August 2002, 07:33
Hi !
Iīm from the Delphi & C++ corner and have not even touched C#. So I canīt talk about how easy C# programming is.
@cjv:
>The C# MSIL code actually performed almost 50%
>faster than pure native optimized x86 code!
I canīt believe this. What should be the reason behind it ?
Better memory management ?
If I could get my hands on a C# compiler I could verify this myself but I wouldnīt do performance tests using small QSort or ISort samples. Serious testing has to be done before you can judge performance differences.
>Coming from North America/broadband, I can say that 20 megs is nothing,
Coming from Germany/DialUp, I can say that 20 megs is pretty much. Although there are a lot of people using xDSL or ISDN, still a lot of people using DialUp connections. This contra argument of C# will loose strength if M$ includes the .NET framework in the next release of the Internet explorer. We will see.
@Nic:
>A colleage at work is quite smitten by it & has
>re-written one of his most important apps in it...
>(due to its ease & the fact you dont get memory leaks with C# )
Not to offend anyone but may be you colleage should learn how to avoid memory leaks in C++ instead switching to C# ?
@Dolemite:
>XP SP1 will include the Framework and is scheduled
>at the end of the year, every serious XP user will
>install that, so times are getting better for .NET developers
And what about all those Win9X users out there ? Not every one uses the latest OS of M$. But as I said above: When M$ includes .NET into a freely distributed software that will be release with the cover CDīs times will get better.
@Emp3r0r:
>The most positive thing about C# is it being as
>standardized as Javascript, oh yea, AND free!
Well, but itīs not portable as Javascript and the IDE for C# isnīt free at all (but itīs free for Java).
My final notes on C#:
I donīt see a THAT bright future for C#. Currently itīs overhyped as Java was some years before. What about portability with C# ? For my native C++ code I can choose nearly any OS and a C compiler to get it working on Win, *NIX, LynxOS, MacOS, etc.
And C# ? Well Win, and what else ?
IMHO any programming language that needs 20 MB runtime enviroment is $hit. I even donīt like MFC because it blows up the final code.
Example: If I do a simple GUI without too much funky effects and Bitmap buttons in Delphi I mostly end up with a 400 kB EXE. If I do the same GUI in VC using MFC it can get easily 1 MB. For those Dialup users out there it really matters if they have to download 300 kB for a small utility or 3 MB.
For you GUI programmers out there: Either use Delphi for an easy frontend programming or try out Borlandīs CBuilder which provides both C++ support as well as the "Delphi way" for GUI design instead of the horrible VC form designer where you have to edit object attributes by hand.
Iīll stick to my thrusty combination:
Delphi for the GUI and the most functions I can handle without too many hassle.
C++ where I have to "contact" Window functions because this is a pain in the ass without import units in Delphi.
And keep your apps small. pleaseeeeee..... :D
-D$
stax76
29th August 2002, 10:34
If I could get my hands on a C# compiler I could verify this myself but I wouldnīt do performance tests using small QSort or ISort samples. Serious testing has to be done before you can judge performance differences.
the .NET SDK which includes all you need to develop with the most popular .NET languages C# and VB is free but to big (above 100MB) for your modem, maybe you can find it on a cd of a magazin
Well, but itīs not portable as Javascript and the IDE for C# isnīt free at all (but itīs free for Java).
You can use SharpDevelop, a free IDE written in C#, but the best IDE will always be the MS one, compared to it's power, 140 Euro is cheap
I donīt see a THAT bright future for C#. we have C++ .NET, VB .NET, C#, J# and soon Delphi for .NET will be available too, the .NET class library is the best class library on this planet and it's getting better everyday, I wouldn't have spend so much time developing with .NET if I was't 100% convinced that .NET will be the new standard. .NET developing is real fast and real easy, don't matter what language, you can even use different languages for one program, mix it all up, language don't matter in .NET, this is one big advantage, there are many other big advantages and great new technologies, to many to write them all down here
Nic
30th August 2002, 12:13
@darksoul:
"Not to offend anyone but may be you colleage should learn how to avoid memory leaks in C++ instead switching to C# ? "
LoL...How big an application have you ever written Darksoul? no offence, obviously, but some memory leaks are nearly impossible to track down...thats why there are so many rediculously expensive tools to help programmers track them down in....
Its not as obvious as just making sure you have a "delete" for every "new" (or malloc/free)....As memory leaks rarely occur from your own creation, but normally from the creation of other libc or SDKs & you forget to close them correctly.
The difference, memory leak wise, between DeleteDC(...) & ReleaseDC(...), are quite huge :D :D as I once found out (nothing like taking 2Gigs of memory in about 20mins, just because of that little mistake :) )
Cheers,
-Nic
ps
using VC GUI's without MFC, & with a few tweaks, come out alot smaller than Delphi ones (although, obviously alot more difficult to create)
Darksoul71
30th August 2002, 14:42
Heya Nic !
LoL...How big an application have you ever written Darksoul?
no offence, obviously, but some memory leaks are nearly impossible to track down...thats why there are so many rediculously expensive tools to help programmers track them down in....
Itīs not the size that matters ! :D
No really: Beside my studies I develop tools for text analysis & text statistics. My tools are quite small but handle a lot of data in Hashtables, dynamic arrays, char pointers, etc.
I HAVE to avoid memory leaks by any means because if I just forget to remove ONE pointer entry this can easily f.. up even a 1 Gig RAM system. I know about how hard some memory bugs are to track down but this CAN be done. If C# doesnīt have any memory leak problems thatīs fine but think about a car and his driver:
Should someone who canīt drive correctly buy a "better" car with autopilot just because he canīt drive ? Or should he learn how to drive correctly with his old car ?
Hope you get the picture...
using VC GUI's without MFC, & with a few tweaks, come out alot smaller than Delphi ones (although, obviously alot more difficult to create)
Quite interesting point but even with MFC its a pain in the a.. to do GUIs in VC (at least compared to Delphi). May be Iīll get the chance to try out C# somewhere.
-D$
Nic
30th August 2002, 16:49
:) I know what your trying to say, I used to think the same way, but im sure youll understand as you have to write bigger & bigger applications
The bigger it is, the more threads there are & more SDKs it interfaces with, the app running day in & day out is what causes it. Most people dont notice there minor leaks, they can be so tiny...
Youll know what I mean oneday...
-Nic
-h
30th August 2002, 18:08
I think I'll be sticking to vanilla C for some time yet. Possibly move to Java, since it avoids so much of the kludging that C++ brought with it. But for the kind of stuff I write there's no real reason to change.
C# won't cross my mind for a couple years yet, forcing 20 MB onto people is a joke. Perhaps when market saturation crosses 50% or so.
-h
spyder
1st September 2002, 16:18
I have never used C# but am open to the possibility. I have become quite fluent in Java but would prefer something faster(currently perfecting my C/C++). I believe that Sun should have released a Java Bytecode to Native Compiler a long time ago. Sure Java bytecode is portable, but you could make a compiler to compile the bytecode to native for increased performance for that one architecture. If they don't want to do it themselves they could surely help out the GCC project on their GCJ compiler. If it weren't for all of the licensing issues, they would have a complete working compiler by now I think.
donovani
22nd September 2002, 07:37
What I think is overlooked is that people quite often feel as if MS or .NET supporters are expecting everyone to drop what they're doing and start coding immediately against the .NET runtime (and sometimes they're right :)). Rather, the reality is that the migration to .NET will end up being more like the transition from DOS to Windows.
You do gain quite a bit by utilizing what's build into .NET (GC, powerful runtime library, significantly reduced coding time) but you certainly don't get it for free. You sacrifice performance in most cases though good design can minimize the impact. You sacrifice platform independence at the moment (though if you're using MFC/ATL you're not portable anyway). And just like Java, you're source is easier to decompile w/o obfuscation tricks.
For our part, we've found that using the managed extensions for C++ give us the best of both worlds - we retain most of our perf and source base plus we can easily interop with managed code as desired. Slowly but surely we're porting pieces of our apps that are not perf centric over to managed. Another alternative we have used is to write our .NET code as COM components and then use standard ATL to interop, though that introduces a whole 'nother bit of overhead.
Anyway, I'm babbling... Maybe I just should hit the sack. :o
stax76
20th June 2003, 12:48
does take a good few seconds the first time you load an App
the jit compiling is quite fast and only performed on the first start. If it's application that you use often you can use ngen.exe to create a native image, a native image is a file containing compiled processor-specific machine code
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfnativeimagegeneratorngenexe.asp
sezz
22nd June 2003, 23:27
The .NET Framework is included in Windows Server 2003 and it will be included in all future versions of Windows.
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.