473,790 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ vs. C# (new to windows programming)...

Hi!
After messing around for some time with Tcl/Tk and VBScript,
we've finally reached the point where we need to put some speed
into our applications.

So, our typical application looks like this.
We've got this huge CAD tool, called Mentor Expedition, which
understands VBScript and JScript and offer an ActiveX-Interface
for Automation.

What we typically do is we have an application Gui which is
separate from the tool (Tcl/Tk), then connects to the tool and
accesses Automation objects.
This incurs a big overhead and limits performance to about 100
calls per second. This is way to slow.

We then did a few VBscript components and let that Mentor-Tool
run those via VBscript. That got us quite a speedup for as long
as we limited ourselves to getting data and iterating over
collections.

Now we are at a point where the VBScript needs to do some "real"
calculations too, like geometric transformations .

Therefore we are thinking of introducing a new animal into our
language zoo for the real high speed stuff.

The idea is to put the performance critical parts into a COM
component or, in fact into anything that can be loaded via the VBscript
createobject call, gets the Handle of some big Automation object,
runs in-process, maybe does a bulk insert into an oracle database
on the side (using oracle ole db) and can return complex objects
back to VBScript, like dictionaries or other self defined collections.
We are not really interested in Gui's, more in building blocks.

I've got a bit of experience in C++ from about ten years ago
on Linux.

Right now I'm tending a bit towards C++ for the speed and the
deterministic destructor calls, but I am absolutely glueless about
Windows programming in general, except for VBScript command
line tools.

What would you suggest?

Lots of Greetings and Thanks!
Volker
Apr 26 '06
10 2488
Israel schrieb:
With that being said there should be no reason why mathematical
operations in C++ should be any faster than in C# unless you are
somehow exploiting some mmx routines that C# *may* not support. Ok, what I meant was self contained code that just needs the processor
and no network connections and such. Loops, recursion, searches,
trigonometry too. I agree that things like trigonometry are probably
provided by a fast library, regardless of the language.
The
issues you need to concern yourself with are the communications; making
a lot of consecutive remoting calls (cross process) will incur more
timing overhead Yes, from my timings it's about factor 20 in speed. (VBScript remote
versus VBScript in-process)
One requirement therefore is that our extensions have to run in-process.
For the tool we are extending that means something VBScript can
access using createobject. Which seems to be COM only, either as dll
or as .net assembly(?) with a com wrapper.

Personally I would suggest trying C# vs. C++, especially if you're
not proficient with windows programming in C++. That's what we will do.
I've noticed a very large boost in productivity since switching over
to mainly C#. Where productivity is more important than speed (i.e. for prototypes
and first versions) we use Tcl/Tk here.

In summary, you may hit different performance issues with C# vs. C++
but there should be a solution in C# that achieves the desired
performance. In terms of a learning curve using C# will be at least an
order of power easier than C++ to produce and maintain viable code.
You should do diligence and prototype the anticipated interactions with
your application using a C# application and if you run into performance
issues there are plenty of google groups members that will probably
have good suggestions to solve them. Right now we are also doing a two stage approach. Prototypes are usually a
combination of Tcl/Tk and VBScript and when those have been used for a while
(we do inhouse programming) and requirements are moderately stable we look
at performance bottlenecks and want to do a proper design for version II,
for which we are selecting the tools now. It will also be a layered architecture,
using several programming languages. I can well imagine a combination of
Tcl or VBScript and a small part written in C# or C++, depending on what
profiling suggests.

Btw, here it's not so much about "fast enough" yet.
"Fast enough" in our context would mean less than about 2s. :-)
Right now we have runtimes of 20min and more. With typically six layout
engineers using those programs several times per day, every saved minute
translates directly into productivity at a place where we currently have
a bottleneck.
Side note:
When I first started using C# the non-deterministic destructors really
bothered me because I had grown accustomed to implementing solutions
using them like synchronization and opening files etc. It hasn't
taken me too long to get used to designing things a little differently
and utilizing try..catch..fin ally blocks a lot more or using
IDisposable.

After reading up about this I think I can agree with that. The C# way
has advantages (I can control the order of destruction) and disad-
vantages (the caller must be more careful) but I think both lead to
less problems than manual resource management.

Lots of Greetings!
Volker
Apr 27 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2602
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
4
2431
by: Mark | last post by:
Hello. I am new to programming and Python and was wondering if someone could help get me started. I picked Python to start learning to prgram because of some things I have read about it (easy to learn, object oriented, clear syntax, etc...). Can anyone assist in getting me started with learning to program and Python? Recommended reading material? Online tutorials? Recommended development tools (wxpython, pythonwin, etc...)? I am a...
11
9273
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
2
2363
by: ZubZero | last post by:
Hello, i have to write a utility in c++ for windows 2k/XP. But i have 2 difficult problems. I asked many programmers i know, but none of them was able to tell me how i can do this. 1. I would like to disable a specific USB-port (not all ports, only one). I have a USB Cardreader with an integrated 7-port USB-Hub.
19
1467
by: adi | last post by:
Hello friend, I've recently joined this public group. I've done lots of C programming stuff during my engineering days but only on a CLI (Turbo-C/C++). Right now i'm focussed on GUI programming through C and also some bit on CGI. I've started reading materials relevant to it but i'd like to ask that is this group encourages such topics or do I've to subscribe to some other group specific to GUI programming in C. Help me out, friend! Also...
2
1313
by: jm | last post by:
I got the code below from the .NET SDK. I am still new to C# and I don't understand how the code works. And by that I mean I don't understand how the program knows to execute it. I can find no entry point besides main. I cannot find an event that calls the code. It is a simple GDI+ application. I just don't see how it ever executes. I need nothing about the code itself, just how the thing "turns on." I don't ever see OnPaint called...
9
1496
by: tjones | last post by:
Hi, I am guessing this is *THE* nntp newsgroup for C#? I was hoping someone could point me in the right direction. Id like to find employment in the IT industry as a programmer again. My background is a mix of programming and networking. I have fairly decent skills in C++, Java and ADA. I have been working as a network engineer on all flavours of windows, lots of unix, mssql, cisco and others. Currently finishing a master of science...
4
1780
by: Mike | last post by:
Hi, I am planning on purchasing VS2005 to learn C# very soon, and I need good book recommendations. I realize this is a question that may be asked a lot, but please consider my background: I have been a ClassicVB/ASP programmer for about 7 years. I have never done anything with .NET and only have a very basic understanding of the platform. Recently, I started working on a large JAVA project at my job (even though I have very little...
0
1349
by: Samineni | last post by:
Welcome to comp.lang.c++! Read this first. This post is intended to give the new reader an introduction to reading and posting in this newsgroup. We respectfully request that you read all the way through this post, as it helps make for a more pleasant and useful group for everyone. First of all, please keep in mind that comp.lang.c++ is a group for discussion of general issues of the C++ programming language, as defined by the
15
372
by: | last post by:
Just asking for some advice. I am a VS C++ developer. I develope using the WIN32 API, and frankly I love developing with C++. I do not program for MFC, MFC is pretty lame. In fact I have always steered clear of any managed code programming. However, I started messing with windows forms/.net and I really am liking it, for once managed code seems doable. Since I have a background with C++ I started developing windows forms with C++. However,...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.