Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSimonForsman

Posted 10 August 2012 - 07:18 PM

Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.


Functional programming can be applied to games and a function can return state and take state as input, it just can't modify or store state, you will need a small imperative portion (the game loop really) but for everything else you can use functional programming.

Functional programming has alot of advantages, one of the major ones for games being that since pure functions always lack side effects (no state) it is relativly easy to write parallel code when you use a functional approach . I don't think functional languages really have a place in games but functional programming does and it is far easier to learn how to do functional programming if you use a language that slaps in you the face when you try to write imperative code. (There are disadvantages aswell ofcourse).

#1SimonForsman

Posted 10 August 2012 - 06:59 PM

Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.


Functional programming can be applied to games and a function can return state and take state as input, it just can't modify or store state, you will need a small imperative portion (the game loop really) but for everything else you can use functional programming.

Functional programming has alot of advantages, one of the major ones for games being that since pure functions always lack side effects (no state) it is relativly easy to write parallel code when you use a functional approach . I don't think functional languages really have a place in games but functional programming does and it is far easier to learn how to do functional programming if you use a language that slaps in you the face when you try to write imperative code.

PARTNERS