News for hackers. Stuff that matters.
Re:A brief interview with Tcl creator John Ousterhout by zakirullin on Saturday July 20, 2024 @01:52PM (#41018273)
He is an absolutely amazing and extremely humble person. He agreed to review my article (written under the influence of his book) in his spare time. He does tons of code reviews every week for his students as well.

I was especially impressed by his notion of "deep modules" in "A Philosophy of Software Design". The idea is extremely not-popular, but really sound and practical. I would definitely go for this book instead of "Clean Code" and such.

His book is so fundamental, and it goes far beyond the overused and vague "complexity" term.

Re:A brief interview with Tcl creator John Ousterhout by skrebbel on Saturday July 20, 2024 @02:09PM (#41018395)
Any tldr for “deep modules”?
Re:A brief interview with Tcl creator John Ousterhout by zakirullin on Saturday July 20, 2024 @02:16PM (#41018446)
Deep module - simple interface, complex functionality

Shallow module - interface is relatively complex to the small functionality it provides. Shallow modules don't hide as much complexity.

https://github.com/zakirullin/cognitive-load?#too-many-small...

But I highly recommend picking up the book :) It is an enjoyable read.

Re:A brief interview with Tcl creator John Ousterhout by Scarblac on Saturday July 20, 2024 @03:04PM (#41018841)
IIRC, the deep/shallow thing is anout how much functionality there is, and he used wide/narrow for the size of the API?

So that the goal is to have deep, narrow modules: modules that have a lot of functionality hidden behibd a small API.

Re:A brief interview with Tcl creator John Ousterhout by v9v on Saturday July 20, 2024 @03:52PM (#41019226)
I think a good example of this concept is the foreach command in Tcl: It's quite flexible compared to list iteration constructs found in most languages.

This is normal usage:

  foreach x {1 2} {puts $x} => 1 2
You can iterate over two lists at once:

  foreach x {1 2} y {3 4} {puts $x $y} => 1 3 2 4
Instead of reading one element from the list, you can read multiple:

  foreach {x1 x2} {1 2 3 4} y {5 6} {puts $x1 $x2 $y} => 1 2 5 3 4 6
If any of the lists happen to run out before the others, instead of complaining it just returns empty elements.

Many commands in Tcl give the impression that they can be used in many different ways, so writing a program in Tcl feels like building a structure by creatively assembling a limited set of legos.

Re:A brief interview with Tcl creator John Ousterhout by runlaszlorun on Saturday July 20, 2024 @06:31PM (#41020619)
Aha, I’d known some of the superpowers of TCL’s foreach but not all of those.

A ‘deep command’.

Re:A brief interview with Tcl creator John Ousterhout by devnonymous on Saturday July 20, 2024 @05:06PM (#41019916)
This google talk https://youtu.be/bmSAYlu0NcY?si=yHREamFoRG_fZopl is a condensed version of the (already small - 150 pags IIRC) book. I highly recommend both.

To the point made by the GP (and others here) about how useful the book is, I must add that I got a whole lot more from this small book than some other well known and oft suggested titles (like Clean Code, POSA etc).

My most recent peeve about the matter is that Kent Beck"s "Tidy, Fisrt?" was apparently motivated partly in response to this book and yet it falls way too short to matching up. Half of thst book is way too simplistic and almost patronizing and the other is handwavy abstract notions too scared to touch reality lest it spoil the narrative.