
The Joy of Coding: Observable - jashkenas
https://www.software-artist.com/joy-of-coding-observable/
======
timkam
I find it a bit strange that the post lists both LISP and Python as "truly
elegant software system[s]". To me Python is a super-pragmatic language that
sacrifices intellectual elegance to allow people (even, but not necessarily)
without a CS/Math background to "get stuff done". I also wonder how software
"artists" should be different from other artists. For example, in music, there
are great teams of artists, like Lennon/McCartney.

~~~
pjc50
As far as I can tell "Elegant" means "I like it, and believe that my aesthetic
preferences are a universal law of humanity"

~~~
flir
Nah, there's a property of elegance that appears similar in mechanical
engineering, typography, maths, poetry and a bunch of other places. I don't
know exactly what it is, but I think it maps closely to "the minimum number of
moving parts necessary to complete the task"

~~~
Proziam
Somewhat similar, I always thought of elegance as the minimum complexity
required. However, truly elegant solutions are sometimes counter-intuitive or
'hidden' beneath a few layers of detail, but once understood _feel_ "obvious."
That "oh man that's _smooth_ " feeling is often the first step for me to think
of something as elegant, and separates 'good solutions' from truly elegant
ones.

------
tartoran
This is a real gem: [https://www.darworms.com/](https://www.darworms.com/)

------
goofballlogic
"an engineer codes what someone else thinks they want" seems a fairly damning
indictment of our industry although I think the author meant it tongue-in-
cheek.

Lack of ownership of responsibility is still quite a big roadblock for many
companies.

~~~
tonyedgecombe
All the while I was consulting I never met a client who knew what they needed
until you started putting something in front of them.

Some of them had already produced detailed requirements documents but those
documents never really represented the reality.

~~~
WorldMaker
The industry is also full of so many stories of a developer trying to say
"Thinking ahead, I don't think you want X because it won't do what you really
want which is Y", getting nothing but "Just do X, that's what we researched
and PMed into all these requirements documents" to only be followed by
complaints of "Why doesn't this do Y? That's what we really need." when
presented with "finished" software based on the requirements.

------
sped
Does anybody know where to sign up to the 'Monday Morning Tickler' as
mentioned in the post?

~~~
Chris2048
from his blog:

    
    
        If you would like to receive a weekly puzzle from me - called the Monday Morning Tickler - all you gotta do is send a request to:
    
        rj@mical.org (RJ Mical)

------
jashkenas
Here’s a direct link to the Tickler Puzzle Four of a Kind notebook discussed
within: [https://observablehq.com/@dmaynard/tickler-puzzle-four-
of-a-...](https://observablehq.com/@dmaynard/tickler-puzzle-four-of-a-kind)

------
azangru
There must be something wrong with me, but I don't get the Observable (the
fact that its name is the same as that of a primitive in functional reactive
programming, as in rxjs, with which it has nothing to do, doesn't help
either).

Observable seems to be a cross between Jupiter notebooks and plain old
javascript, but sufficienly different from either to feel uncannily bizarre.
Those imports in the bottom of a notebook! And I am still not sure whether it
has access to the whole node_modules ecosystem or not (since it has to run in
the browser and doesn't seem to involve a transpiler). I remember looking at
some notebooks that involved React and thinking to myself that they felt plain
wrong.

~~~
mourner
That's pretty unfair. Once you spend a little time to understand its concepts,
it becomes second nature, and it's really a joy to use.

The fact you can reorder cells in any way you want (and import cells from
other notebooks) is the whole point — this way you can build narratives with
code, embedding important bits in the story while leaving out fluff like
imports at the bottom. Maybe you just haven't seen notebooks that take good
advantage of this, but I'll shamelessly plug mine as an example:
[https://observablehq.com/@mourner/martin-real-time-rtin-
terr...](https://observablehq.com/@mourner/martin-real-time-rtin-terrain-mesh)

You do have access to nearly the whole NPM ecosystem. Most useful packages
either provide a browser build in their package (which gets picked up
automatically), or you can use [https://bundle.run/](https://bundle.run/) to
produce a browser bundle for any Node package.

------
elwell
here's a js brute-force for question 1 and 3:

    
    
        const cards = [...Array(13).keys()];
        const standardDeck = Array(4).fill().reduce((acc, v) => {
          return acc.concat(cards);
        }, []);
        
        const makeShuffledDeck = () => {
          const deckInst = standardDeck.slice();
          const shuffledDeck = [];
          while (deckInst.length) {
            const removeIdx = Math.floor(Math.random() * deckInst.length);
            shuffledDeck.push(deckInst[removeIdx]);
            deckInst.splice(removeIdx, 1);
          }
          
          return shuffledDeck;
        };
        
        const numDrawsNeeded = () => {
          const counts = Array(13).fill(0);
          const deck = makeShuffledDeck();
          
          while (deck.length) {
            const card = deck.pop()
            if (++counts[card] === 4) {
              return standardDeck.length - deck.length;
            }
          }
          
          throw "Drew all cards, but never found 4 of a kind.";
        };
    
        // average
        const numTrials = 10000;
        console.log([...Array(numTrials)].map(numDrawsNeeded).reduce((acc, v) => {
          return acc + v;
        }, 0) / numTrials);
        
        /*
        // max
        const numTrials = 10000;
        console.log([...Array(numTrials)].map(numDrawsNeeded).reduce((acc, v) => {
          return Math.max(acc, v);
        }, 0));
        */

------
lalaland1125
In case anyone's interested,
[https://colab.research.google.com/drive/1unwERXC1CWvAXpVs9Ue...](https://colab.research.google.com/drive/1unwERXC1CWvAXpVs9UenduVr44NhDQFB)
contains the exact answer (via a very simple brute force mechanism of simply
trying every possibility).

------
jtth
Wait till you try out Mathematica!

------
davidjnelson
This is great. Reminds me of Bret Victor’s work.

------
lincpa
Every step is observable in [The Pure Function Pipeline Data
Flow]([https://github.com/linpengcheng/PurefunctionPipelineDataflow](https://github.com/linpengcheng/PurefunctionPipelineDataflow))

------
jppope
love the blog!

------
robotron
Doesn't work in FF mobile...

------
BubRoss
This article (starting with its nonsense title and domain) gets bogged down in
pretentious philosophy instead of focusing on what this actually does.

"magic notebook" "thinking with code" "visionary software artist"

It's a javascript notebook by the way

~~~
gield
I was looking for a list of the Maynard's laws mentioned in the article. Turns
out the author is called Maynard and he just made them up on the spot.

~~~
breck
When you have a resume like this [https://www.software-
artist.com/me/](https://www.software-artist.com/me/) you can make up any laws
you want as far as I am concerned.

He worked for Engelbart! Worked on ARPANet! Was sending email in 1975! And is
still coding! What an inspiration. Very cool blog.

~~~
pfarrell
I too read his bio and thought the same thing. As I read it, it reminded me of
“The Music Scholar” routine by Scharpling and Wurster [0], where a radio
caller personally witnessed like the entire history of ‘70’s rock.

Engelbart, Xerox Parc, EA, Silicon Graphics, and Google Maps? Yeah, he can
call out his own laws.

0: [https://youtu.be/Z75qsaak9Po](https://youtu.be/Z75qsaak9Po)

