While the idea of small tools that do one job well is the core tenant of what I think of as the UNIX philosophy, this goes a bit beyond UNIX, so I have moved this discussion to COFF and BCCing TUHS for now.  

The key is that not all "bloat" is the same (really)—or maybe one person's bloat is another person's preference.  That said, NIH leads to pure bloat with little to recommend it, while multiple offerings are a choice. Maybe the difference between the two may be one person's view over another.

On Fri, May 10, 2024 at 6:08 AM Rob Pike <robpike@gmail.com> wrote:
Didn't recognize the command, looked it up. Sigh.
Like Rob -- this was a new one for me, too.
I looked, and it is on the SYS3 tape; see: https://www.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/src/man/man1/nl.1


  pr -tn <file>

seems sufficient for me, but then that raises the question of your question.
Agreed, that has been burned into the ROMs in my  fingers since the mid-1970s 😀 
BTW: SYS3 has pr(1) with both switches too  (more in a minute)


I've been developing a theory about how the existence of something leads to things being added to it that you didn't need at all and only thought of when the original thing was created.
That is a good point, and I generally agree with you.
 
Bloat by example, if you will. I suspect it will not be a popular theory, however accurately it may describe the technological world.

Of course, sometimes the new features >>are<< easier (more natural for some people).  And herein lies the core problem. The bloat is often repetitive, and I suggest that it is often implemented in the wrong place - and usually for the wrong reasons.

Bloat comes about because somebody thinks they need some feature and probably doesn't understand that it is already there or how they can use it. But they do know about it, their tool must be set up to exploit it - so they do not need to reinvent it.  GUI-based tools are notorious for this failure. Everyone seems to have a built-in (unique) editor, or a private way to set up configuration options et al. But ... that walled garden is comfortable for many users and >>can be<< useful sometimes.

Long ago, UNIX programmers learned that looking for $EDITOR in the environment was way better than creating one.  Configuration was as ASCII text, stored in /etc for system-wide and dot files in the home for users.  But it also means the >>output<< of each tool needs to be usable by each other [i.e., docx or xlx files are a no-no).

For example, for many things on my Mac, I do use the GUI-based tools -- there is no doubt they are better integrated with the core Mac system >>for some tasks.<< But only if I obey a set of rules Apple decrees.  For instance, this email read is easier much of the time than MH (or the HM front end, for that matter), which I used for probably 25-30 years. But on my Mac, I always have 4 or 5 iterm2(1) open running zsh(1) these days. And, much of my typing (and everything I do as a programmer) is done in the shell (including a simple text editor, not an 'IDE').  People who love IDEs swear by them -- I'm just not impressed - there is nothing they do for me that makes it easier, and I have learned yet another scheme.

That said, sadly, Apple is forcing me to learn yet another debugger since none of the traditional UNIX-based ones still work on the M1-based systems. But at least LLDB is in the same key as sdb/dbx/gdb et al., so it is a PITA but not a huge thing as, in the end, LLDB is still based on the UNIX idea of a single well-designed and specific to the task tool, to do each job and can work with each other.

FWIW: I was recently a tad gob-smacked by the core idea of UNIX and its tools, which I have taken for a fact since the 1970s.

It turns out that I've been helping with the PiDP-10 users (all of the PiDPs are cool, BTW). Before I saw UNIX, I was paid to program a PDP-10. In fact, my first UNIX job was helping move programs from the 10 to the UNIX.  Thus ... I had been thinking that doing a little PDP-10 hacking shouldn't be too hard to dust off some of that old knowledge.  While some of it has, of course, come back.  But daily, I am discovering small things that are so natural with a few simple tools can be hard on those systems.

I am realizing (rediscovering) that the "build it into my tool" was the norm in those days.   So instead of a pr(1) command, there was a tool that created output to the lineprinter. You give it a file, and it is its job to figure out what to do with it, so it has its set of features (switches) - so "bloat" is that each tool (like many current GUI tools) has private ways of doing things. If the maker of tool X decided to support some idea, they would do it like tool Y.  The problem, of course, was that tools X and Y had to 'know about' each type of file (in IBM terms, use its "access method").  Yes, the engineers at DEC, in their wisdom, tried to "standardize" those access methods/switches/features >>if you implemented them<< -- but they are not all there.

This leads me back to the question Rob raises.  Years ago, I got into an argument with Dave Cutler RE: UNIX vs. VMS. Dave's #1 complaint about UNIX in those days was that it was not "standardized."  Every program was different, and more to Dave's point, there was no attempt to make switches or errors the same [getopt(3) had been introduced but was not being used by most applications).  He hated that tar/tp used "keys" and tools like cpio used switches.  Dave hated that I/O was so simple - in his world all user programs should use his RMS access method of course [1].  VMS, TOPS, etc., tried to maintain a system-wide error scheme, and users could look things like errors up in a system DB by error number, etc.  Simply put, VMS is very "top-down."

My point with Dave was that by being "bottom-up," the best ideas in  UNIX were able to rise. And yes, it did mean some rough edges and repeated implementations of the same idea.  But UNIX offered a choice, and while Rob and I like and find: pr -tn perfectly acceptable thank you, clearly someone else desired the features that nl provides. The folks that put together System 3 offer both solutions and let the user choose.

This, of course, comes as bloat, but maybe that is a type of bloat so bad?   

My own thinking is this - get things down to the basics and simplest privatives and then build back up.  It's okay to offer choices, as long as the foundation is simple and clean.  To me, bloat becomes an issue when you do the same thing over and over again, particularly because you can not utilize what is there already, the worst example is NIH - which happens way more than it should.


I think the kind of bloat that GUI tools and TOPS et al. created forces recreation, not reuse. But offering choice and the expense of multiple tools that do the same things strikes me as reasonable/probably a good thing. 


1.]  BTW: One of my favorite DEC stories WRT to VMS engineering has to do with the RMS I/O system.  Supporting C using VMS was a bit of PITA.   Eventually, the VMS engineers added Stream I/O - which simplified the C runtime, but it was also made available for all technical languages.  Fairly soon after it was released, the DEC Marketing folks discovered almost all new programs, regardless of language, had started to use Stream I/O and many older programs were being rewritten by customers to use it. In fact, inside of DEC itself, the languages group eventually rewrote things like the FTN runtime to use streams, making it much smaller/easier to maintain.   My line in the old days: "It's not so bad that ever I/O has offer 1000 options, it's that Dave to check each one for every I/O. It's a classic example of how you can easily build RMS I/O out of stream-based I/O, but the other way around is much harder.   My point here is to use the right primitives. RMS may have made it easier to build RDB, but it impeded everything else.