Talk:Conway's Game of Life: Difference between revisions

Content added Content deleted
(→‎Java Swing: Make the code better, and don't worry about length)
(→‎Java Swing: Sub-page?)
Line 18: Line 18:
: I've not got a problem with having it, but the code could be better. :-) For example, it's more idiomatic to not make <code>GameBoard</code> implement interfaces like <code>ComponentListener</code> and to instead pass in a inner subclass of <code>ComponentAdapter</code>. Similarly, you've got a big <code>if</code> chain inside <code>actionPerformed</code> (in <code>ConwaysGameOfLife</code>) whereas it is better to use some inner classes that are specific to each event source. You should separate the model from the GUI too (turning everything between a list of points and an array of values every turn has got to be less than perfectly efficient). All criticism offered in the spirit of trying to help you make your code be more idiomatic (my watchword for what makes a good RC example).
: I've not got a problem with having it, but the code could be better. :-) For example, it's more idiomatic to not make <code>GameBoard</code> implement interfaces like <code>ComponentListener</code> and to instead pass in a inner subclass of <code>ComponentAdapter</code>. Similarly, you've got a big <code>if</code> chain inside <code>actionPerformed</code> (in <code>ConwaysGameOfLife</code>) whereas it is better to use some inner classes that are specific to each event source. You should separate the model from the GUI too (turning everything between a list of points and an array of values every turn has got to be less than perfectly efficient). All criticism offered in the spirit of trying to help you make your code be more idiomatic (my watchword for what makes a good RC example).
: There are some MediaWiki tricks for having a long example on the page without making the page (well, the page source) too long. I'll apply them if it becomes an issue (it's not, yet). –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 09:40, 17 January 2014 (UTC)
: There are some MediaWiki tricks for having a long example on the page without making the page (well, the page source) too long. I'll apply them if it becomes an issue (it's not, yet). –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 09:40, 17 January 2014 (UTC)

You could move it to a sub-page referenced from the task page like what is done here: [[Formal_power_series#Java|Formal_power_series#Java]]. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:00, 17 January 2014 (UTC)