Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How about:

    def move_pos(x):
        if random() > 0.3:
            return x + 1
        return x

    def move_cars(positions):
        return map(move_pos, positions)
I do not believe that functional programming benefits from brevity, except at the top layer. Unfortunately, functional programmers often expand their equations which, having examined them thoroughly, they understand implicitly, but can give too much information to the reader all at once.

Though, I have to agree, the FP community really hasn't been able to demonstrate how to do it without losing efficiency, and yet many proponents claim we should abandon all other paradigms. All of these articles seem very biassed towards FP.

I enjoy functional programming, but I prefer to work in imperative languages where I have a choice between paradigms.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: