AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 7th January, 2007, 09:54 PM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

Which C platform is better for programming?

I was discussing with gizmo at MSN about Visual C++ vs C#.
Well I started programming the OcBible using Borland C++ Builder (2003) and at May of 2005 I moved to C#.
The heart of the program could be written in ANSI C but I want to share something well looking.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 7th January, 2007, 10:28 PM
Allan's Avatar
Member/Contributer
 
Join Date: September 2001
Location: Denmark
Posts: 7,914

Tricky question, it isn't a matter of the one being better than the other, since they both have their pros and cons.

With C#, you can so easily make a program with a lot of fancy GUI and stuff. However, it will run slower than a similar program in C++, and the user must have the .NET framework installed. On the other hand, while C++ is faster at run time, it takes more time to make the same program, and you have a lot of things to worry about (who said pointers?).

For quick programming I'd go with C# anytime. You can use platform invocation (Pinvoke) to access non-C# stuff.

But what do I know, I'm mainly programming in C for embedded devices...
__________________

Last edited by Allan; 7th January, 2007 at 10:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 7th January, 2007, 10:53 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

That pretty much summarizes my opinion on the issue as well Alan. But then again, I tend to like getting into the dirty stuff anyway.

Last edited by Gizmo; 7th January, 2007 at 10:54 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 7th January, 2007, 10:59 PM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

Quote:
Originally Posted by Allan
With C#, you can so easily make a program with a lot of fancy GUI and stuff
This was my first ideas when I stopped programming in Borland.
Both Visual C++ and C# are Microsoft products but C# is easier.
Of course I do not care for code executation time cos OcBible performs simple instructions.
Only some *.dlls are hungry for CPU performance.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 7th January, 2007, 11:01 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

And this is the heart of good programming; pick the right tool for the job.

A programming language is nothing more than a tool.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 7th January, 2007, 11:53 PM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

I agree gizmo.
For example the OcBible could written in MSDOS enviroment but this is boring for user.
I forgot anything about Pascal that's why I did not program in Delphi although it is a popular tool.
On the other hand as we chatted in MSN Visual C++ allows you assembly programming and Win32 API calls.
Two necessary issues for next OcBible editions.
Hopefully Visual C++ routines run OK under C#.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 8th January, 2007, 12:10 AM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Quote:
Originally Posted by MrSeanKon
Hopefully Visual C++ routines run OK under C#.
They do. I've actually written some C++ dlls in the past that were called from C#. The easiest way to do it, though, is to make the C++ code a COM object, and then the C# application can just import the COM object and use it like anything else.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 8th January, 2007, 12:20 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

Thanks gizmo.
BTW have you ever used an alternate graphical C enviroment?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 8th January, 2007, 12:27 AM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

I used Borland Turbo C many years ago with the Object Windows Libraries (OWL)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 8th January, 2007, 01:06 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

This was the previous enviroment version before *.NET.
BTW I do not know any other C Windows platform except of Borland and Microsoft.
If someone knows anything else let me know....
__________________

Last edited by MrSeanKon; 15th January, 2007 at 10:42 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 9th January, 2007, 10:27 AM
chrisbard's Avatar
Benchmarker
 
Join Date: March 2003
Location: Earth
Posts: 8,252
Send a message via Yahoo to chrisbard

While @ it don't forget your Vitamin C dose
__________________
I've heard that linux community came up with better implemented security in it's latest Linux Mint Gold version, it's actually preventing the user to log in, thus posing 0 risk in contamining the computer with malware! Well done to the open source community!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 15th January, 2007, 10:41 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

What do you mean?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 17th January, 2007, 08:57 AM
chrisbard's Avatar
Benchmarker
 
Join Date: March 2003
Location: Earth
Posts: 8,252
Send a message via Yahoo to chrisbard

Nevermind, just a poor joke
__________________
I've heard that linux community came up with better implemented security in it's latest Linux Mint Gold version, it's actually preventing the user to log in, thus posing 0 risk in contamining the computer with malware! Well done to the open source community!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 17th January, 2007, 03:55 PM
Daniel ~'s Avatar
Chief BBS Administrator
 
Join Date: September 2001
Location: Seattle Wa.
Posts: 45,606

No sweat Chris, poor jokes are the only one I can afford to get! ":O}
__________________
"Though all men live in ignorance before mystery,
they need not live in darkness...
Justice is foundation and Mercy ETERNAL
."
DKE

"All that we do is touched by Ocean
Yet we remain on the shore of what we know."
Richard Wilbur

[img]/forum/attachments/random-nonsense/16515-sigs-dan_drag.jpg[/img]
Subscribers! Ask Pitch about a Custom Sig Graphic

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 26th January, 2007, 09:49 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

Quote:
Originally Posted by chrisbard
Nevermind, just a poor joke
No more http://www.geocities.com/seankoniari...s/offtopic.gif
Continued....
gizmo I would like your opinion about Visual C++ vs. C#
The first platform is more complex IMHO but offers more capabilities e.g. Win32 API access.
For example which source code runs faster?
WMI commands using C# or Visual C++ and Win32 API?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 26th January, 2007, 01:35 PM
MONKEYMAN's Avatar
Member
5 Card Draw Champion, Tomb Digger Champion, Alpha Force Champion, Autobahn Champion, Big Bird Hunting Champion, Mumu Champion, Attack of the Tweety Zombies Champion
 
Join Date: January 2005
Location: DORSET, UK
Posts: 2,170

Chill out, thats what Chrisbard is here for
__________________
AM2 X2 4000
2GB DDR2
NVIDIA 6150 ONBOARD!

Join our F@H team today.. http://www.team45.info/
Are you a subscriber? No? well then, why not....
Subscribe to AOA for a better experience and faster downloads!
How to unlock and overclock your Nvidia 6800
BIOS Volt-mod your 7800gt

AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 26th January, 2007, 05:59 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Quote:
Originally Posted by MrSeanKon
No more http://www.geocities.com/seankoniari...s/offtopic.gif
Continued....
gizmo I would like your opinion about Visual C++ vs. C#
The first platform is more complex IMHO but offers more capabilities e.g. Win32 API access.
For example which source code runs faster?
WMI commands using C# or Visual C++ and Win32 API?
Actually, there are 4 options here:
C++ and Win32
C# and Win32
C++ and WMI
C# and WMI

The performance penalties associated with C# and WMI can be pretty severe. C# itself introduces roughly a 15% performance hit, in my experience. WMI can be accessed through a COM interface which is normally fairly efficient, but when coupled with C#'s marshalling code you take another 10%-15% performance hit.

C# to Win32 is even worse, because you have to write custom marshaling code or use the Microsoft.Interop stuff, or use PInvoke to access it. In my experience, there is typically about a 25% overhead in doing any of that.

C++ to WMI is pretty efficient.

C++ to Win32 will be probably 5%-10% more efficient than WMI, but brings with it a lot of baggage. WMI aggregates a lot of interfaces and information that are scattered throughout the Win32 API (and even some protected CPU instructions), and which also vary across operating system versions from Win95 to Win98 to WinMe to WinNT to Win2K to WinXP to Vista, into a single easy-to-use API.

To be fair, there are some variations of the WMI implementation across the various OSen, but those issues are documented. In addition, WMI isn't installed on 9x or WindowsNT 4, but you can download it from MS and install it on those machines.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 29th January, 2007, 02:40 PM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

Interesting information gizmo.
BTW System Reporter needs assembly parts (if we extend the program for more monitoring options) thus we must convert its source code?
P.S. You should edit your post (remove the uneccesary parts --> smile)

The C# code does not use any external *.dll

Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Management;

namespace WindowsApplication1
{
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Timer timer1;
		private System.Windows.Forms.Label label1;
		private System.ComponentModel.IContainer components;

		public Form1()
		{
			InitializeComponent();
		}
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.label1 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			this.timer1.Enabled = true;
			this.timer1.Interval = 1;
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			this.label1.AutoSize = true;
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(161)));
			this.label1.Location = new System.Drawing.Point(16, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(42, 18);
			this.label1.TabIndex = 0;
			this.label1.Text = "label1";
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(74, 48);
			this.Controls.Add(this.label1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "Form1";
			this.Text = "C#";
			this.TopMost = true;
			this.ResumeLayout(false);
		}
		#endregion

		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void timer1_Tick(object sender, System.EventArgs e)
		{
			ManagementObjectSearcher query;
			ManagementObjectCollection queryCollection;
			System.Management.ObjectQuery oq;

			oq = new System.Management.ObjectQuery("SELECT * FROM Win32_OperatingSystem");
			query = new ManagementObjectSearcher(oq);
			queryCollection = query.Get();
			foreach (ManagementObject mo in queryCollection)
			{
				double free_RAM=double.Parse(mo["FreePhysicalMemory"].ToString())/1024; 
				label1.Text=free_RAM.ToString();
			}
		}
	}
}
but GKR the % CPU usage during a period was higher GKR...
Attached Thumbnails
Which C platform is better for programming?-c-.png  
__________________

Last edited by MrSeanKon; 5th February, 2007 at 09:31 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 5th February, 2007, 09:32 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Somewhere in Greece
Posts: 788

The Visual C++ code is:

Code:
#pragma once
namespace WindowsApplication2
{
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	public __gc class Form1 : public System::Windows::Forms::Form
	{	
		public:	Form1(void)
		{
			InitializeComponent();
		}
		protected:	void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
		private: System::Windows::Forms::Label *  label1;
		private: System::Windows::Forms::Timer *  timer1;
		private: System::ComponentModel::IContainer *  components;
		private:void InitializeComponent(void)
		{
			this->components = new System::ComponentModel::Container();
			this->label1 = new System::Windows::Forms::Label();
			this->timer1 = new System::Windows::Forms::Timer(this->components);
			this->SuspendLayout();
			this->label1->AutoSize = true;
			this->label1->Font = new System::Drawing::Font(S"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)161);
			this->label1->Location = System::Drawing::Point(16, 16);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(42, 18);
			this->label1->TabIndex = 0;
			this->label1->Text = S"label1";
			this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
			this->timer1->Enabled = true;
			this->timer1->Interval = 1;
			this->timer1->Tick += new System::EventHandler(this, timer1_Tick);
			this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
			this->ClientSize = System::Drawing::Size(74, 46);
			this->Controls->Add(this->label1);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = S"Form1";
			this->Text = S"C++";
			this->TopMost = true;
			this->ResumeLayout(false);

		}	
		private: System::Void timer1_Tick(System::Object *  sender, System::EventArgs *  e)
		{
			label1->Text=(API::Free_RAM()).ToString();
		}
	};
}
running faster...
Attached Thumbnails
Which C platform is better for programming?-c-.png  
__________________

Last edited by MrSeanKon; 5th February, 2007 at 09:32 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 5th February, 2007, 02:42 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

The c++ code you wrote is still using the .NET stuff, so you are taking a performance hit there....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Motorola 68000 Programming Help aghastpumpkin Programming and Assembly Language 9 23rd January, 2007 01:15 PM
Drining and programming: VERY BAD! dpgdog187 64 Bit computing 13 12th June, 2004 01:55 AM
920 Programming Languages cloasters Programming and Assembly Language 0 20th September, 2003 12:28 AM
C/C++ Programming Forum ? barneygumble742 Programming and Assembly Language 2 28th June, 2003 02:59 AM
Need Programming Help Oc Jason Programming and Assembly Language 7 5th April, 2002 06:34 PM


All times are GMT +1. The time now is 12:10 AM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0