What's new

Which language?

Chaky

Banned
OK, I'm a VBA hacker by background having taught myself programming from scratch. I now want to move up a level to 'proper' programs. I've dabbled in learning C++ (and have some books on it) but have not learned enough where I can produce anything useful.

Because programming languages move so quick I was wondering what people have learnt recently and what they think was worthwhile. In order of preference for speed, portability and robustness (not ease of learning) I'm thinking of C++ then VB .net then Delphi. then C#.

What say you?
:unsure: :bouncy: :party:
 

Toasty

Sony battery
C/C++ are typically the language of choice for emulators, and even most general programs. (Technically, everything you can do in C, you can do in C++, and most C code is valid C++ code, but some people still prefer C over C++.) The .NET languages (VB.net, C#, etc.) are nice for writing quick GUIs, but it's difficult to impossible to write well-optimized emulators with them, since they abstract the low-level mechanisms required to do so.

As far as where to start, everyone learns differently. I tried C first and was really confused by it. But after learning, HTML, then JavaScript, then Java, I came back to C and it made sense. Some people just jump into whatever language they want to learn and pick it up immediately.
 

Toasty

Sony battery
Hmm... Maybe you're right. But if so, he's the most ineffective spammer I've ever seen - I didn't even notice the sig. :huh:

BTW, you never seem to follow the advice in your own sig. :p
 

cooliscool

Nintendo Zealot
Despite the apparent downfalls and the fact that the starter of this thread is apparently a bot, I actually prefer .NET languages over more raw languages such as C or C++ (yes, I'm also purely a Windows guy ;)). My OoT/MM Model Viewer/Editor was written in VB .NET/OpenGL and it runs at over 100FPS on a 1GHz P3 with onboard graphics - as it's also an editor, this isn't too bad, as I can't use display lists or other speed enhancing viewer-only API conventions. Along with that, texture loading isn't very optimized yet (though, from my testing, this can be noticed only on GPUs using system RAM for VRAM).

However, none of that matters when it comes to emulating a system. Direct hardware access is necessary (not to say VB emulators aren't possible, BasicBoy is a fullspeed GB/GBC emulator which was even ported to .NET) for good speed as the target system becomes more powerful.
 
Last edited:

Clements

Active member
Moderator
The links in the sig I believe is a sneaky tactic to get a higher page ranking for these spam sites in Google.
 

Garstyciuks

New member
I think so too, Clements. Here's two other bots whose signatures have not been deleted yet:

http://www.emutalk.net/member.php?u=60728
http://www.emutalk.net/member.php?u=61131


And a bit closer to the topic - I don't like .NET at all. You can (at least I can) easily notice which program is written in .NET language and which program is written in C/C++. Even on decent machines. I don't think that .NET languages will beat native languages. I think that language like C/C++ will last for a lot of coming generations.
 
Last edited:

Doomulation

?????????????????????????
I agree. I just think .NET is crap,
And you can probably be sure managed won't beat native, even with Microsoft's naive boasts that it's more purely optimized. There's just too much overhead.
Still, there seemes to be a market for both, so I don't see either one going away. Microsoft also has invented a lot of time in MFC 2008, especially GUI, so it seems C++ (w/ MFC) is here to stay after all! Makes me happy.
 

Toasty

Sony battery
In general, managed code does rival unmanaged code in terms of execution speed. The problem arises when you need to have things like self-modifying code, branch tables, custom memory management, etc. - things commonly used in emulators that simply can't be expressed efficiently with managed code. On the other hand, I find writing a front-end in C# infinitely less painful and time-consuming than writing one in C++.
 
Last edited:

Doomulation

?????????????????????????
In general, managed code does rival unmanaged code in terms of execution speed.

I seriously doubt it. Every managed app I've tried are slower than native (at least if native is written properly) and managed takes long to start, to boot.
 

synch

New member
I seriously doubt it. Every managed app I've tried are slower than native (at least if native is written properly) and managed takes long to start, to boot.

I've to agree there, my gameboy emulator runs either on managed (winforms gui with debugging utils and more) or unmanaged (only a window, ala bgb), and unmanaged is WAY faster.

Any way, .NET is way more productive, atleast for GUI heavy apps :)
 

Doomulation

?????????????????????????
For emulators, there's no doubt that native us better, but the argument is in general applications. However, native has proven to be faster than managed even in general applications.
 

Toasty

Sony battery
Any application (managed or unmanaged) that depends on a large number of libraries loading on start up is going to take time to start up. Can you give an example of a (general, of course - I think we can both agree that .NET is not well-suited for emulators and similar applications) managed application that behaves noticeably slower than a comparable unmanaged one? At the moment I'm developing an AviSynth front-end in C# and I can honestly say it loads in the blink of an eye. Even for data crunching algorithms (so long as the functions can be efficiently expressed with managed code) I have seen at most about five percent difference in execution speed between managed code and unmanaged - sometimes in managed code's favor.
 
Last edited:

cooliscool

Nintendo Zealot
Any application (managed or unmanaged) that depends on a large number of libraries loading on start up is going to take time to start up. Can you give an example of a (general, of course - I think we can both agree that .NET is not well-suited for emulators and similar applications) managed application that behaves noticeably slower than a comparable unmanaged one? At the moment I'm developing an AviSynth front-end in C# and I can honestly say it loads in the blink of an eye. Even for data crunching algorithms (so long as the functions can be efficiently expressed with managed code) I have seen at most about five percent difference in execution speed between managed code and unmanaged - sometimes in managed code's favor.

Indeed. I wrote a Banjo Kazooie model viewer in C#/OGL, and it does everything lightning quick even on low end machines, relatively unoptimized.
 

Garstyciuks

New member
ATI Control Center takes a lot of time to start up. Even after my system boots up, and I press the right mouse button on the ATI tray icon, I have to wait for nearly 3 seconds for the menu to appear (of course I don't have to wait the second time I press the right mouse button on it). Definite sign of .NET. However I can't name any native program with simillar features right now.

.NET languages do have use for rapid creation of GUI's and time unintensive (does that word exist? :)) applications, but that's probably the only area where .NET is useful. Any realtime application should be written in native languages.
 

Toasty

Sony battery
That's more-or-less my take on it as well. It's not like using managed code makes magical sludge clog up your CPU or anything, it's just that managed code is, well, managed. There are some inherit limits that a managed environment is going to impose to keep things 'safe'. If your application is the kind that's going to require lots of 'hand-optimization' - in other words, low-level optimizations that the compiler isn't smart enough to make and that can't be expressed with conventional syntax - then unmanaged code definitely has an advantage over managed code. You've got assembly, multimedia instructions, function/jump pointers, and all sorts of other stuff at your fingertips that you can use to speed things up.

With managed code you're sort of at the mercy of the compiler. In many, if not most, cases, this isn't a problem. Compilers are actually pretty smart things most of the time and as you said, for GUIs and the like, .NET is a well-suited platform. Even if there's some real data processing going on, unless hand optimization is required, it can usually be written to run pretty close to the same speed as native code.

Emulators, and I'll admit, a wide array of other applications, do require these optimizations though, so I'm not trying to shove C# in everyone's face and tell them it's better than C++. I just think managed code gets a somewhat undeserved reputation as being slower than molasses (probably somewhat due to Java's earlier incarnations) when it really does have the potential to do many things just as well as native code - and often with less development and debugging time, given a competent programmer. Anyway, that's my opinion, and if you'd still rather avoid managed code like the plague, it's fine by me. :flowers:
 

Flash

Technomage
ATI Control Center takes a lot of time to start up. Even after my system boots up, and I press the right mouse button on the ATI tray icon, I have to wait for nearly 3 seconds for the menu to appear (of course I don't have to wait the second time I press the right mouse button on it). Definite sign of .NET. However I can't name any native program with simillar features right now.
ATI Catalyst Control Center is fine example when you need to show people how badly .NET sucks :)
 

Toasty

Sony battery
In real universe and real applications it's always the opposite - unmanaged code is faster, way faster than managed.
Be careful when you use the term "always" by itself. I have seen for myself instances of managed code performing better than virtually identical (aside from the syntax changes needed in a translation from C# to C) unmanaged code, so your statement is untrue. Saying that ATI Control Center proves that .NET sucks is a major over-generalization. It wouldn't be fair for me to pick out a single poorly written native application and claim that it "proves unmanaged code sucks and is always inferior to managed code".

There are plenty of badly written programs out there, managed and unmanaged. They prove only that you can be a bad coder no matter what platform you write for. If you want a decent comparison, pick out two comparable, well-written programs. I don't care if your opinion is that unmanaged is better than unmanaged, and I'm not trying to change it if it is, but please don't use opinions in place of facts.

If you don't agree with me, forget I said anything - I doubt the original poster really cares. :D
 

Top