Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
3.75/5 (4 votes)
See more:
I'm going to create a dictionary program for English and and I know C# very well and have a good knowledge of C++, and I want to ask, can C# be very fast like C++ or not, I want a sufficient answer to start writing my program, because I prefer to write in C# within visual studio IDE but if this will affect on my program speed, I will write in C++ and QT framework
Posted

Well, given what you want to use it for, C# will be easier as it actually has an easy-to-implement Dictionary class where as C++ doesn't. Furthermore, unless you're actually handling large amounts of data in memory (e.g. images) C# is indistinguishable for speed compared to C++. Basically, for your application it should be just as fast and much much easy to code :)

Hope this helps,

Ed :)
 
Share this answer
 
Comments
Albert Holguin 30-Sep-11 14:28pm    
agreed... for his application... should be just as fast... +5
Ed Nutting 30-Sep-11 14:31pm    
Thank you Albert :)
Espen Harlinn 1-Oct-11 5:41am    
std::map?
Ed Nutting 1-Oct-11 6:24am    
hmm..I shall have a look, thank you :)
A C# implementation might even be faster than a C++ implementation. But it all comes down what and how you implement it, there is no this is faster this is slower.

That said I suggest you look at using C# as a small performance hit, and then choose to use C# because that performance hit is nothing when you compared to the ease of development C# offers over C++
 
Share this answer
 
Comments
Ed Nutting 30-Sep-11 14:05pm    
My 4 - I agree but there is a very definite point at which you can say C++ is faster. When I did live video analysis for a basic motion detection recently, taking snap shots of the video and doing the general program in C# was fine but I had to use C++ for the actual image processing just because you can't implement fast handling of large quantities of data in memory in C# - there is a 'this is faster this is slower' difference. My 4, Ed :)
Simon Bang Terkildsen 30-Sep-11 14:25pm    
Thank you for the vote Edward, you got mine too, though I don't agree that it's a fact that C++ is faster when it comes to processing large amounts of memory. I would always implement my solution/algorithm in C# and then only if it doesn't perform as well as I would like would I see if I could make a faster C++ implementation and then use P/Invoke (if the C++ implementation is actually faster).
Ed Nutting 30-Sep-11 14:28pm    
Precisely what I did for my C# image processing program - C# is always my preferred language - it's sooo much easier! And the performance hit in almost all situations is next to non-existent so reaaallly there isn't much to worry about most of the time unless you notice you're code running slowly... :)
Yasser Sobhy 1-Oct-11 1:51am    
thanks Simon, thanks Edward, actually I'm going to process large amounts of data in my program, I said I'm going to create a dictionary program for English, and of course there are a lot of word lists for English, beside phrasal verbs, examples, and more of things you have to handle in an English dictionary, and I'm going to create a real time application, so I'm worry a lot about its speed,

and in this application I will not use databases like MS SQL server but I will use custom files to store my data and read its index at startup of my application, to search in that index for any word typed by the user, I think it may be a good choice if I implement the data manipulating layer in C++ and presentation layer in C#.
Simon Bang Terkildsen 1-Oct-11 5:18am    
If I were you I would only use C#.
Loading a dictionary into memory and indexing it is not that intensive, I would not expect to see any difference between a C# or C++ implementation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900