Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 3 [4]
  ignore  |  Print  
  The hidden cost of C++  (Read 14463 times)
0 Members and 1 Guest are viewing this topic.
Offline KittenKoder

Senior Devvie


Medals: 7



« Reply #90 - Posted 2012-11-01 10:10:17 »

In C++, this is not valid:
1  
vector<vector<vector<double>>> myVec;


This is valid  Huh:
1  
vector<vector<vector<double> > > myVec;

I think that doesn't make sense at all.  Undecided

The ambiguity of the >> and >>> is a fault of the overriding of operators, this is both a strength and a weakness. Java avoids this by not allowing operator overriding, one of the many aspects of Java I like. Overriding operators does make more compact source code, but in reality it doesn't make things more readable and just offers certain flaws such as the above nuance.

I am no one else.
Online Roquen
« Reply #91 - Posted 2012-11-01 14:08:58 »

Operator overloading isn't the problem.  An ambiguous syntax is. 
Offline sproingie

JGO Kernel


Medals: 202



« Reply #92 - Posted 2012-11-01 16:57:06 »

That's actually one of the reasons I do and don't like c/c++, pointers are "open access." You can type cast anything to anything, but you have to remember what you've cast something as or you'll access part of something else ... maybe even part of another program.

C++ is actually fairly strict about that sort of thing with normal casts (C-style or static_cast<>), much more so than C is.  Now there is reinterpret_cast<> which really is an anything-to-anything cast, but it's got a clunky distinctive name like that for a reason.

What does kill me about C is stuff like slicing, which you can only seem to avoid by using pointers.  That and implicit copy constructors -- at least Scala's implicit conversions require an 'implicit' keyword, C++ forces you to opt out with 'explicit'.

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

JGO Kernel


Medals: 202



« Reply #93 - Posted 2012-11-01 16:59:45 »

In C++, this is not valid:
1  
vector<vector<vector<double>>> myVec;


This is valid  Huh:
1  
vector<vector<vector<double> > > myVec;

I think that doesn't make sense at all.  Undecided

It doesn't have to, because it's not the case anymore.  GCC fixed it a long time ago, and it's part of the C++ standard.  It's also got jack shit to do with operator overloading, it's ambiguity at the lex/parse level.  Incidentally, the ambiguity is with >>, C++ does not have a >>> operator. 
Offline Oskuro

JGO Knight


Medals: 40
Exp: 6 years


Coding in Style


« Reply #94 - Posted 2012-11-02 11:19:58 »

In C++, this is not valid:
1  
vector<vector<vector<double>>> myVec;


This is valid  Huh:
1  
vector<vector<vector<double> > > myVec;

I think that doesn't make sense at all.  Undecided

Now, it is certainly inconvenient when a parser/compiler does this kind of thing, but it isn't hard to understand why.

If you have trouble understanding the reason why these inconveniences happen, then maybe you are the problem?

Not trying to be smug or anything. In my experience with different languages, a big part of the development process is finding ways to work around limitations (usually cursing all the way through).

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #95 - Posted 2012-11-02 12:27:14 »

Recognising ones own limitations as well as others is a very positive attitude to have in life, though. I recognised years ago that C++ was basically too difficult for me to get anything done in, in any reasonable length of time. So I picked something much simpler to work with.

Cas Smiley

Offline Oskuro

JGO Knight


Medals: 40
Exp: 6 years


Coding in Style


« Reply #96 - Posted 2012-11-03 15:37:00 »

Indeed.

I personally have an irrational love for C++, but still prefer to start development in Java until I have a good idea of what I'm doing, before even attempting to get knee-deep in segmentation faults.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #97 - Posted 2012-11-03 16:18:17 »

It's good to be lazy sometimes  Wink
Pages: 1 2 3 [4]
  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.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (46 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!