|
c,c++ or c#?
|
| Author |
Message |
timmyhawky
computerlover&nerd
Posts: 47
Group: Banned
Joined: Aug 2006
Status:
Away
|
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 |
|
 |
fabiank22
dreamer
  
Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status:
Offline
|
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 |
|
 |
timmyhawky
computerlover&nerd
Posts: 47
Group: Banned
Joined: Aug 2006
Status:
Away
|
RE: c,c++ or c#?
This post was last modified: 08-25-2006 12:10 PM by timmyhawky.
|
|
| 08-25-2006 12:09 PM |
|
 |
fabiank22
dreamer
  
Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status:
Offline
|
RE: c,c++ or c#?
w00t, more functions and easier 
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
|
|
| 08-25-2006 01:30 PM |
|
 |
timmyhawky
computerlover&nerd
Posts: 47
Group: Banned
Joined: Aug 2006
Status:
Away
|
RE: c,c++ or c#?
but java is slow like hell
|
|
| 08-25-2006 01:36 PM |
|
 |
Toasty
Registered
Posts: 81
Group: Registered
Joined: Jun 2006
Status:
Offline
|
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 |
|
 |
timmyhawky
computerlover&nerd
Posts: 47
Group: Banned
Joined: Aug 2006
Status:
Away
|
RE: c,c++ or c#?
thanks toasty 
more advices(with reason) welcome
|
|
| 08-25-2006 02:30 PM |
|
 |
fabiank22
dreamer
  
Posts: 155
Group: Beta Discussion Members
Joined: Jul 2006
Status:
Offline
|
RE: c,c++ or c#?
but java is slow like hell 
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 |
|
 |
timmyhawky
computerlover&nerd
Posts: 47
Group: Banned
Joined: Aug 2006
Status:
Away
|
RE: c,c++ or c#?
but java is slow like hell 
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, hopeless
or is it because i use sun java plugin?
|
|
| 08-26-2006 03:04 PM |
|
 |
blueshogun96
The danish lady...
      
Posts: 354
Group: Administrator/Developer
Joined: Mar 2006
Status:
Away
|
RE: c,c++ or c#?
thanks toasty 
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 |
|
 |