3 ms·
I think my comment is going to be that, from reading the parent, I understand that functional programming moves the code to the data and not the data through th
by chris_mahan 12y ago
I think my comment is going to be that, from reading the parent, I understand that functional programming moves the code to the data and not the data through the code.
I can't do the mental gymnastics to think about the code that way.
When I think about the purpose of the code, the result of the code, before the code has been written, I do this by "compiling and running" in my head. Of course, there's no actual compiling. There's just thinking.
When I reason about the code, either code I'm going to write, code I wrote, or code other people wrote, I execute the code in my head.
I'm currently building a web-scraping system, to look information on partner web site. I'm using python 3, selenium, pyodbc to sql server. I'm also developing the same in C# (3.5) using the webbrowser component in systems.forms. It's got a lot of moving parts, lots of languages involved. I read the documentation for the tools, then I assemble in my head, essentially "running the code" in my head, and then, once all the edge cases are dealt with (are there iframes, popups, ajax async calls, flash and pdfs) then I design on paper, with boxes, and then, later, later, if it all works in my head, then I code it.
Can't do that if I can't reason in my head about what the program is going to do, exactly.
Functional Programming, for me, does not fit in my mental model, so I can't use it, regardless of actual implementation.
- SotallyTober 12y agoThis is partially because you're shoe horning functional ideas into an imperative language. When you have no choice but to use maps and folds you quickly build up mental models of how to do what you normally do with for loops: accumulate (fold), transform (map), or generate (zipWith).
- innguest 12y agoThe problem with your approach is it produces this mess: http://qt-project.org/doc/qt-4.8/widgets-analogclock.html http://qt-project.org/doc/qt-4.8/widgets-analogclock.html When you could instead say just what you mean in functional programming: http://elm-lang.org/edit/examples/Intermediate/Clock.elm http://elm-lang.org/edit/examples/Intermediate/Clock.elm The most important skill for a programmer is to be able to learn new things. Especially when they're there to help you.