PDA

View Full Version : Would C++ be my right choice ?


satimis
19th April 2010, 02:32 AM
Hi folks,

C++ and Java are platform independent. It is for sure. Java is a resource hog. The learning curve of C++ is quite steep at start. What I'm going to use C++ is to build a platform independent software with sound and graphic integrated as well interactive. Would C++ be the right choice for me? Any other suggestion? TIA

Edit:

I have separate data (.dat), sound (.wav) and graphics (.gif) files. I wonder whether I have to compile sound and graphic files on the software. I won't compile data file on software. It should be retained separately.

B.R.
satimis

stevea
19th April 2010, 02:27 PM
C++ & Java aren't very different syntactically, tho' C++ certainly has more features esp the pointer legacy stuff.
OTOH the portability of these two languages is very different. The source is fairly portable, but only Java produces really portable "binary".

You need to read up on your options and the differences.

fpmurphy
19th April 2010, 04:39 PM
You state that you want to build "platform independent software with sound and graphic integrated." Sound and graphics are generally not platform agnostic.

Simian Man
19th April 2010, 05:24 PM
For platform independence, the libraries you choose are much more important than the languages. For multimedia applications I recommend using SDL which provides platform independent windowing, sound, input and 2D graphics. It also provides an OpenGL context should you need 3D graphics. Moreover the library is one of the simplest and best designed APIs I have ever worked with.

You can program with SDL in a lot of different languages (http://www.libsdl.org/languages.php) including C++ and Java.

satimis
19th April 2010, 06:08 PM
C++ & Java aren't very different syntactically, tho' C++ certainly has more features esp the pointer legacy stuff.


Hi stevea,

Thanks for your advice.

Since I have spent couple days searching stuffs to learn C++ and already starting learning it for 3 days. Now I have a collection of stuffs for its learning. I'll start to searching stuffs on leaning Java.

A further thought if Java and C++ & aren't very different syntactically. Can I learn them simultaneously? Would it be a crazy idea?

Others noted and thanks.

B.R.
satimis

---------- Post added at 12:04 AM CDT ---------- Previous post was at 12:03 AM CDT ----------

You state that you want to build "platform independent software with sound and graphic integrated." Sound and graphics are generally not platform agnostic.

Noted and thanks

satimis

---------- Post added at 12:08 AM CDT ---------- Previous post was at 12:04 AM CDT ----------

For platform independence, the libraries you choose are much more important than the languages. For multimedia applications I recommend using SDL which provides platform independent windowing, sound, input and 2D graphics. It also provides an OpenGL context should you need 3D graphics. Moreover the library is one of the simplest and best designed APIs I have ever worked with.

You can program with SDL in a lot of different languages (http://www.libsdl.org/languages.php) including C++ and Java.

Hi Simian,

Thanks for your advice.

I won't build 3-D graphic only 2-D

satimis

NatLWalker
25th April 2010, 10:02 AM
C++ & Java aren't very different syntactically, tho' C++ certainly has more features esp the pointer legacy stuff.
OTOH the portability of these two languages is very different. The source is fairly portable, but only Java produces really portable "binary".

You need to read up on your options and the differences.
Pointers and manual memory management aren't legacy stuff. They're necessary for systems-level development, something C/C++ quite adept at - and something managed languages fail miserably at doing. There are safe Native languages like Ada for those who want extremely robust system with Native Code Execution speed.

C++ Code is portable if you use the same compiler. Aside from that, you have to be very careful with how you code, because C compilers are notorious for having their own little "extras" which are so convenient that developers can't help but use them.

Generally, the OS vendor will have a better C++ compiler than the alternatives. Sun Studio on Solaris, Visual Studio on Windows, and HP's C++ compiler on HP-UX are all better C/C++ compilers than GCC. The benefit of GCC is that you don't have to worry about the quirks of several compilers, and can disregard GCC's because it runs on all of those platforms, anyways...

Managed Languages and their Libraries (specifically .NET and Java) provide powerful abstractions, so you can usually move from one platform to the next without fear of incompatibilities and requiring few source changes - provided you aren't using platform-independent libraries. C# and .NET and cross-platform. The Libraries (WinForms, WPF, WCF, etc.)... Not so much.

You state that you want to build "platform independent software with sound and graphic integrated." Sound and graphics are generally not platform agnostic.

They are platform agnostic if you can find a suitable abstraction supported by the systems you wish to target. The issue with Sound and Graphics isn't the platform (as in OS or Processor Architecture), but the actual Sound and Graphics hardware. You never know if the hardware anyone uses to run your software will actually support the API calls you use. Linux users are notorious for using recycled software.

You might develop on a system with recent model SoundBlaster Gaming Card and a GeForce 9800, but someone may run your software on system with a built-in sound card and a Radeon 9200 SE on a system that otherwise runs flawlessly.

Cause we should all have to upgrade hardware to run general-purpose end-user software, right? ;)

EDIT: Also, learning the syntax of a language is easy (couple weeks, a month at the most for a reasonably and honestly interested person). Learning how to code to the point that you can productively churn out code is not. That can take several months or longer, and you should get ahold of some good books. Most online tutorials are terrible. MSDn is also a good, searchable, reference... Sun also has excellent documentation. You may want something more specific to the GCC toolchain, though.

And do learn how to use a debugger (like GDB) :P

surfers Instagram Photos - Borobudur Hotel Jakarta Instagram Photos - Bantayan Island,Cebu Instagram Photos - Thunderbird Resort, Poro Point, San Fernando City, La Union