
3D engine entirely made of MS Excel formulae - samfisher83
https://www.gamasutra.com/blogs/CBel/20180213/308549/3D_engine_entirely_made_of_MS_Excel_formulae__Enjoy_this_Doomxls_file_.php
======
slacka
This reminds me of the 3D roller coaster simulator in Excel[1]. The difference
here is this was made for readability in mind and even works without macros.

[1]
[http://www.excelunusual.com/coaster/](http://www.excelunusual.com/coaster/)

~~~
globuous
I love how the suggested video at the end is "Introduction to pivot table"

anyway, that's absolutely insane. The 3D engine seems to be laggy, on the
video anyway, whereas this rollecoaster is pretty smooth !

~~~
helpfulTroll
Well, the roller coaster sim is wireframes only, which is always much easier
to compute. You’ll notice that the Doom clone has lighting and shaders, which,
however primitive, add complexity to the render.

It’s like the difference between text rendering versus decompressing JPEG
images. Both can pile up enough data to exhibit lag, but you get more bang for
your buck with the lighter data stream.

------
billrobertson42
Excel w/o vba is the ultimate in functional programming.

~~~
MrEldritch
You jest, but people really do underestimate Excel. Yes, it sucks - but there
is a reason that despite all its flaws, _people keep trying to use it for
things_. (And no, that reason is not "they're too stupid to learn how to
code")

And I'm not sure the things that make Excel so crappy could really be fixed
without sacrificing the things that make it such a flexible and useful tool.
For instance, adding the ability to recurse or iterate sanely would remove the
transparency of having every iteration of a computation clearly visualized
cell-by-copy-pasted-cell.

~~~
skriticos2
For me it usually is "I would like to use some sensible tools, but corporate
policy requires me to not do that (because they are not available) - so I have
to (ab)use Excel/Office/VBA to get things done." It's not pretty, stable,
efficient or really maintainable, but if you are forced to use a hammer..

ps. Excel does some things OK, like drawing pretty graphs on smallish datasets
and visualize quick analysis with pivot tables. It just lacks a sensible
scripting language and is generally very brittle once the data is getting
nontrivial and more than one person is involved.

~~~
sjy
I’ve been solving this problem with PowerShell for the last year or so. It’s
usually available on locked-down corporate Windows boxes, and you can use the
entire .NET Framework, as well as third-party .NET libraries, without admin
rights. I’m using it with System.Data.SQLite to build a WPF application at the
moment, which will hopefully replace a whole bunch of messy and hard-to-
maintain Excel sheets and Access databases.

~~~
eggy
I love PowerShell for this reason. I had a 100 CSV files, and I needed the
first two rows removed to put them into a signal viewing app, and it took only
a few lines of PowerShell to do this on my corporate machine. I would normally
do this in another PL, but strangely PowerShell's solution further pushed me
to look into it for other uses on that machine. I wish there were a good book
for this, since I actually prefer that than just Googling quick solutions when
trying to actually learn something.

~~~
rejschaap
I work in a Microsoft shop, but I always have a bash shell running. It
prevents me from really diving into PowerShell. I will end up running a quick
sed '2,3d' on the csv files and move on with my life.

~~~
eggy
I have PowerShell on my local company machine, and without Admin priveleges I
can't even sideload bash through a Git install. We're not a software company,
so requesting Git is also out of the standard operational procedures as a
user. IT knows my coding background (since 1978), but they can't change
policy.

------
freeflight
This feels like there's a joke, about Skyrim being ported to yet another
platform, hidden in there. Context [0]

[0] [https://www.wired.com/2012/01/skyrim-
calculator/](https://www.wired.com/2012/01/skyrim-calculator/)

------
kgrizzle
Reminds me of a related project presented at SIGBOVIK demonstrating the Turing
completeness of PowerPoint. It is also art.

[https://www.youtube.com/watch?v=uNjxe8ShM-8](https://www.youtube.com/watch?v=uNjxe8ShM-8)

------
thrower123
I'm surprised that Microsoft hasn't plugged the Roslyn .NET compiler into
Excel as a first-class scripting environment yet. LinqPad in Excel would be
miles better than VBA.

------
kaveh_h
Spreadsheets are pretty good for using when exploring the execution of an
algorithm or computation graph. You can basically book keep every step of an
execution.

Efficiencies or lack of it is visible in the spreadsheet in a very concrete
way. How many used cells are there, how many “steps” or rows is required to
finish a computation and how many times are cells addressed clearly relates to
time and space complexity of an algorithm.

------
oldandtired
Excel has been an interesting tool that has been abused by many different
people for many different subject areas, from petro-engineers to asset
management to budget forecasting to drug sales forecasting to activity
planning and on and on and on.

With a judicious use of vba, many of the tasks above, especially those related
to forecasting, planning and reporting can be automated down from hours to
just seconds. I have seen inordinate amount of hours wasted by people using
excel to do all sorts of tasks that were repetitive to the max. A thinking
programmer can work with such people to change those tasks from being hugely
manual to simply automatic.

Mind you, the vba that has been written by non-programmers is usually so bad
that you don't want to even try to attempt to change or fix it. It is far
better to just start from scratch.

It is a tool that can be used in quite novel ways, but it does have its
gotchas that will cause interesting failures for businesses that rely on it.
But when it is the only tool you have, then you use it any way you can.

~~~
sebazzz
What we have often seen in the business, is that Excel gives a flexibility and
freedom that purpose-built tools often don't have. Want a extra field? Done.
Field need to have a date larger then xx-xx-xxxx? Done. Even if the purpose-
built tool has some kind of custom field system that accomodates these wishes,
there always will be some feature the developers need to build. And that costs
more turnaround time (and money) then doing it yourself.

~~~
oldandtired
That is certainly something that I have seen as well. The problem lies in
validating the spreadsheets. Often, the amount of validation is minimal,
whether that is the actual formulae used or the relationships that bare
created or even the data that is used.

I have seen some outstanding examples of well written spreadsheets but these
tend to be the minority case. Depending on the organisation and the priority
it puts on validation, the spreadsheets can range in quality from vry poor to
mediocre.

I have seen critical spreadsheets that were a disaster of coding.

Many times, the IT costs for getting the IT developers to do the work for you
is so far above what it costs for you to do it yourself or even to get a
developer in specifically to work for you, outside of any controls that your
IT group would exert. Plenty of the work I have done in the last 20 years was
based on the end-user employing me to do the work taht was not cost effective
or even allowed for by the company IT teams.

~~~
rightbyte
Is validation a problem? You see the intermediate steps of calculation in the
columns. It's way more clear then black-box unit testing. It's like some nice
live debugging with print statements everywhere.

~~~
oldandtired
Validation is always a problem. In one early example, I came across, the core
data on which the model did not match what was really there. The data was
assumed to be correct and, of course, nobody actually did the checking. The
previous year's data was used for the following year's calculations.

I knew the data for the spreadsheet was wrong only because I had been involved
in looking at the actual data sources in weeks previously.

But there can also be formulae errors. They seem to produce the correct
information, but they will have subtle errors that miss necessary edge cases
or use set values when they shouldn't.

------
bazooka2th
"Ok, we're definitively in hell" \- C Bel, 2018. This is amazing, computation
in Excel is becoming a solid meme.

I've got to ask (and I hope this isn't non-PC or some such), but is English
the author's first language? Where's he from?

I wish that I had Excel so that I could try it out! :) More about the choice
of random digits, sin x + cos x, would be nice to read.

~~~
rustcharm
I love Excel, and to show how it really is "better" notice nobody does these
things in the FOSS spreadsheet wannabees...

~~~
laumars
I'm not going to argue that one spreadsheet solution is "better" than another
as that is really a question of personal preference. However it should be
noted that people do actually do these sorts of demos in other programs as
well. And not just FOSS solutions but ive seen people do fanciful stuff in
Google Docs too.

------
chris_wot
I should open this in LibreOffice :-)

Actually, I’ve been wondering how to create a comprehensive spreadsheet that
tests all of Excel’s features. Kind of like an ACID3 for spreadsheets...

~~~
slacka
Yes it actually works quite well as long as you use the 1st, macro version.

If you have LibreOffice installed, it takes less time to actually try it, than
to post a comment.

~~~
chris_wot
A bit snarky of you, given I didn't actually ask a question. Did you notice
the bit where I mentioned an ACID3 style document?

I'm in the commit logs of LibreOffice, incidentally.

------
songnameq
Side note but what is the music with the video? I liked it

~~~
godelski
Dance Macabre
[https://www.youtube.com/watch?v=YyknBTm_YyM](https://www.youtube.com/watch?v=YyknBTm_YyM)

------
kerng
Does that also work in the online Excel app? That would be a neat abstaction
layer for running crazy cool Excel apps/games in the browser. Lol

------
exabrial
Anyone created a RESTful framework for excel yet? Maybe a package management
tool as well?

~~~
chrsstrm
I wrote this [0] little quick and dirty snippet to enable a Google Sheet as a
JSON data source via GET requests. Unfortunately Google App Scripts only
accept GET and POST requests [1] so it wouldn't be semantically RESTful, but
adding update and delete features in the script are trivial if you send an
action param along with your POST.

Using that data source snippet I wrote a 'static' CMS that pulls the JSON data
from sheets in the workbook and then compiles and deploys a Jekyll site. I've
been enthusiastically replacing WordPress sites with this wherever possible
when clients only need data to change and don't require actual page editing
(this system is perfect for restaurants - think menu changes). The "deploy"
event is a little convoluted since I wanted to control what happens and when
it happens, but it is all kicked off by submitting a Google Form which is
attached to the Sheet.

The script as-is returns one object per row but converting it to key/value
responses is also pretty easy. If Office365 has an equivalent to Google App
Scripts that can publish a script as a web app, I'd love to hear about it.

[0]
[https://gist.github.com/chrsstrm/3fb0ce6820acecf62c5490d220d...](https://gist.github.com/chrsstrm/3fb0ce6820acecf62c5490d220d4ec5f)

[1] [https://developers.google.com/apps-
script/guides/web](https://developers.google.com/apps-script/guides/web)

------
mesozoic
Someone was reaaaallly really bored at work.

------
foxX
God save us all! The finance people are becoming hackers (or whatever it is
that finance people turn into once they go hackers)! Doomed.

~~~
iamdave
_or whatever it is that finance people turn into once they go hackers_

Payroll analysts

~~~
tomrod
Economists and data scientists.

/waves

~~~
iamdave
ANECDOTE TIME! And actually a career related question:

I'm an absolute nerd for sports stats, and have a friend that moved out of the
finance/BI world in the hospitality sector and landed herself an impressive
gig at ESPN-of all things, as a stats editor.

It seems a relevant jaunt (because all I know of her profession is that she's
an incredible mathematician) but the gap seems wide just from a perspective of
domain knowledge; she openly states not caring at all for sports but the new
job location puts her close to family.

My question is: is Data Science so applied that one can make that kind of jump
domains easily? This gal is one of the smartest people I know but the more I
look into what it is you folks do, the more I am simultaneously intimidated
yet interested in the field.

~~~
tomrod
Domain knowledge is always useful. But can also introduce biases in one's
analysis.

For these types of professional roles you generally see specialized teams in
three broad groups: data engineers, modelers/analysts, domain experts.
Unicorns sometimes exist, but usually you see T-type experience with depth in
one of the three.

------
anticensor
Wrong tool for duty. Arc might be more suitable.

------
wiz21c
A bit off topic, but Excel has many dangerous features. Is there a spreadsheet
that is safe to use ? I just know about gnumeric and LO's calc, but I don't
know how goo they are (I rarely use spreadsheets, most of the time to draw
simple curves)

~~~
Jonnax
Could you explain what the dangerous features are?

~~~
adiusmus
Dangerous is mostly the spaghetti business logic that results when excel
spreadsheets get scaled up into _systems_.

“Dangerous” in lighter ways:
[https://m.youtube.com/watch?v=-gYb5GUs0dM](https://m.youtube.com/watch?v=-gYb5GUs0dM)

Nostalgia requires this... [https://www.smore.com/clippy-
js](https://www.smore.com/clippy-js)

~~~
adiusmus
To those that think spreadsheets can’t be dangerous:
[https://www.cnbc.com/id/100923538](https://www.cnbc.com/id/100923538)

From that link: “Spreadsheet errors are costing businesses billions of pounds,
according to a financial modeling company, which is calling for the
introduction of industry-wide standards to reduce the risk of mistakes.

F1F9 estimated that 88 percent of all spreadsheets have errors in them, while
50 percent of spreadsheets used by large companies have material defects. The
company said the mistakes are not just costly in terms of time and money - but
also lead to damaged reputations, lost jobs and disrupted careers.”

