4 ms·
Because prolog requires a different mindset. When I encountered prolog I tried to understand it, and on the assigment -something about stacking dice having sam
by JaumeGreen 8y ago
Because prolog requires a different mindset.
When I encountered prolog I tried to understand it, and on the assigment -something about stacking dice having same or different values on the faces, I don't recall it- I managed to write prolog with explicit backtracking. That means that I had several "functions" with different fixed parameters that where the recursion level where they were at, and like a hundred lines of code for this assigment.
TA called us in, trying to understant that, we explained and he showed us the "real" solution, in a handful of lines of code. Then it clicked, I understood it.
Without that moment I would find prolog too alien, and I guess most people do, that's why it isn't more present in the world. It's too different to "actual programming", that is, it's too different from imperative programming. Even haskell and the like are closer to python and the like than prolog. Heck, even lisp can be closer to them.
It's not just learning a new programming language, it's learning a new way to think, not everyone can do that.
- SolaceQuantum 8y agoThe most effective way prolog has been taught to me in the form of logic puzzles that we are all familiar with- "We have 6 people who work 1 job each, here a list of possible jobs, there is a list of possible people, the cook is male, the doctor went golfing with the cook on friday, joshua doesn't golf..." After that, you move to programming checking validation of facts and finally to behavior that resembles 'normal' programming. I agree that it's a massively different mindset and the capacity to grasp prolog quickly or be interested in prolog programming should be considered a reflection of the adaptability/curiosity of a person, IMHO.
- hcarvalhoalves 8y agoProlog tends to "click" once you understand it's a query language for relations, rather than a general programming language (although you can do a lot on top of it you bend it just enough).