Functional programming

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Functional programming

Post by Henk »

You can do normal programming but you have to say sorry when doing an assignment unless you use a transaction.

Thinking about to use an immutable data structure to implement a hash table.
Probably will be slow I guess. One advantage is that it will be easier to reconstruct a bug.
Morten Lohne
Posts: 11
Joined: Thu Jul 20, 2017 12:18 am

Re: Functional programming

Post by Morten Lohne »

You can do normal programming but you have to say sorry when doing an assignment unless you use a transaction.
What?
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Functional programming

Post by Henk »

It's forbidden to do an assignment.
nionita
Posts: 175
Joined: Fri Oct 22, 2010 9:47 pm
Location: Austria

Re: Functional programming

Post by nionita »

You do not do assignments, you just name values. Like in mathematic.

But for a hash table you have the IO monad, where you can do what you want.

Still, the model is harder to implement in a mutable world (like the processors are), so the program is slower (see Barbarossa).
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Functional programming

Post by Henk »

Better only write small minimal programs. For they are saying object oriented programming is no good, Functional programming is no good. Test driven development is dead and behavior driven development is bad.

And who knows what they make you believe in the future.

By the way also inheritance makes no sense. For instance a circle is not a shape because rotating a circle makes no sense.

And a square is not a rectangle for having both width and height is redundant.