Harmless Enigma
“I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth.”
― Umberto Eco, Foucault’s Pendulum
Chenna Kautilya | Makes Robots Move
“I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth.”
― Umberto Eco, Foucault’s Pendulum
In this Knuth differs from Einstein, who famously said, “Everything should be made as simple as possible, but no simpler.” (Well, sort of. In On the Method of Theoretical Physics (1933) he wrote: “[T]he supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience.”) Knuth, on the other hand, says that you should make things simpler than possible, at least at first, because that’s the best way to plant the seed of understanding.
This post resonated with me. The past few years of building software, made me realize, building the simplest version helps validate ideas faster.
Along similar lines, On the product side, I was recently introduced to the concept of building a skateboard vs car. This concept helps wittle down scope creep and build the minimal version of a product
If you are using python’s subprocess.Popen
with any of stdout/stderr as pipes, you need to regularly clear the output of those pipes else, python the command will be blocked silently. The default limit on this buffer is from system which you can read using io.DEFAULT_BUFFER_SIZE
. You can increase this by setting your own value through bufsize
param.
References
Often when I am debugging python code, I like to sprinkle around breakpoint()
to quickly evaluate statements or print values. By default, breakpoint()
drops you into python pdb repl. Python pdb is great but it lacks snazzy features like multi line editing, history, syntax highlighting and autocomplete.
I recently found that you can override the default repl that breakpoint()
executes by setting the environment variable PYTHONBREAKPOINT
.
To setup python breakpoint to use ipdb, add export PYTHONBREAKPOINT="ipdb.set_trace
to your .bashrc
or .zshrc
.