Re: Is there a good way to handle multiple enemies who can effect each oth

Just in defense of closed unions, or algebraic data types as they are commonly reffered to in FP circles. I think the idea that
although I am not saying inheritance is an inherently bad method of data modelling, it certainly is unnecessary. and anything can be modelled using composition and ADTs instead.

also, personally I wouldn't consider having a lot of stuff needed to be defined in a single file to be a bad thing. I think the idea that having large files and having a lot of smaller files is good has come from Java and C#, where there it perhaps applies due to the everything is OOP paradigm, but it certainly doesn't generalize o programming.

also personally I really dont mind pattern matching a union type and having a large branching function for each case, since I can still navigate through it using indentNav easily and in my eperience it isn't difficult to work with. right now, I am primarily working with Elm and this is essentially how updates are handled inan Elm application. You have one big ADT representing all the messages that might be triggered in the application and then you have an update function that branches on that message union type and defines what happenes for each message variant. the code actually ends up being quite neat and organized.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : defender via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to