I just completed "Rain Risk" - Day 12 - Advent of Code 2020 https://t.co/0wRPluJVeL #AdventOfCode

Today I learned that I really need coffee ☕️ to operate properly. Made a trivial mistake and it took me forever to catch it. This would have been obv. with a statically typed lang.

Also, I'm using a notebook-style env. to play (like https://t.co/JgFUNSSRuD, here it's https://t.co/XrswSxjjwk). My take away from this fun experience + observations at work is that such notebooks are poison to the mind, fostering bad practices while not bringing much value.
I get that notebooks provide a nice environment for tutorials - you get a literate programming + a printf-debugger on steroids, which is very useful when suffering through tensor shape mismatch errors. It's useful for data science or ML 101.
But then I see people using Python notebooks to do actual work and it's horrifying to me. The natural tendency is to write notebooks as a series of cells mutating global state. So each cell has an implicit API defined by its interaction with the global state. 2/9
The API is implicitly a function of cell exec order, but then you can purposely (or mistakenly) exec cells in any order 😬. And this is on top of the usual issues you get with dynamically typed languages. No one can write maintainable code this way, but notebooks get a pass. 3/9
Of course, it's possibly to organize a notebook in a proper way, to implement unit tests etc. But this pretty much kill the appeal of using notebooks in the first place. As a result I'd guess lots of workbooks that are still used for serious work are a quagmire of tech debt. 4/9
Even during a 30' coding session, you can feel the nefarious effect of notebooks. You spot a bug in a cell and fix it. Are you going to click the "Run" button just next to your fix and resume your work immediately, or click on "Runtime > Run before" and possibly wait a while? 5/9
In the midst of an idea it's hard to resist click on "Run" right there, esp. if running from the top takes long minutes. So you just mutate some global state (at least some function def) and manually follow downstream dependencies. Of course this will go wrong at some point. 6/9
For instance, you could have missed some dependency and the global state is now inconsistent, yet you keep going forward with your idea. At one point you'll realize your mistake but the harm is done, a bunch of cells are now breaking the implicit global cell + exec order API. 7/9
So not only notebooks foster bad coding practices, but they actually don't make the coding experience much more simple or reliable. The gateway drug of manually running a few cells and getting nice visualization of the output quickly devolves into an horrible mess. 8/9
So I guess the TL;DR is: don't let friends use Jupyter or Colab notebooks. They are bad for the mind and bad for the code. Also, get off my lawn🧓. FIN 9/9

More from Internet

Well, this should be a depressing read -- notably because the UK and the US are both terrible when it comes to data protection, but the UK appears to be getting a pass. So much for 'adequacy'.


A few initial thoughts on the Draft Decision on UK Adequacy: https://t.co/ncAqc93UFm

The decision goes into great detail about the state of the UK surveillance system, and notably, "bulk acquisition" of data, and I think I get their argument. /1

For one, while the UK allows similar "bulk powers," it differs from the US regime both in terms of proportionality, oversight, and even notice. Some of this came about after the Privacy International case in 2019 (Privacy International) v Investigatory
Powers Tribunal [2019]) /2

Whereas, other bits were already baked in by virtue of the fact that the Human Rights Act is a thing (This concept doesn't exist in the US; rather we hand-wave about the Constitution and Bill of Rights, and then selectively apply it) /3

For example, UK bulk surveillance (I'm keeping this broad, but the draft policy breaksk it down), substantially limits collection to three agencies: MI5, MI6, and GHCQ). By contrast, it's a bit of a free-for-all in the US, where varying policies /4

You May Also Like