5 ms·
> Imperative programming is the most natural thing for people. "Do this, then that, then that, in that order." No way. Have you ever mentored technical people
by otabdeveloper4 7y ago
> Imperative programming is the most natural thing for people. "Do this, then that, then that, in that order."
No way. Have you ever mentored technical people who aren't specifically trained programmers by education?
These kinds of people will have no problem writing huge SQL queries with joins nested four levels deep, or pages and pages of declarative Pandas or R code using weird transformation and filter logic, but they'll have humongous problems understanding simple loops or variable assignment.
Another data point to consider: Excel is the most popular programming environment in the world, and it's also declarative, not imperative.
- cousin_it 7y agoYes, Excel and SQL are widely used by non-programmers due to some engineering quality. But whatever that quality is, Haskell (very narrowly used even by programmers) doesn't seem to share it.
- otabdeveloper4 7y agoI'm trying to say that whatever makes Haskell unpopular, it's not its declarative nature. Whoever manages to make a purely declarative general-purpose programming language will be a technological superstar, because for normal non-programmer folks it would be the ideal gateway to programming. (That said, I don't think it's possible. 'General purpose' implies some sort of Turing completeness, i.e., recursion or loops, which immediately makes it impossible to reason about in normal declarative terms.)
- pjc50 7y agoYou would have to add some kind of statefulness, which I suspect is the thing that those people are having trouble reasoning about (and which is also an argument for making things immutable even in imperative languages!). "Statecharts"? Some other kind of boxes-and-arrows Moore/Mealy machine visualisation?
- wwright 7y agoI think we can be a little more optimistic than that. I agree that it’s probably a white whale to try to build a language which is fully declarative 100% of the time, but if we can make something that is simple and declarative 80% of the time, but falls back to something as graceful as Python for the other 20%, that may be enough to have a really big impact.
- goto11 7y agoNon sequitur. Excel shows that declarative systems can be popular and easily accessible by non-programmers. Not that any declarative system will automatically be popular! It is an interesting observation that declarative logic apparently is more intuitive to non-programmers than it is to programmers trained in imperative programming.
- pjc50 7y ago> These kinds of people will have no problem writing huge SQL queries with joins nested four levels deep, or pages and pages of declarative Pandas or R code using weird transformation and filter logic, but they'll have humongous problems understanding simple loops or variable assignment. I think that comes from their mathematics background. I'd like to wheel out the "left handed scissors" argument again; the large and persistent arguments over what is most intuitive should be taken as evidence that different people find different things intuitive or comfortable. Which is more natural to use, a symmetrical mouse or one with a slight bend to it in a comma shape to more closely fit being held in the right hand? What happens when a left handed person picks it up?
- nephrite 7y agoExcel works around IO problem by not having IO. User enters data into cells and the program works on them "not knowing" how the data got there.