Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×
User Journal

Journal ansible's Journal: Functional Programming and Abstracting Time

This recently became clear to me. With functional programming (FP), you are, in effect, trying to abstract out time as much as possible.

Non-FP languages let you abstract out concepts. You don't worry about sending SYN packets, you just start communication with socket(). You don't worry about the details of how directory entries are stored, you just run 'ls' or 'dir'.

But non-FP languages don't let you abstract out time. By that I mean you (as the programmer) always have to be conscious of (and make decisions about) sequence.

However, if this is a detail that the tools (like the compiler) can take care of for you, shouldn't you let it? It can generate better and more accurate assembly code than I can, so why don't I let it worry about sequence too, when it is able to manage the details correctly.

I am starting to like lazy evaluation and Haskell. More on this later.

This discussion has been archived. No new comments can be posted.

Functional Programming and Abstracting Time

Comments Filter:

Machines have less problems. I'd like to be a machine. -- Andy Warhol

Working...