Cool or Uncool
-
Depends whether you are asking "Is C# the mythical 'Cool' that we all heard rumours about last year", or "Is C# a good language". According to the recent poll (http://www.codeproject.com/script/poll/detail.asp?topic=71) most people felt C# was definitely uncool - but it is really hard to judge until you've used the new IDE, written some apps and compared the functionality. Personally I feel it will be kinda nice to drop back to C# to write a COM client, then maybe do a little VB to whip up a neat UI, and then roll up the sleaves to get some hard core C++ going - all working together in the same environment. I think everything simply needs to be put into perspective. As to whether C# is the Cool project, I was talking to the MS guys and got a definite 'sort of but not quite'. Cool was the name for an entire new technology on which .NET was based. C# is a major part of this, and so in a way C# was part Cool, but Cool was more than C#. At least that was my understanding...
-
Depends whether you are asking "Is C# the mythical 'Cool' that we all heard rumours about last year", or "Is C# a good language". According to the recent poll (http://www.codeproject.com/script/poll/detail.asp?topic=71) most people felt C# was definitely uncool - but it is really hard to judge until you've used the new IDE, written some apps and compared the functionality. Personally I feel it will be kinda nice to drop back to C# to write a COM client, then maybe do a little VB to whip up a neat UI, and then roll up the sleaves to get some hard core C++ going - all working together in the same environment. I think everything simply needs to be put into perspective. As to whether C# is the Cool project, I was talking to the MS guys and got a definite 'sort of but not quite'. Cool was the name for an entire new technology on which .NET was based. C# is a major part of this, and so in a way C# was part Cool, but Cool was more than C#. At least that was my understanding...
C# is definitely cool to program in. BTW, you won't need to drop back to VB to do UI. C# (as well as managed C++) gets the same RAD support that VB has in VS.NET. Check out the following code I wrote in about a half hour to display three jpg images. Note, this code probably wouldn't be too hard to duplicate in VB, but try this in VC++ using Win32 API :-) NOTE: the use of XML comments. The compiler supports stripping these out into an XML document like so: all: MyPhotoAlbum.exe MyPhotoAlbum.exe: MyPhotoAlbum.cs csc /debug+ /doc:MyPhotoAlbum.xml /t:winexe \ MyPhotoAlbum.cs /r:system.dll \ /r:system.drawing.dll /r:System.WinForms.dll \ /r:System.Data.dll /r:Microsoft.Win32.Interop.dll namespace CSharpApp { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.WinForms; using System.Data; /// /// Class representing my application's main window /// public class MainWindow : System.WinForms.Form { /// Required designer variable private System.ComponentModel.Container components; private System.WinForms.Button m_button3; private System.WinForms.Button m_button2; private System.WinForms.Button m_button1; /// /// IVar to hold reference of bitmap to paint /// private System.Drawing.Bitmap m_bitmap; private System.Drawing.Bitmap m_bitmap1; private System.Drawing.Bitmap m_bitmap2; private System.Drawing.Bitmap m_bitmap3; private System.Drawing.Point m_orgBitmap; public MainWindow() { // // Required for Win Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after // InitializeComponent call // try { m_bitmap1 = new Bitmap(@"c:\images\A.jpg"); m_bitmap2 = new Bitmap(@"c:\images\B.jpg"); m_bitmap3 = new Bitmap(@"c:\images\C.jpg"); } catch (Exception e) { MessageBox.Show(e.ToString(), "Bummer!", MessageBox.IconHand); } m_orgBitmap = new Point(10, 60); } /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose();
-
C# is definitely cool to program in. BTW, you won't need to drop back to VB to do UI. C# (as well as managed C++) gets the same RAD support that VB has in VS.NET. Check out the following code I wrote in about a half hour to display three jpg images. Note, this code probably wouldn't be too hard to duplicate in VB, but try this in VC++ using Win32 API :-) NOTE: the use of XML comments. The compiler supports stripping these out into an XML document like so: all: MyPhotoAlbum.exe MyPhotoAlbum.exe: MyPhotoAlbum.cs csc /debug+ /doc:MyPhotoAlbum.xml /t:winexe \ MyPhotoAlbum.cs /r:system.dll \ /r:system.drawing.dll /r:System.WinForms.dll \ /r:System.Data.dll /r:Microsoft.Win32.Interop.dll namespace CSharpApp { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.WinForms; using System.Data; /// /// Class representing my application's main window /// public class MainWindow : System.WinForms.Form { /// Required designer variable private System.ComponentModel.Container components; private System.WinForms.Button m_button3; private System.WinForms.Button m_button2; private System.WinForms.Button m_button1; /// /// IVar to hold reference of bitmap to paint /// private System.Drawing.Bitmap m_bitmap; private System.Drawing.Bitmap m_bitmap1; private System.Drawing.Bitmap m_bitmap2; private System.Drawing.Bitmap m_bitmap3; private System.Drawing.Point m_orgBitmap; public MainWindow() { // // Required for Win Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after // InitializeComponent call // try { m_bitmap1 = new Bitmap(@"c:\images\A.jpg"); m_bitmap2 = new Bitmap(@"c:\images\B.jpg"); m_bitmap3 = new Bitmap(@"c:\images\C.jpg"); } catch (Exception e) { MessageBox.Show(e.ToString(), "Bummer!", MessageBox.IconHand); } m_orgBitmap = new Point(10, 60); } /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose();
WAH! What happened to my spaces?
-
C# is definitely cool to program in. BTW, you won't need to drop back to VB to do UI. C# (as well as managed C++) gets the same RAD support that VB has in VS.NET. Check out the following code I wrote in about a half hour to display three jpg images. Note, this code probably wouldn't be too hard to duplicate in VB, but try this in VC++ using Win32 API :-) NOTE: the use of XML comments. The compiler supports stripping these out into an XML document like so: all: MyPhotoAlbum.exe MyPhotoAlbum.exe: MyPhotoAlbum.cs csc /debug+ /doc:MyPhotoAlbum.xml /t:winexe \ MyPhotoAlbum.cs /r:system.dll \ /r:system.drawing.dll /r:System.WinForms.dll \ /r:System.Data.dll /r:Microsoft.Win32.Interop.dll namespace CSharpApp { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.WinForms; using System.Data; /// /// Class representing my application's main window /// public class MainWindow : System.WinForms.Form { /// Required designer variable private System.ComponentModel.Container components; private System.WinForms.Button m_button3; private System.WinForms.Button m_button2; private System.WinForms.Button m_button1; /// /// IVar to hold reference of bitmap to paint /// private System.Drawing.Bitmap m_bitmap; private System.Drawing.Bitmap m_bitmap1; private System.Drawing.Bitmap m_bitmap2; private System.Drawing.Bitmap m_bitmap3; private System.Drawing.Point m_orgBitmap; public MainWindow() { // // Required for Win Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after // InitializeComponent call // try { m_bitmap1 = new Bitmap(@"c:\images\A.jpg"); m_bitmap2 = new Bitmap(@"c:\images\B.jpg"); m_bitmap3 = new Bitmap(@"c:\images\C.jpg"); } catch (Exception e) { MessageBox.Show(e.ToString(), "Bummer!", MessageBox.IconHand); } m_orgBitmap = new Point(10, 60); } /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose();
Hey Keith, just a remark on your code: //-------------------------------------- /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose(); components.Dispose(); } //-------------------------------------- Isn't C# handling the memory freeing?
-
Hey Keith, just a remark on your code: //-------------------------------------- /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose(); components.Dispose(); } //-------------------------------------- Isn't C# handling the memory freeing?
That code was inserted by the VS wizard for a "C# Windows Application". As I understand it, C# suffers the same problem as Java. The destructor or finalize method is not called in a deterministic fashion since Garbage Collection is not deterministic. So the docs recommend adding methods with names like Dispose() or Close() if you are holding onto non-memory resources that should be freed immediately when they are no longer needed as opposed to waiting for the GC to run.
-
WAH! What happened to my spaces?
It's good ol' HTML doing its thing... I think you can avoid it by simply wrapping the code inside PRE tags, like this: < pre> // some code int n = 70; </pre> Which will look like this:
// some code
int n = 70;Much better, don't you think? And thanks for the sample code. It's amazing how similar it looks to Java. Regards, Alvaro
-
Depends whether you are asking "Is C# the mythical 'Cool' that we all heard rumours about last year", or "Is C# a good language". According to the recent poll (http://www.codeproject.com/script/poll/detail.asp?topic=71) most people felt C# was definitely uncool - but it is really hard to judge until you've used the new IDE, written some apps and compared the functionality. Personally I feel it will be kinda nice to drop back to C# to write a COM client, then maybe do a little VB to whip up a neat UI, and then roll up the sleaves to get some hard core C++ going - all working together in the same environment. I think everything simply needs to be put into perspective. As to whether C# is the Cool project, I was talking to the MS guys and got a definite 'sort of but not quite'. Cool was the name for an entire new technology on which .NET was based. C# is a major part of this, and so in a way C# was part Cool, but Cool was more than C#. At least that was my understanding...
C# is like Basic, in that, Visual Basic is programming in the Basic language, and Cool is programming in the C# language. so, Visual Basic is Microsoft's implementation of Basic, and Cool is Microsofts implementation of C#. (unless things have changed a LOT in the last 6 months)
-
C# is definitely cool to program in. BTW, you won't need to drop back to VB to do UI. C# (as well as managed C++) gets the same RAD support that VB has in VS.NET. Check out the following code I wrote in about a half hour to display three jpg images. Note, this code probably wouldn't be too hard to duplicate in VB, but try this in VC++ using Win32 API :-) NOTE: the use of XML comments. The compiler supports stripping these out into an XML document like so: all: MyPhotoAlbum.exe MyPhotoAlbum.exe: MyPhotoAlbum.cs csc /debug+ /doc:MyPhotoAlbum.xml /t:winexe \ MyPhotoAlbum.cs /r:system.dll \ /r:system.drawing.dll /r:System.WinForms.dll \ /r:System.Data.dll /r:Microsoft.Win32.Interop.dll namespace CSharpApp { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.WinForms; using System.Data; /// /// Class representing my application's main window /// public class MainWindow : System.WinForms.Form { /// Required designer variable private System.ComponentModel.Container components; private System.WinForms.Button m_button3; private System.WinForms.Button m_button2; private System.WinForms.Button m_button1; /// /// IVar to hold reference of bitmap to paint /// private System.Drawing.Bitmap m_bitmap; private System.Drawing.Bitmap m_bitmap1; private System.Drawing.Bitmap m_bitmap2; private System.Drawing.Bitmap m_bitmap3; private System.Drawing.Point m_orgBitmap; public MainWindow() { // // Required for Win Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after // InitializeComponent call // try { m_bitmap1 = new Bitmap(@"c:\images\A.jpg"); m_bitmap2 = new Bitmap(@"c:\images\B.jpg"); m_bitmap3 = new Bitmap(@"c:\images\C.jpg"); } catch (Exception e) { MessageBox.Show(e.ToString(), "Bummer!", MessageBox.IconHand); } m_orgBitmap = new Point(10, 60); } /// /// Clean up any resources being used /// public override void Dispose() { base.Dispose();
Been dabbling with C# a bit now; I like the structure of the language.... ... but where in the heck am I going to find all the dox for provided namespaces? (Can't find 'em anywhere) ... stuff like you used: using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.WinForms; using System.Data;