6 Replies - 2457 Views - Last Post: 07 June 2012 - 09:14 PM Rate Topic: -----

#1 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Functional Programming In Game Development

Posted 05 June 2012 - 02:59 PM

To start this off, I'm very biased. I'm coming from a Java (and a tiny bit of both C++ and C#) background, but I've been really interested in functional programming now-a-days. I was thinking what better way to learn about functional programming than with doing what I love: making video games.

I'm at the point in programming where I've borderline mastered OO practices, yet I'm a baby when it comes to anything else, really.


To get to the point, what are you opinions on functional programming for game development.
Do you think it's possible?
Do you think it's worth it?

Any personal suggestions for how I should start?


Thank you!
~Crockeo

Is This A Good Question/Topic? 0
  • +

Replies To: Functional Programming In Game Development

#2 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Functional Programming In Game Development

Posted 06 June 2012 - 05:35 AM

It is interesting to look at stuff like this and it's got to be a good idea to broaden your horizons with different techniques and languages. I think game programming just lends itself so well to OO style programming due to it being easier to visualize game entities as objects and also how they can relate to each other through inheritance.

I have read places that functional programming can create performance overhead but how this differs from the inherent overhead in using OO principles such as virtual functions I do not know. I guess it would be good to have a go yourself and see how it goes, would be good to see how you get on with it.

I saw this video and thought it was pretty cool, thought i'd share it.


Was This Post Helpful? 1
  • +
  • -

#3 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Functional Programming In Game Development

Posted 06 June 2012 - 02:25 PM

Alright, sounds good!

I suppose I'll raise this thread from the dead so I can share my experiences, and suggest either to or not to use functional programming with game programming.
Was This Post Helpful? 0
  • +
  • -

#4 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Functional Programming In Game Development

Posted 06 June 2012 - 08:52 PM

Update:
I ended up choosing Racket (formerly PTL Scheme) as my language of choice for a couple of reasons.

1) Still has some OO
2) Has graphics bindings
3) Seems to keep the OO to a minimum, and it keeps itself very functional
Was This Post Helpful? 0
  • +
  • -

#5 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Functional Programming In Game Development

Posted 07 June 2012 - 02:20 AM

Wouldn't it be better to choose a purely functional language? Racket is a multi-paradigm programming language, aren't you concerned you will fall back on OO methods rather than exploring the functional side of things?

Just my 2 cents :)
Was This Post Helpful? 0
  • +
  • -

#6 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Functional Programming In Game Development

Posted 07 June 2012 - 12:31 PM

I suppose so :/

Haskell then? :P
Was This Post Helpful? 0
  • +
  • -

#7 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Functional Programming In Game Development

Posted 07 June 2012 - 09:14 PM

I am having a really hard time trying to fathom why, because you like games and functional programming, you would wish to write a game using a functional language. It's almost beyond reason for me. Here is why.

Every game is little more than a massive state machine, now with functional languages 'states' are not represented well. This is going to be a huge problem for you. I personally think trying to program a game using a functional language is a bad idea.

If you like functional languages do stuff that suites them, if you want to write games do the OO stuff that will be necessary at some point to clearly define objects and their characteristics in your game.

Can't see why you can't appreciate both separately.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1