Post Reply  Post Thread 
c,c++ or c#?
Author Message
timmyhawky
computerlover&nerd


Posts: 47
Group: Banned
Joined: Aug 2006
Status: Away
Post: #1
c,c++ or c#?

hi, i want to write a FAST n64 emu.
i am started with c++, but i started thinking on if it was a good choise.
So are c++ and c# programs running slower than the C ones?

note: it must also good for n64 emu's
thx

08-25-2006 02:11 AM
Find all posts by this user Quote this message in a reply
fabiank22
dreamer
***


Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status: Offline
Post: #2
RE: c,c++ or c#?

In terms of speed:

C is the fastest of all three.
However, if you know what you're doing c++ should be nearly equals
c# is way slower, and you need to have the .NET-framework on every PC the emu should run. But C# is easier to code.

However I personaly have started with some Web-langs, especially PHP is great for newbies to coding(I'm assuming you already know HTML. Everybody does).

Java or C# are a good next step, if you're done with the basics.

08-25-2006 03:33 AM
Find all posts by this user Quote this message in a reply
timmyhawky
computerlover&nerd


Posts: 47
Group: Banned
Joined: Aug 2006
Status: Away
Post: #3
RE: c,c++ or c#?

c# EASY?
w00t, more functions and easier Grin
but it is a lot of time to learn a programming language, so i think c is better coz its speed
thxHappy
p.s. i learned HTML already Smile

This post was last modified: 08-25-2006 12:10 PM by timmyhawky.

08-25-2006 12:09 PM
Find all posts by this user Quote this message in a reply
fabiank22
dreamer
***


Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status: Offline
Post: #4
RE: c,c++ or c#?

timmyhawky Wrote:
w00t, more functions and easier Grin


Well, it's easier because it has more functions. Ever thought that way?

Anyway most of these functions make it only easier for the Dev at costs of speed (I'll make some examples from Java: Autoboxing, Static imports, no thinking about memory). However I'm no fan of microsoft and just have no fun in learning coding for Windows only(no, Mono doesn't count), so I'll stick with Java Wink

08-25-2006 01:30 PM
Find all posts by this user Quote this message in a reply
timmyhawky
computerlover&nerd


Posts: 47
Group: Banned
Joined: Aug 2006
Status: Away
Post: #5
RE: c,c++ or c#?

but java is slow like hellSick

08-25-2006 01:36 PM
Find all posts by this user Quote this message in a reply
Toasty
Registered


Posts: 81
Group: Registered
Joined: Jun 2006
Status: Offline
Post: #6
RE: c,c++ or c#?

C# and Java are nice languages, but they are not at all designed for writing emulators due to their abstraction of low-level mechanisms that you will need to control directly to get any kind of speed in emulation. Technically, anything you can do with C, you can do with C++, as C++ is just an extension of C. Sometimes people claim C++ is slower than C, but in reality this usually happens because C++ has more language features to be misused by naive programmers. If you're going to be writing object-oriented code, go with C++ as it provides all the language constructs you will need to do it easily. If you're going with a procedure or function-oriented approach, there's not much advantage (or disadvantage) to going with C++, so you can go with either.


08-25-2006 02:22 PM
Find all posts by this user Quote this message in a reply
timmyhawky
computerlover&nerd


Posts: 47
Group: Banned
Joined: Aug 2006
Status: Away
Post: #7
RE: c,c++ or c#?

thanks toasty Grin
more advices(with reason) welcome

08-25-2006 02:30 PM
Find all posts by this user Quote this message in a reply
fabiank22
dreamer
***


Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status: Offline
Post: #8
RE: c,c++ or c#?

timmyhawky Wrote:
but java is slow like hellSick


Only for emulating stuff. And if you use swing a bit to often. But there is many software out there where the difference doesn't really matters anymore on new PC's:

- Eclipse
- Azureus(only the new RC's, the Dev-Team has done some heavy optimizing)
- NetBeans

Also Java has other Targets. If you write your apps the right way, then they will also work on Linux or Solaris or Mac.

08-26-2006 02:11 PM
Find all posts by this user Quote this message in a reply
timmyhawky
computerlover&nerd


Posts: 47
Group: Banned
Joined: Aug 2006
Status: Away
Post: #9
RE: c,c++ or c#?

fabiank22 Wrote:

timmyhawky Wrote:
but java is slow like hellSick


Only for emulating stuff. And if you use swing a bit to often. But there is many software out there where the difference doesn't really matters anymore on new PC's:

- Eclipse
- Azureus(only the new RC's, the Dev-Team has done some heavy optimizing)
- NetBeans

Also Java has other Targets. If you write your apps the right way, then they will also work on Linux or Solaris or Mac.


i tried some aps on a 1 ghz cpu 32mb gpu 192 mb ram, hopelessSick
or is it because i use sun java plugin?

08-26-2006 03:04 PM
Find all posts by this user Quote this message in a reply
blueshogun96
The danish lady...
*******


Posts: 354
Group: Administrator/Developer
Joined: Mar 2006
Status: Away
Post: #10
RE: c,c++ or c#?

timmyhawky Wrote:
thanks toasty Grin
more advices(with reason) welcome


So for the most part with C and C++, it's a matter of coding style.  With C++ it's a matter of not paying for what you are not using.  If you over-use certain C++ features, then your emu will be slower than it needs to be.  But whether you use C or C++, you need to make sure your code is optimal and efficient.  Another word of advice, get your code working first, then you can optimize later.  NEVER optimize as you begin writing your code (unless you really know what you are doing) because it can lead to mistakes that might prevent your code from working properly.

EDIT: an example of overusing C++ effecting speed is NEStopia. My favorite NES emu, but it's heavy usage of OO in C++ makes it rather slow at times.

This post was last modified: 09-23-2006 11:13 AM by blueshogun96.

09-23-2006 11:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: