|
Chronicle of the Xul Revolution |
How does XUL compare with Microsoft Foundation Classes (MFC) or Windows Forms? Check out the three "Hello World" contestants and see yourself.
MFC Contestant
// HelloMFC.H class CSimpleApp : public CWinApp { public: virtual BOOL InitInstance() { m_pMainWnd = new CSimpleFrame; m_pMainWnd->ShowWindow( m_nCmdShow ); m_pMainWnd->UpdateWindow(); return TRUE; } }; class CSimpleFrame:public CFrameWnd { public: CSimpleFrame() { Create( NULL, "Hello MFC" ); } protected: DECLARE_MESSAGE_MAP(); afx_msg void OnPaint(); }; -------------------------------------------- // HelloMFC.CPP CSimpleApp helloApp; BEGIN_MESSAGE_MAP( CSimpleFrame, CFrameWnd ) ON_WM_PAINT() END_MESSAGE_MAP() void CSimpleFrame::OnPaint() { CPaintDC dc( this ); dc.TextOut( 200, 200, "Hello World from MFC" ); }
Windows Forms Contestant
using System; using System.Windows.Forms; public class SimpleForm : Form { private Label label1; public SimpleForm() { label1 = new Label(); label1.Text = "Hello World from Windows Forms"; Controls.Add( label1 ); } [STAThread()] static void Main() { Application.Run(new SimpleForm()); } }
XUL Contestant
<window> <label value="Hello World from XUL" /> </window>
And the winner is... Do I need to comment?
You are joking, i supposed to see real world benchmark. What about application like SwingSet2?
Posted by: dmi at August 15, 2003 06:32 AMHehehe.
That is very funny.
What a character!
But this really is a serious issue. Everything that programmers are writing now is getting slower and slower.
Sure we have hardware that is getting faster and faster to make up for the software that crawls at a snail's pace.
There's not doubt that C# is beautiful compared to MFC, and with DotGNU, it will soon be cross-platform as well.
And XUL is a wonderful idea, extending the ease of internationalization and GUI production in general.
But what is the cost here? Speed. I thought that with faster processors, I wouldn't have to wait 15 seconds for my browser to open. But Mozilla Firebird (which is a wonderful browser) takes quite a while to open, and C# apps are slow and clunky. And my machine is in the Ghz.
The faster hardware gets, the slower and clunkier the software gets. We'll never have fast apps, no matter how fast computers get.
Can this be for real? What a downer!
I'd like to see a real benchmark. Sure XUL beats the rest in terms of time for the programmer, but what about the users? Just the opposite!!!!
Thanks
Posted by: Rich at December 4, 2003 07:35 PMPlease send comments on our web pages to our public xul-talk mailinglist or to a member of our web team. | Copyright © 2003, 2004, 2005 Open XUL Alliance |