Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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] 5 6 ... 9
  ignore  |  Print  
  Does really game development on Java suck? Why are we still here?  (Read 49498 times)
0 Members and 1 Guest are viewing this topic.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #90 - Posted 2012-03-30 16:17:12 »

I don't have a problem understanding operator overloading; I have a big problem understanding the code that people produce as a result of it Wink

Really?  Even for bignums?  Complex numbers?  Vectors? They already overloaded it for strings, making Java more loosely typed even than Python for that use case.  You're also soaking in it when it comes to basic arithmetic operators, as opposed to languages like SML which require different overloaded infix operators for floats and ints.

No modern language should be designed that constantly requires its users to petition its maintainers for special cases.


Online BoBear2681

JGO Coder


Medals: 18



« Reply #91 - Posted 2012-03-30 18:18:37 »

WRT: since language nannys deny me operator overloading, which is pretty easy to understand,

I don't have a problem understanding operator overloading; I have a big problem understanding the code that people produce as a result of it Wink

Perhaps I'm just naive, but do people really use operator overloading in, say, C++, for any cases other than mathematical types and stringish types?  Now that I'm typing this, I guess people would also want to use them for various data structures as well (intersection and union of collections, etc.).

I guess my question is:  how often do you come across code that uses operator overloading in a non-intuitive context?
Offline princec

JGO Kernel


Medals: 361
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #92 - Posted 2012-03-30 18:22:52 »

Every time I see someone trying to use cout in the "canonical example" of C++ operator overloading  Cranky

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Roquen
« Reply #93 - Posted 2012-03-30 18:26:29 »

Quote
I guess my question is:  how often do you come across code that uses operator overloading in a non-intuitive context?

In code that I'd actually what to use? Never.  And that's my point.  Lack of operator overloading sucks.  Bad usage is BS..bad programming is already a given, so stop making my life harder.  WRT: Outside of algebraic types, getter and setter are big.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #94 - Posted 2012-03-30 18:27:05 »

Perhaps I'm just naive, but do people really use operator overloading in, say, C++, for any cases other than mathematical types and stringish types?  Now that I'm typing this, I guess people would also want to use them for various data structures as well (intersection and union of collections, etc.).

Smart pointers (and similar resource handles) often use operator overloading. Iterators are common too. std:io streams are a weird case because I don't think I've ever seen any other C++ stream classes use that style (even though I think it's quite nice).

I've made heavy use of operator<< in a unit test framework to get nice error reporting out of it (kind of a turbo-charged Object.toString()) but again that was mostly just following the std::io conventions.

I don't think I've come across many uses in real code other than that. Boost of course tends to do really weird things with them, but IMHO boost is pretty much an example of why you never want to write in C++ unless you really have to.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline ShannonSmith
« Reply #95 - Posted 2012-03-30 19:46:46 »

I'm a big fan of minimalist programming languages. If you want a language that gives you all the rope you want to hang yourself use c++. In my professional career I have seen so many more bad examples (eg  std::io) of operator overloading than good ones. The day Java gets operator overloading is the day I'm looking for a new language.
Currently I am much more limited by my inability to stay focused on a single idea than any issues with my chosen toolset.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #96 - Posted 2012-03-30 20:13:52 »

It'd be great if I could say "everyone's free to make their own choice of language", but it's a naïve view of things when you take into account the edicts from customers and managers.  It'd sure be nice if one of the most prominent languages of the world wasn't making "hobble your programmers because they cannot be trusted with power" the byword of project management everywhere.

Given my experience and location, I have a pretty good choice of management environments too, should I need to exercise it, but not everyone's that lucky. 
Offline princec

JGO Kernel


Medals: 361
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #97 - Posted 2012-03-30 20:49:47 »

I always thought that allowing operators to be defined as normal Java identifiers (eg. a dot b) would have been a pretty perfect compromise between the two camps especially given the very small amount of code that would actually benefit from custom operators, but then I'm always wrong Smiley

Cas Smiley

Offline badlogicgames
« Reply #98 - Posted 2012-03-30 22:34:12 »

That reminds me of BASIC, no idea why. The more expressive a language, the higher the risk that a team of programmers will make it an unmaintainable hell. Hand out just enough bullets to shot everone in the foot once. Java is "nice" in that regard. I couldn't imagine the team i work in switching to something like Scala.

http://www.badlogicgames.com - musings on Android and Java game development
Offline sproingie

JGO Kernel


Medals: 202



« Reply #99 - Posted 2012-03-30 22:49:31 »

It's entirely possible there is a happy medium.  My opinion is just that it lies somewhere beyond the 1960's in terms of language design.  Hell, I'd be happy if we could even build on the ground that algol-68 broke
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline actual

JGO Coder


Medals: 23



« Reply #100 - Posted 2012-03-31 15:44:52 »

I always thought that allowing operators to be defined as normal Java identifiers (eg. a dot b) would have been a pretty perfect compromise between the two camps especially given the very small amount of code that would actually benefit from custom operators, but then I'm always wrong Smiley

If I understand what you talking about, Scala allows you to do this. So you "+" is just a method and scala has special syntax rules for two parameter methods that allows you to make nice infix code. I've used it in my vector implementation and it is nice to be able to say
1  
newPosition = currentPosition + velocity*elapsedTime

where velocity, newPosition, and currentPosition are my Vector3Ds and elapsedTime is a long but every non-mathematical, non-trivial use of it that I have seen has been down right ugly. SBT (Simple Build Tool) is a perfect example.

So I guess I am glad Scala has it, and wouldn't mind if Java got it but I wish people would use a lot more restraint when using it.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #101 - Posted 2012-03-31 17:44:39 »

An infix operator is a one-parameter method, and the other side is the object defining it.  Sure you can reasonably think of 'this' as a parameter, but the language syntax doesn't see it that way.  Scala has very permissive rules for what constitutes a valid method name.  Unfortunately, instead of being able to declare fixity, it hardwires "ends with a colon" to mean right-associative.  

SBT's use of operator overloading is quite reasonable, especially for a DSL with a limited domain -- you're not likely to embed it in an app not related to build management after all.  You want operator abuse, take a look at Unfiltered.  It's the price of expressiveness, that someone might express in a way that doesn't make sense to you.  My solution is simply to not use Unfiltered.   I too have my limits, believe it or not Wink


Offline actual

JGO Coder


Medals: 23



« Reply #102 - Posted 2012-03-31 18:30:57 »

I suppose if I dug in and used SBT long enough I'd be able to work with it more easily (truth be told I don't even like the "!" and "!!" used with Actors). I'll take all look at Unfiltered if for no reason other than to get my agita up.
Offline Roquen
« Reply #103 - Posted 2012-03-31 19:17:22 »

Within the context of Java.  The most important operators would be getters and setters.  And not C# style automagic.  I'm about to head out for vacation so I don't have time to do a proper write-up.  And in the special case of getter/setter NOT being pure syntax sugar handled by the AOT compiler, but VM aware constructs..any other operators can be pure sugar.  Think hiding implementation details and the fact that all classes other than the implementer shouldn't care if a "field" is a real field or a pair of methods.
Offline kaffiene
« Reply #104 - Posted 2012-04-01 08:35:36 »

WRT: since language nannys deny me operator overloading, which is pretty easy to understand,

I don't have a problem understanding operator overloading; I have a big problem understanding the code that people produce as a result of it Wink

Perhaps I'm just naive, but do people really use operator overloading in, say, C++, for any cases other than mathematical types and stringish types?  Now that I'm typing this, I guess people would also want to use them for various data structures as well (intersection and union of collections, etc.).

I guess my question is:  how often do you come across code that uses operator overloading in a non-intuitive context?

I've seen C++ code where people overloaded the new operator and the parentheses operator - ()

f**king awful beyond belief.  You have to read the whole code base to understand any of it. 
Offline 65K
« Reply #105 - Posted 2012-04-01 08:47:33 »


I've seen C++ code where people overloaded the new operator and the parentheses operator - ()

f**king awful beyond belief.  You have to read the whole code base to understand any of it. 

Human obfuscation Grin

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #106 - Posted 2012-04-01 12:51:32 »

I've seen C++ code where people overloaded the new operator and the parentheses operator - ()

f**king awful beyond belief.  You have to read the whole code base to understand any of it. 

Overloading new and delete operators is incredibly handy for doing custom memory pools and allocators. You can detect memory leaks this way, and on memory-limited platforms (ie. consoles) it's vital to be able to segregate different allocations into different pools with different lifetimes.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline kaffiene
« Reply #107 - Posted 2012-04-02 04:33:52 »

I've seen C++ code where people overloaded the new operator and the parentheses operator - ()

f**king awful beyond belief.  You have to read the whole code base to understand any of it. 

Overloading new and delete operators is incredibly handy for doing custom memory pools and allocators. You can detect memory leaks this way, and on memory-limited platforms (ie. consoles) it's vital to be able to segregate different allocations into different pools with different lifetimes.

Overloading can be handy when:
(1) people do exactly what they're supposed to do with the operator (what's the proper usage for parenthesis overloading?)
(2) don't abuse it
(3) make all the corner cases consistent
(4) have a use case where all the operations are covered (how do I do dot operator for vectors?
(5) the precedence for primitives matches the precedence for objects (why should a vector cross operator using * have higher precedence than addition using + when these aren't precedence rules of vector mathmatics?)
(6) you don't mind having to read the class definitions of all expressions involving operators to know whether the code means what it looks like or not.

Regarding the new operator - I wrote a memory leak (and boundary overrun detecting) allocator by replacing alloc().  You don't need operator overloading to do that.  Besides which, why operator overloading at all for that use case?  If you want to be able to specialise allocators why not have a pluggable allocator rather than the option to make new() do absolutely anything - which is what operator overloading gives you.
Offline princec

JGO Kernel


Medals: 361
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #108 - Posted 2012-04-02 08:25:15 »

It's exactly the sort of thing that makes C++ so "hard" and one of the key differentiators from Java. Yuk. But method operators would be ace.
1  
2  
3  
public operator Vector3f cross(Vector3f left, Vector3f right) {...}
...
Vector3f a = left cross right;


Cas Smiley

Offline OverKill

Junior Member




Java games rock!


« Reply #109 - Posted 2012-04-02 08:41:43 »

It'd be great if I could say "everyone's free to make their own choice of language", but it's a naïve view of things when you take into account the edicts from customers and managers.  It'd sure be nice if one of the most prominent languages of the world wasn't making "hobble your programmers because they cannot be trusted with power" the byword of project management everywhere.

Given my experience and location, I have a pretty good choice of management environments too, should I need to exercise it, but not everyone's that lucky.  
If you give everyone the freedom, they will use it. Everyone thinks they know how to do things better then everyone else.
That was the demise of c/c++.

see this Dear maintainer entry.

Add in the spec writers giving in to tantrums from language migrators wanting 'features' from every language added, and you will have a mess.

Java is limited, statically defined and whatnot, but that is IMHO a good thing. It means it is reduced to things that EVERYONE can use and understand.
Would I like to see operator overloading? Yes, I could actually use it right now! But I know what could happen if you add it, thus I would rather not have it.
Offline gimbal

JGO Knight


Medals: 25



« Reply #110 - Posted 2012-04-02 10:56:39 »

There are some valid points among the debate. I see it as that there are basically two "camps" - the people who work more for themselves (such as private gaming projects) who want a language which gives freedom. There are also the people who work in (big) teams on a daily basis that would loathe the day that the language would open up more possibilities for team members to create the utter maintenance hell.

I certainly appreciate Java's "you ain't gonna do it" design mentality when I see what kind of people I usually have to work with. The kind that likes to fabricate 5 layers of code where 1 suffices. Please, god, don't let operator overloading ever make it into the Java base language...
Offline cylab

JGO Ninja


Medals: 43



« Reply #111 - Posted 2012-04-02 11:14:18 »

If operator overloading is important, there is always Scala and now to some extend Kotlin (http://blog.jetbrains.com/kotlin/), which seems to be a nice compromise between Java and Scala. Haven't tried it yet, but with the now available language support plugin for the free Idea Community Edition, it might be worth checking out (and creating a decent math library with it's operator overloading feature...)

Mathias - I Know What [you] Did Last Summer!
Offline sproingie

JGO Kernel


Medals: 202



« Reply #112 - Posted 2012-04-02 15:19:27 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)
Offline gimbal

JGO Knight


Medals: 25



« Reply #113 - Posted 2012-04-02 15:29:54 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)


 Roll Eyes

Hmmm, reluctant matching methinks Wink
Offline pitbuller
« Reply #114 - Posted 2012-04-02 20:56:48 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)


C++ is still the gaming language but on other parts of software industry it has been in steady decline about ten years. c++ is never ment to be language for every solution but it was misused in many places where perfromance wasn't crucial.
Offline kaffiene
« Reply #115 - Posted 2012-04-05 22:43:06 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)

Sure, C++ is very powerful and has a huge foothold in gaming studios, but no-one seriously argues that C++ is well designed!  If C++ came out with the design of D, it might be that we'd never have bothered trying to find better languages, but that wasn't the case.
Offline kaffiene
« Reply #116 - Posted 2012-04-05 22:45:43 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)


C++ is still the gaming language but on other parts of software industry it has been in steady decline about ten years. c++ is never ment to be language for every solution but it was misused in many places where perfromance wasn't crucial.

Yeah, it's worth noting that C++ is ranked *under* C in the Tiobe language index.  When the language you were designed to replace has a resurgence to become more popular than you, you've failed.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #117 - Posted 2012-04-05 22:57:30 »

You really think TIOBE is an accurate measurement of industry?

How many job reqs do you see that list "C/C++" as if it were somehow the same language?
Offline pitbuller
« Reply #118 - Posted 2012-04-05 22:59:15 »

That was the demise of c/c++.

Yeah I know what you mean.  There just aren't any apps written in C++ any more.    Roll Eyes

(hey what the hell happened to the eyeroll emoticon?)


C++ is still the gaming language but on other parts of software industry it has been in steady decline about ten years. c++ is never ment to be language for every solution but it was misused in many places where perfromance wasn't crucial.

Yeah, it's worth noting that C++ is ranked *under* C in the Tiobe language index.  When the language you were designed to replace has a resurgence to become more popular than you, you've failed.

c++ is ranked under java, c, c# and soon even objective-c goes above it. c++ is dying language but I can't see it would fade anywhere from gaming scene at least in this decade.


@sproingie: I think OverKill means the ranking position.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #119 - Posted 2012-04-05 23:00:14 »

How many job reqs do you see that list "C/C++" as if it were somehow the same language?
You probably mean "C/C++/C#", which just shows how important a name is - those hiring have no clue whatsoever.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: 1 2 3 [4] 5 6 ... 9
  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.

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

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

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

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

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

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

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

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
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!