5 ms·
Except every non programmer with a business degree seem to love functional programming: Microsoft Excel
by unixhero 6y ago
Except every non programmer with a business degree seem to love functional programming: Microsoft Excel
- inopinatus 6y agoI’ve heard this before, but long felt it is more like logic programming: you declare facts and relationships, then an evaluation engine finds results. Not saying you can’t, say, pass around closures in Excel but it’s far from natural. Whilst spreadsheets always remind me, more than anything, of the Prolog I took in college, and not the Lisp or ML.
- einpoklum 6y agoUmm, doesn't Excel use Visual Basic (VBA) under the hood?
- dragonwriter 6y agoNo, AFAIK, VBA is just a scripting layer exposed by Excel, not what Excel uses itself.
- einpoklum 6y agoWhat do you mean by "using itself"? When you write a function in an Excel cell, IIANM it's a VBA function. Excel is implemented in C++ IIRC.
- dragonwriter 6y ago> When you write a function in an Excel cell, IIANM it's a VBA function No, its uses the Excel formula language, which isn't the same as VBA (nor is it a subset of VBA; Excel formula language expressions generally aren't valid VBA.)
- pjmlp 6y agoNot at all, Excel can be scripted in multiple ways, VBA is just one among many.
- dzdt 6y agoExcel is at its core a declarative programming language. Entering formulas in cells that reference other cells declares the relationship of the calculated cells to its referents. It is not an imperative language: the user does not tell the computer which order in which to carry out computations. It is not procedural: there is no notion writing of procedures within its cells. It is not functional: while there are built-in functions users cannot write their own in the same way.
- u801e 6y ago> while there are built-in functions users cannot write their own in the same way. It's been a while since I've used Excel, but I thought you could write custom methods using VBA that could be called in a given cell.
- jcrawfordor 6y agoYou can indeed, but VBA is of course imperative, and VBA is used in part because it is difficult to read/write and considered a poor practice to have any significant chaining of functions in the spreadsheet. The bigger reason it is used, of course, is because Excel's declarative environment does not accommodate all behaviors and users prefer to implement them imperatively. So this sort of reinforces Excel as not being a functional environment.
- inopinatus 6y agoBeing able to write functions doesn’t make a language functional. The hallmark of functional programming is closures as first-class objects, passed as arguments or returned from other functions. The nearest Excel equivalent would be constructing a formula string for later evaluation, which is far from the same thing. If you wanted to perform lambda calculus in Excel you’d end up implementing your own functional programming language in VBA. Have fun with that :-)
- vbezhenar 6y agoFunctional programming involves using functions as a first-class objects. I never saw that kind of programming in Excel.