News for hackers. Stuff that matters.
Re:Discovering Dennis Ritchie’s Lost Dissertation by unixhero on Saturday June 20, 2020 @04:28AM (#23582617)
Except every non programmer with a business degree seem to love functional programming: Microsoft Excel
Re:Discovering Dennis Ritchie’s Lost Dissertation by dzdt on Saturday June 20, 2020 @06:58AM (#23583212)
Excel 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.

Re:Discovering Dennis Ritchie’s Lost Dissertation by u801e on Saturday June 20, 2020 @10:41AM (#23584202)
> 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.

Re:Discovering Dennis Ritchie’s Lost Dissertation by jcrawfordor on Saturday June 20, 2020 @11:37AM (#23584517)
You 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.
Re:Discovering Dennis Ritchie’s Lost Dissertation by inopinatus on Saturday June 20, 2020 @06:43PM (#23588046)
Being 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 :-)

Re:Discovering Dennis Ritchie’s Lost Dissertation by inopinatus on Saturday June 20, 2020 @04:37AM (#23582651)
I’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.

Re:Discovering Dennis Ritchie’s Lost Dissertation by vbezhenar on Saturday June 20, 2020 @08:54AM (#23583670)
Functional programming involves using functions as a first-class objects. I never saw that kind of programming in Excel.
Re:Discovering Dennis Ritchie’s Lost Dissertation by einpoklum on Saturday June 20, 2020 @06:19AM (#23583051)
Umm, doesn't Excel use Visual Basic (VBA) under the hood?
Re:Discovering Dennis Ritchie’s Lost Dissertation by dragonwriter on Saturday June 20, 2020 @06:36AM (#23583116)
No, AFAIK, VBA is just a scripting layer exposed by Excel, not what Excel uses itself.
Re:Discovering Dennis Ritchie’s Lost Dissertation by einpoklum on Saturday June 20, 2020 @01:07PM (#23585020)
What 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.
Re:Discovering Dennis Ritchie’s Lost Dissertation by dragonwriter on Sunday June 21, 2020 @02:19PM (#23594017)
> 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.)

Re:Discovering Dennis Ritchie’s Lost Dissertation by pjmlp on Saturday June 20, 2020 @06:49AM (#23583171)
Not at all, Excel can be scripted in multiple ways, VBA is just one among many.