Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 6 7 [8] 9 10
 71 
 on: 2014-09-15 16:47:10 
Started by BurntPizza - Last post by 65K
Updated the game trailer for Biodrone Battle:

<a href="http://www.youtube.com/v/0Opd0037RIg?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/0Opd0037RIg?version=3&amp;hl=en_US&amp;start=</a>

 72 
 on: 2014-09-15 16:32:37 
Started by kappa - Last post by gene9
... support extension methods, which have the same benefits as default methods, but without polluting the interface. They have their own scope and their own visibility level. You can even define them locally inside another method. So, if you're thinking about designing a system around default methods, what you really want is extension methods.

Extension methods allow

oi.func(param);

Where in classic Java you would have had to do:

func(oi, param);

The only benefit is arguably IDE code completion. IMO, this value doesn't justify a new feature. default implementations are arguably better because implementations can override behavior

I prefer Haskell's approach where there are no instance methods/functions. You write functions that take parameters, but there is no special "this" parameter. Haskell's analog to interfaces is called "type classes" and they support default function implementations that can be overridden.

 73 
 on: 2014-09-15 16:12:08 
Started by kappa - Last post by noctarius
This also makes me wonder what happens if two interfaces define the same default function...?

The implementation of the two interfaces has to have it's own implementation of that method. You can still delegate the call to one of the interfaces by A.super.foo() or B.super.foo() or whatever, I guess you get the idea Wink

 74 
 on: 2014-09-15 16:11:26 
Started by kappa - Last post by cylab
This also makes me wonder what happens if two interfaces define the same default function...?

You'll get a compilation error and are required to implement the method. You can then explicitely delegate to the default implementation you want to use.

Edit: Sometimes I think I am invisible...  persecutioncomplex
                    VVV

 75 
 on: 2014-09-15 16:04:40 
Started by kappa - Last post by KevinWorkman
An interface still can have no kind of member state, so using them as traits is not as straight forward as you might think.

Eh, you could specify getter functions in the interface and use them in place of state variables. I still don't think it's a great approach, but not because it's overly complicated.

This also makes me wonder what happens if two interfaces define the same default function...?

 76 
 on: 2014-09-15 16:04:17 
Started by kappa - Last post by Spasi
Adding something to an interface, whether its a normal or a default method, is a design choice. A choice you'll have trouble taking back later. In that sense, I agree with the view that default methods is a workaround for safely extending legacy APIs and that's how I intend to use them.

For new systems, for fresh design choices, I have moved away from Java to other JVM languages that support more powerful features. Kotlin and Xtend for example support extension methods, which have the same benefits as default methods, but without polluting the interface. They have their own scope and their own visibility level. You can even define them locally inside another method. So, if you're thinking about designing a system around default methods, what you really want is extension methods. C# had them for a long time, but we can now have them on the JVM. Kotlin also has extension properties, which are fantastic for writing cleaner code. My favourite example would be:

1  
public val Int.b: Byte get() = (this and 0xFF).toByte()

which is great for graphics when dealing with unsigned bytes, e.g. you can write
byteBuffer.put(255.b);
. Will become even more useful when we get value types in the JVM.

 77 
 on: 2014-09-15 16:01:31 
Started by kappa - Last post by noctarius
An interface still can have no kind of member state, so using them as traits is not as straight forward as you might think.

 78 
 on: 2014-09-15 15:53:23 
Started by 20thCenturyBoy - Last post by Damocles
There was a statement from Notch:

http://notch.net/2014/09/im-leaving-mojang/

Quote
I’ve become a symbol. I don’t want to be a symbol

I guess he would join incognito into online forums, not to get all trampled over by fans.
..understandable

 79 
 on: 2014-09-15 15:44:30 
Started by 20thCenturyBoy - Last post by Isvan
So Notch might come back to the forum?

I think my issue is the same as everyone else's.
Im worried that Microsoft will destroy the minecraft community (Stop people from making videos and mods etc..)

Hopefully notch will just take a nice vacation and relax, then return to being a nerdy computer programmer  Wink

 80 
 on: 2014-09-15 15:43:56 
Started by kappa - Last post by KevinWorkman
This seems a bit fishy to me, because it seems to violate the principle of favoring composition over inheritance.

Specifically, why can't Logic, Render, and Collision be *members* of your Ship class? What benefit do you get by inheriting from them instead?

Pages: 1 ... 6 7 [8] 9 10
 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (27 views)
2014-09-07 01:10:19

mitcheeb (35 views)
2014-09-04 23:08:59
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!