learning new language

.paul.

Well-known member
Joined
May 22, 2007
Messages
212
Programming Experience
1-3
i've been using vb.net for a while now. i thought .net 2005 would improve vb's performance problems.

anyway, i'm thinking of learning c# or c++

just a couple of questions.

which would give better performance (c# or c++)?
how similar are c# & c++?

thanks
 
All .Net Framework languages are "equal", so VB.Net and C# is "same". C++ native (not managed) could get you better performance (if you're good) in some cases, but with a lot of work because if you wanted to do something that's covered by the Framework library you'd have to write that part of the library yourself. So do you think you are better to write those objects and methods than those who wrote the Framework? And do you actually have the time capacity to do it for free? - because the client will hardly pay you to do work that doesn't need to be done. There is one other performance difference in the whole management "thing" with memory-management and GC that could in some cases give better performance when you explicitly do all this work from within your own application, but a lot of coding and work with this also. DirectX does/did make some sense unmanaged, but I think this also is supposed to perform very well managed. Btw Managed DirectX 2.0 was discontinued and replaced by the XNA Framework. One benefit of C# and C++ is the option to allow using the managed library and occationally use unsafe/unmanaged blocks for special operations (sometimes for performance), another is better reputation for higher quality programmer in job market.
 
i was asking because, i did a printing project, using

Dim MyDoc As New PrintDocument() ' with a handler
MyDoc.Print()

+ it really tied the pc up badly.
i tried using doevents statements but still, the printing took over the pc.
 
I haven't noticed such problems myself with small print jobs, but I've seen similar "lock-up" for short while with large print jobs from other applications I know is written managed, but don't know the source code there. A large processing involving much graphics drawing is bound to use all CPU cycles available for some time though.
 
Ah... it's that question again... which one is better...

In my humble opinion, it doesn't matter which language you choose so long as the code you written is solid, well optimized then the performance should be way better than sloppy code written on high performance language.

I've seen quite a few programmers who keep yapping about how good of his language of choice is but when the **** hits the fan, their application can't perform to expectation.

As for a newbie, I suggest you study hard for which ever language you choose and build a strong foundation of programming. Once you've got the basics down then start to get into optimization. For the things you do, try to see if you can accomplish it a different way and see if you can do it more efficiently.

My philosophy on this is: "It's not the tool that matter, it's how you use it!"
 
i'm only a newbie at vb 2005.
theres a lot to learn and i was wondering if i should learn C instead.
as it is most of my code is very vb3 influenced
 
Threading the app won't help when it is the whole OS that is struggling, there is only so much CPU power and for a short while the operation may take all there is. But doing the print in different thread is a good tip for better response of your own application, you can also sleep the print thread occationally for a short moment to give system a little break during the heavy print job.
 
the backgroundworker thing didn't work out.
i had problems calling controls from a different thread than it was created in, and it didn't ease the cpu usage.
i don't see how i can sleep the print thread though. won't it assume the print job is finished, and print the document unfinished?
 
Back
Top