Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Messing with c++  (Read 6337 times)
0 Members and 1 Guest are viewing this topic.
Haksu
Guest
« Posted 2007-12-31 01:15:54 »

I've been coding with Java for about year and I would like to learn also c++. I have installed Dev-c++ and I can do "hello world" and some other small programs.

Right now I am just wondering that is there some kind of similar api for c++ like we have this to java --> http://java.sun.com/javase/6/docs/api/

Offline purpleguitar

Junior Member





« Reply #1 - Posted 2007-12-31 13:32:40 »

"Java" is a language, an API, and a virtual machine.  C++ is just a language, and it does not have anything equivalent to the Java API.  There are many libraries available for C++ that do the same things as the Java API, both proprietary and free.  This is why so many developers use tools like Microsoft Visual C++, which includes both the C++ compiler and a huge set of libraries such as .NET.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #2 - Posted 2007-12-31 15:19:07 »

Not quite.  For any C language to call itself C, has to provide a set of ANSI standard libraries.  However, that does not provide a windowing environment.  You might find it easy to SDL with Dev-C++ if you are just going to be doing games.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Ninja


Medals: 43



« Reply #3 - Posted 2007-12-31 15:54:56 »

If you want some good API for c++ go for the QT framwork, which is similar in scope and sometimes philosophy to the java SE API.

Mathias - I Know What [you] Did Last Summer!
Haksu
Guest
« Reply #4 - Posted 2007-12-31 21:33:00 »

Thanks to everyone for your answers, I'm getting wiser all the time.
Offline purpleguitar

Junior Member





« Reply #5 - Posted 2008-01-01 13:08:30 »

I should have qualified that I was speaking in little white lies. The ANSI libraries are not really comparable in scope to the Java APIs, in my opinion.  That  comment will get me flamed by system programmers...

By the way, if you want to write effective C++, I recommend "Effective C++" by Scott Meyers.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2008-01-01 19:48:26 »

1. Dev-Cpp is ancient and IIRC no longer supported. Go get yourself a decent compiler and IDE. Visual Studio Express is free to download ( http://www.microsoft.com/express/ ). Alternatively try Code Blocks or Eclipse CDT.

2. CppReference ( http://www.cppreference.com/ ) covers the C++ standard library. As can see it's tiny compared to the Java SDK. You might also want Boost ( http://www.boost.org/ ) which provides a lot of stuff which really should be in a standard library.

3. For a windowing API you'll have to go with yet another library. Qt is popular and IIRC cross platform. Or you can write platform specific Win32 / X / Mac code. Or if you just want something simple (ie a window to draw on) then you can try SDL.

4. The standard C++ bible for beginners is The C++ Programming Language ( http://www.amazon.com/C%2B%2B-Programming-Language-Special-3rd/dp/0201700735/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1199216934&sr=1-2 ).

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Haksu
Guest
« Reply #7 - Posted 2008-01-02 01:24:29 »

Yeeesshh,

I'll have to check which of these books can I find from my home towns library. Atleast "C++ Programming Language" by Stroustrup is available there, both in english and finnish so I guess I'll borrow (loan?) that finnish version, even though some times translators make some bad mistakes translating programming books (honestly, why they have to translate names of variables in code examples? The worst thing is that some variables are not all translated and the example program doesn't work!).

I have already bought "C programming language"by Kernighan & Richie (from flea market, cost 1€).

Does some kind of Java bible exist? Is it "Java Programming Language" by Arnold, Gosling and Holmes?

Even John Romero recommends that Visual c++, so it looks like the best option for a beginner like me.
Offline tortoise

Junior Member




<3 Shmups


« Reply #8 - Posted 2008-01-02 02:58:00 »

Be careful going the Visual C++ route. Microsoft is great at bastardizing C++. Managed C++ (and whatever they are calling it now) is not standard C++ at all. If you go the MS route and start to look for C++ help, you'll be floating in a sea of Managed C++, ATL, MFC, etc etc. It really gets polluted.

IMO you're better off going with something like g++ and a good text editor, or investigating how well eclipse supports C++ these days.

And also be careful, C and C++ are not the same thing. C++ is a superset of C, but the two languages should be approached very differently.
Haksu
Guest
« Reply #9 - Posted 2008-01-02 04:26:39 »

Okay...

One thing that I would like to have is IDE and comiler in same thing. I never get anything to work when I try to add compiler to ide. For example trying to add cygwin to netbeans.

Dos eclipse have some kind of compiler in it?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #10 - Posted 2008-01-02 09:43:10 »

Be careful going the Visual C++ route. Microsoft is great at bastardizing C++. Managed C++ (and whatever they are calling it now) is not standard C++ at all. If you go the MS route and start to look for C++ help, you'll be floating in a sea of Managed C++, ATL, MFC, etc etc. It really gets polluted.
The documentation is a little awkward if you're not expecting it, but VS still supports regular C++ as long as you choose the right project type. And ATL and MFC are still regular C++, not managed.

Quote
And also be careful, C and C++ are not the same thing. C++ is a superset of C, but the two languages should be approached very differently.
Technically C++ is not a superset of C any more. It's possible to write valid C code which isn't valid C++ code.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Haksu
Guest
« Reply #11 - Posted 2008-01-02 15:52:24 »

The documentation is a little awkward if you're not expecting it, but VS still supports regular C++ as long as you choose the right project type. And ATL and MFC are still regular C++, not managed.

What is the "right" project type then?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #12 - Posted 2008-01-02 16:32:41 »

In VS2003 all the managed C++ projects are grouped under a ".NET" folder and labled as using managed C++. The layout may have changed in 2005 or 2008 though - just avoid ones which mention managed code or .NET and you should be fine. "Win32 Console Project" or "Makefile project" is probably what you want if you're after something bare bones.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline tortoise

Junior Member




<3 Shmups


« Reply #13 - Posted 2008-01-02 17:54:48 »

The documentation is a little awkward if you're not expecting it, but VS still supports regular C++ as long as you choose the right project type.

Well, yeah. But .NET would potentially confuse someone new to C++, especially if he started googling around and/or asking on the MSDN forums.

Quote
And ATL and MFC are still regular C++, not managed.

Yeah. But I wouldn't wish ATL or MFC on a veteran C++ developer, let alone a newbie Smiley

My point is MS pushed and bent C++ so much to try and reach their goals it almost doesn't feel like the same language anymore. Pure ISO C++ with some simple libraries to help any platform specific issues is a much nicer experience. C++ is a really nice language in its own right, and it's refreshing and nice to be able to harness some of the power if offers. But IMO, that only really applies if you can experience C++ in the way it was intended, and I strongly argue MS ruins that quite a bit.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #14 - Posted 2008-01-03 01:11:35 »

One thing that I would like to have is IDE and comiler in same thing. I never get anything to work when I try to add compiler to ide. For example trying to add cygwin to netbeans.

Dos eclipse have some kind of compiler in it?

If you are running Windows then Visual Studio is the only IDE to bother with for C/C++.

It was brain-dead idiotic for the Netbeans team to require cygwin/gcc/MingGW on Windows because it is absolute crap on the Windows platform and no professional developer would consider it for a second.  On Windows everyone uses Visual Studio and the Microsoft complier, or if they really need that extra bit of performance, they use the Intel compiler for their release builds (still with Visual Studio).

On other platforms you have more options, but on Windows, Visual Studio is the only reasonable option.

Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #15 - Posted 2008-01-03 05:47:04 »

If you are running Windows then Visual Studio is the only IDE to bother with for C/C++.

It was brain-dead idiotic for the Netbeans team to require cygwin/gcc/MingGW on Windows because it is absolute crap

I've been using Netbeans for C developement for about a month now and I'm perfectly happy with it.  Haven't noticed any problems with cygwin.

I think they (netbeans devs) were trying to support a 'standard' c/c++ development model (makefile centered) which I appreciate since I'm not writing windows specific code.  I think this is the case for most anyone who would use something like Netbeans or Eclipse for c/c++ development in place of vis studio; I want my code to compile on linux/mac/windows with minimum hassle.
Haksu
Guest
« Reply #16 - Posted 2008-01-03 16:27:21 »

If you are running Windows then Visual Studio is the only IDE to bother with for C/C++.

It was brain-dead idiotic for the Netbeans team to require cygwin/gcc/MingGW on Windows because it is absolute crap on the Windows platform and no professional developer would consider it for a second.  On Windows everyone uses Visual Studio and the Microsoft complier, or if they really need that extra bit of performance, they use the Intel compiler for their release builds (still with Visual Studio).

On other platforms you have more options, but on Windows, Visual Studio is the only reasonable option.

Well, I also have Ubuntu so what kind of good IDEs and compilers do we have for linux?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #17 - Posted 2008-01-03 16:58:50 »

Well, I also have Ubuntu so what kind of good IDEs and compilers do we have for linux?

Code::Blocks gets recommended a lot, but I havn't tried it myself.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline thiagosc2

Senior Newbie





« Reply #18 - Posted 2008-04-19 02:57:15 »

I can't think of anything more uninteresting than C++. The problem is that it follows the same paradigm as Java, it adds nothing, just some low-level crap. It is not an improvement, it is just manual labor, like a civil construction worker carrying bags of cement on his back.

Do yourself a favor and learn something that might change the way you think about software. Learn Lisp. I guarantee that you will look towards your Java programs or even C++ programs a lot differently and will understand what some people see of so interesting in it.

You are not EA, so don't think like EA. If somehting works for big studios not necessarily  it will work for small ones.
Offline kaffiene
« Reply #19 - Posted 2008-04-19 12:14:18 »

I'm employed as a game developer and i'm coding in c++.  I hate it - god awful language.  It's such a f**king mess.  And I come from a background of programming C for just under two decades and C++ for at least a decade.

C++ is okay only if you write ALL the code you use by yourself or work with a team who agree to strictly use a subset of the language..  Working with other C++ coders and APIs, you end up with impedance mismatch between code styles - some people write templated shite, some people do OO, some people write C++ as if it's C.  All these different styles don't mesh well and you end up fighting the language just to do really simple stuff.

I personally think that C++ is a mess.  They should scrap it and start again.  The D programming language is a reasonable example of what C++ ought to have been.
Offline dipse

Junior Newbie





« Reply #20 - Posted 2008-04-22 18:42:10 »

I started to learn C++ after learning Java but all the different tutorials seemed to disagree with each other and it seemed to take so long to get anywhere. So I now i am learning python, which i find suites me more.
Haksu
Guest
« Reply #21 - Posted 2008-04-25 20:11:46 »

After coding few small programs I must say that it's terrible to code C++. After I realized that how I must declare public and private methods I started to hate it. So much more writing to do some simple things.  I am not going to write any games with it because java (and even python) is fast enough for small games.

I heard of that new improvement C++0x (name sounds like it's even worse than previous). Does anyone know something good about it?

What's better in D? Does it have those annoying pointers like in C and C++? Could D become as popular as C++ or Java?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #22 - Posted 2008-04-25 21:37:25 »

After coding few small programs I must say that it's terrible to code C++. After I realized that how I must declare public and private methods I started to hate it. So much more writing to do some simple things. 
Which is funny, because C++ programmers moving to Java often complain about how verbose Java is, in particular how it's annoying to explicitly define everything as public or private instead of deliminated blocks.[1]

Quote
I heard of that new improvement C++0x (name sounds like it's even worse than previous). Does anyone know something good about it?
C++0x is the placeholder name, it'll become C++0xN depending on when it's actually standardised, similar to how C99 was named (and is increasingly looking like it'll be C++0xA since it'll be at least 2010 before it gets finished). Personally I think it won't be terribly important, since all they're really doing is moving the common/important parts from Boost into the standard library. And they'll still be maintaining (mostly) C compatibility which is the real weight around C++'s neck so they won't be able to do anything major.

Quote
What's better in D? Does it have those annoying pointers like in C and C++? Could D become as popular as C++ or Java?
Unlikely. It's been going for many years now and doesn't show any signs of significant progress. It started off as a good compromise between C++'s low level and Java's high level, but has increasingly been side tracked by trying to introduce "trendy" new features with limited scope, making the same basic mistakes as C++ (but without the historical justification) and generally being clunkier and more inelegant than either Java or C++.

Personally I think C++ is a facinating language, and generally very, very good given the goals and compromises it set out to acheive. But if your compromises don't match then it's going to be a very poor fit for you.

[1] Right up until the point where you start including private: or public: expressions inside of macros. Then it all goes a little weird.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline aldacron

Senior Member


Medals: 9
Exp: 16 years


Java games rock!


« Reply #23 - Posted 2008-04-26 02:06:18 »

Unlikely. It's been going for many years now and doesn't show any signs of significant progress. It started off as a good compromise between C++'s low level and Java's high level, but has increasingly been side tracked by trying to introduce "trendy" new features with limited scope, making the same basic mistakes as C++ (but without the historical justification) and generally being clunkier and more inelegant than either Java or C++.

That's so wrong Smiley I know a lot of D users, myself included, who will strongly dispute that it's clunkier or more inelegant that Java or C++. It's miles, leagues, ahead of C++ in that regard.

I've been active in the D community since it was in early beta and it has made, and is still making, large strides. The pre 1.0 ramp up took a few years, as Walter (the sole developer at the time) took his time to get it right. D 1.0 wasn't launched until Jan '07. Now, it's perfectly stable and works as advertised (with a few minor quirks).  D2 is under development and is where the major focus is now, with the 1.x series getting bug fixes and the occasional back ported feature. The D2 spec is expected to be finalized by the fall of this year. It's a major shift in focus and will be unlike anything else out there. Multiprogramming is the future, so D is being positioned to meet the challenges that brings.

Take a gander at these slides from a recent presentation Andrei Alexandrescu gave at the ACCU conference (PDF): Grafting Functional Support on Top of an Imperative Language. Andrei is deeply involved in D2's development. Those slides will give you an idea of where it's going.
Offline kaffiene
« Reply #24 - Posted 2008-04-26 08:48:34 »

If D was were it is now when Java came out, it might have got some serious traction.  As it is, it's a decade too late.  But... miles and miles better than C++. 
Haksu
Guest
« Reply #25 - Posted 2008-04-26 15:12:46 »

Which is funny, because C++ programmers moving to Java often complain about how verbose Java is, in particular how it's annoying to explicitly define everything as public or private instead of deliminated blocks.[1]


[1] Right up until the point where you start including private: or public: expressions inside of macros. Then it all goes a little weird.

I must admit that it's annoying to write private before every variable.
Haksu
Guest
« Reply #26 - Posted 2008-04-26 18:31:42 »

I was just thinking that if I write as Javaish code as I can with C++ what would be the result (I mean what would be performance compared to Java? I mean if I would code with fully object oriented coding style and I wouldn't use those pointers and other features that C++ has but Java doesn't.
Offline cylab

JGO Ninja


Medals: 43



« Reply #27 - Posted 2008-04-26 20:21:50 »

Your performance will probably be worse, since the C++ object model is more complex than the java model. Where C/C++ shines is the performance when doing number crunching of large sets of raw data.

Mathias - I Know What [you] Did Last Summer!
Haksu
Guest
« Reply #28 - Posted 2008-04-28 09:49:45 »

I must admit that it's annoying to write private before every variable.

It looks like I wasn't thinking too much when I said that comment. Of course I can do like: private int x, y, z etc...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (15 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (30 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (43 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!