Functional programming

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Henk
Posts: 5103
Joined: Mon May 27, 2013 8:31 am

Functional programming

Post by Henk » Mon Nov 06, 2017 2:44 pm

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: 6
Joined: Wed Jul 19, 2017 10:18 pm

Re: Functional programming

Post by Morten Lohne » Tue Nov 07, 2017 12:52 am

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

Henk
Posts: 5103
Joined: Mon May 27, 2013 8:31 am

Re: Functional programming

Post by Henk » Tue Nov 07, 2017 9:19 am

It's forbidden to do an assignment.

nionita
Posts: 153
Joined: Fri Oct 22, 2010 7:47 pm
Location: Austria

Re: Functional programming

Post by nionita » Tue Nov 07, 2017 9:26 am

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: 5103
Joined: Mon May 27, 2013 8:31 am

Re: Functional programming

Post by Henk » Sat Nov 11, 2017 12:15 pm

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.

Post Reply