Hacker News new | past | comments | ask | show | jobs | submit login
The Tao of Programming (1987) (mit.edu)
223 points by pyinstallwoes 12 months ago | hide | past | favorite | 105 comments



"Though a program be but three lines long, someday it will have to be maintained."

I am instantly reminded of /bin/true which originally was a 0 byte length file with the execute bits set. Then the edict came down that all programs were to bear an AT&T copyright...


It's always nice to run "/bin/true --version".

On my machine it's on version 8.32. But it's a program that run many more commands than just true. It's a good reminder that things are always more complicated than they seem.


Adding on to the complexity of things: I have a /bin/true but, as noted by /bin/true --help, my shell has its own true as well!


true.


The source for GNU's true (from coreutils [1]) seems to be 80 lines which is ... infinitely more than 0 of course, but still quite manageable especially for a core utility.

Oh, and I "love" how the coreutils code considers string comparison to be hard enough to warrant a macro (in system.h [2]):

    #define STREQ(a, b) (strcmp (a, b) == 0)

[1]: https://github.com/coreutils/coreutils/blob/master/src/true....

[2]: https://github.com/coreutils/coreutils/blob/master/src/syste...


Related:

The Tao of Programming - https://news.ycombinator.com/item?id=33210739 - Oct 2022 (3 comments)

The Tao of Programming (1987) - https://news.ycombinator.com/item?id=25031486 - Nov 2020 (63 comments)

The Tao of Programming (1987) - https://news.ycombinator.com/item?id=19023159 - Jan 2019 (57 comments)

The Tao of Programming - https://news.ycombinator.com/item?id=8035332 - July 2014 (43 comments)

The Tao of programming - https://news.ycombinator.com/item?id=1180356 - March 2010 (1 comment)

The Tao of Programming - https://news.ycombinator.com/item?id=963860 - Nov 2009 (21 comments)

The Tao Of Programming - https://news.ycombinator.com/item?id=595501 - May 2009 (11 comments)

The Tao of Programming - https://news.ycombinator.com/item?id=541426 - April 2009 (2 comments)

The Tao of Programming - https://news.ycombinator.com/item?id=185506 - May 2008 (1 comment)

The Tao of Programming - https://news.ycombinator.com/item?id=26907 - June 2007 (1 comment)


Therad histories like these make me remember, man, I do LOVE hacker news!!!

Thank you @dang for the many years of service and excellent moderation <3

EDIT: typos


These lists should be shown to the submitter, or auto-populated and pinned-collapsed at the head of the new thread.

Perhaps impose a moratorium period of (at least) 3 months for resubmission. Would stop a lot of dupes in new.


We want reposts of good articles! just not too often. They're fine after a year or so (this is in the FAQ: https://news.ycombinator.com/newsfaq.html).

Apart from the enjoyment of revisiting the classics (not too often), these reposts play the important role of brining junior cohorts of users up to speed with the HN culture (which, whatever it is, is one continuation of the lineage of internet lore).

(oh, and in case it isn't clear, the reason I post those 'related' lists is not to point out dupeness (we do that in other ways) but to just give curious readers other things to look at.)


If it spawns further, renewed interest, why?


I think because it often means repeating the same points over again. People who contributed to the previous/earlier mentions may feel too exhausted to repeat their view, provide the same useful references again, or fight the same old misconceptions about the topic.

An interesting related example came up this week, when many people posted submissions about the same news story (anti-matter & gravity). However, all the source links were different. Some commenters may want to make the same comment in all the threads. But there may also be different facts or views in the different articles, so they might each provoke different discussions. [FYI: In that case, an authoritative source Nature appears to have 'won', even though it was not the first one posted. It has the most upvotes and comments, compared to wire-blurbing sci-tech news sites just summarizing the raw CERN PR - which was also submitted. The Let 1,000 Flowers Bloom approach worked well in this case].


Absolutely, when there is a plethora of submissions about the same story in that sort of time frame ("this week"), the result is repetitive discussion, which is bad for curiosity. We all those "follow-ups" and downweight them (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...) and often merge the threads: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que....

However, that's really a disjoint case from what we're talking about here, because once enough time has gone by to clear the hivemind caches, an "old" topic becomes "fresh" again for most readers—especially, of course, the ones who never saw the article before, but also for ones who know it as a classic, and so on.

The FAQ defines "enough time" as "a year or so"—we leave some wiggle room there because sometimes it seems to need a bit longer than a year, and sometimes a bit less is ok. This has been the rule on HN for a long time, well over a decade, and it has held up well over time - I think it strikes a great balance.


Is there a top list of the most reposted articles?


Nope but someone could certainly build it (which includes us of course). It would be particularly useful to distinguish interesting threads from posts with zero comments or uninteresting comments.


After the Epilogue, there will be a Fork.

"Your Pride is your greatest fault," said the Master Programmer to a novice.

"You will stand helpless before an ocean of spaghetti, mocked by great clouds."

"All your full-stack enterprise-grade orchestrated containers will exist only to pretty-print JSON."


"You will stand helpless before an ocean of spaghetti, mocked by great clouds."

Wow. Was this a prophecy?


Nostradockerdesktop


I laughed out loud at that last one, hits close to home.


Related-ish, http://www.thecodelesscode.com/contents, "An illustrated collection of (sometimes violent) fables concerning the Art and Philosophy of software development, written in the spirit of Zen kōans.


The Ozymandius is amazing: http://www.thecodelesscode.com/case/234


I think this jives with the spirit of the discussion:

https://grugbrain.dev/


I was thinking of sharing this with some younger colleagues on slack and paused. Is this a little culturally insensitive by today's standards? I work with someone from China and have no idea what their thoughts on using the Tao like this would be. On the other hand, maybe I'm being overly sensitive.


I'm Korean and if I were to write an article titled "Program like the cowboys of old west" (I've no clue what that article will be about but), would Americans be offended?

Within Korean culture, Doh (도) is a same concept as Tao but I'm not offended.

I think you are being overly sensitive.


The big difference is that Tao has religious overtones to it, while cowboys of the Old West, doesn’t. I think OP was more concerned about the fact that this is grabbing something out of another culture and potentially misusing it or using it in a way that others might not approve. A perhaps more apropos analogy might be The Ten Commandments of Programming, which would be OK with most people, although the Torah of Programming, which employed Jewish stereotypes in its telling would be more problematic. And having typed that, this is where the potential issue with the article could lie: less in the title and more in the body and whether it employs stereotypes or culturally insensitive appropriations.


Throw in some references to the Islamic prophet and you'd be way in inappropriate territory then.


Isn’t that basically the first edition of Wall’s “Programming Perl”?


Something like side effects being haram?


Fundamentalist functional programmers..


Ten Akhams of Programming maybe?


The 10 commandments used to be used a lot e.g. http://textfiles.com/100/tencoms.pro


I guess a closer analogy would be an article about file systems called "The sermon of the mount", or something.

"The ten commandments of ..." is a popular trope (https://medium.com/byte-sized-code/the-ten-commandments-of-p..., https://itnext.io/the-10-commandments-to-survive-software-de..., https://www.lysator.liu.se/c/ten-commandments.html, and so on and so on), too...

Seems all harmless enough, but I suppose the risk is that when you use imagery of a different culture, you don't know what is held near and dear to people from within that culture, that you might twist out of context in a hurtful way.


>Program like the cowboys of old west

That's a very cool title for an article.


“Real gunslingers chase down rouge threads and kill them with their bare hands while the operating system and all its logs crumble around them.”


The Night Watch: https://www.usenix.org/system/files/1311_05-08_mickens.pdf

> Even as we speak, systems programmers are doing pointer arithmetic so that children and artists can pretend that their x86 chips do not expose an architecture designed by Sauron.

> You might ask, “Why would someone write code in a grotesque language that exposes raw memory addresses? Why not use a modern language with garbage collection and functional programming and free massages after lunch?” Here’s the answer: Pointers are real. They’re what the hardware understands. Somebody has to deal with them. You can’t just place a LISP book on top of an x86 chip and hope that the hardware learns about lambda calculus by osmosis.

Really, I recommend everything by James Mickens every chance I get: https://mickens.seas.harvard.edu/wisdom-james-mickens


> rouge threads

"The red threads are not the issue here, dude! ...Also, dude, that's not the preferred nomenclature. 'Native threads', please."


"Cracking Code on the Frontier: Lessons from the Cowboys of the Old West"

https://pastebin.com/DhdHsR3i


See you cyberspace cowboy...


> if I were to write an article titled "Program like the cowboys of old west" (I've no clue what that article will be about but)

It'd be about this! :D https://en.wikipedia.org/wiki/Cowboy_coding


> "Program like the cowboys of old west" (I've no clue what that article will be about but)

Probably about doing things without modern sensibilities of safety precautions, skipping normal testing procedures to fix an issue quickly, editing the live production server, stuff like that.


https://en.wikipedia.org/wiki/Cowboy_coding

And as an American, I would not be offended. Cowboy coders might be if the article is approaching it from the derogatory perspective.


I would like to read such an article...


You're overthinking it by a lot. Tao is not an inherently religous concept, at least for most people. Actually the use of "The Tao of..." (...之道) is somewhat common in modern writing.

Source: as a native speaker.

Edit: that being said you might not want to share this book with junior programmers. Not because it's offensive, but that they might think you're a snob.


I don't think it would be culturally insensitive. It's not really a widely practiced religion, and the word is a generic word in chinese that applies to other religions. Jesus said 'i am the way truth and life', they use Tao to translate Way in the chinese bible.


Eh, I probably wouldn't bat an eye, unless if you had a reputation of being culturally insensitive. If you wanna play it safe, you can postmark "... and yes, I agree, it is a bit gimmicky."


I guess it's no more insensitive than writing a book titled "The ___ Bible" (for your choice of language or topic... there are plenty of examples).


You're being overly sensitive.


Not knowing enough about the thing to know if it's culturally-insensitive is largely what makes it culturally insensitive. You could fix that, but it's easier to stoke random coals on message boards.


This is not a fair take. To know enough about something like a different religion is not something you just go fix. It's not like reading the Wikipedia page on Taoism will give me the cultural context to evaluate how a joke about Taoism will make people feel. Give how often otherwise smart people make insensitive remarks about classes of people they should be familiar with (at least in the US, like women, native Americans, Mexicans, etc) I suspect "fixing it" is harder that you realize and an easier way is to simply ask (which I did).


Making people feel bad is what makes something culturally insensitive. Gaining the perspective necessary to tell when that might be the case isn't so simple that you should sum it up as 'you could fix that'. As you well know it can be nuanced.

Worse, it just occurred to me that you're chastising some one for asking questions in order to 'fix that'. This isn't a 'just asking questions' guy topic so there is really no reason to doubt motives.


> But do not program in COBOL if you can avoid it.

lol

I don't know anything about COBOL but I can feel all of the people that must have triggered. Which is surely why the author included it. Probably like if today that said PHP or Lisp.


COBOL is just a different "styled" language than the Algol family of languages. It is fashionable to dunk on it because of its english-like verbosity which is quite alien to Programmers who initially came from a mathematical background and hence were used to succinct notation. You just have to get used to it. My first job (decades ago on a mainframe) was in COBOL-85 and i found it fine particularly in its strong File handling capabilities which i used to build a simple RDBMS-like system.

You might want to peruse the wikipedia article just to see what it offers - https://en.wikipedia.org/wiki/COBOL


Not Lisp, no. COBOL was like picking your nose with boxing gloves on (h/t Michael Pavlinch). It was appallingly clumsy to use. Lisp was like programming directly in the compiler's abstract syntax tree, with both the plusses and the minuses of that. It was almost the opposite extreme from COBOL.

Or to put it a different way: I don't program in Lisp because that language isn't a good fit for how my brain works and the kind of problems I work on. I don't program in COBOL because I don't like reading things that take that long to come to the point.


They're not wrong. I actually tried learning COBOL at some point and it really is pretty bad. On the other hand, ALGOL turned out to be a surprisingly elegant language and I certainly understand how it influenced pretty much everything that we use today. I actually wish C had more of ALGOL in it.

Lisps were never on the same tier as COBOL or PHP.


And those who wrote in Assembly would dunk on those C programmers. And those who wrote in binary would dunk on the Assembly devs. And those that only had 0's would dunk on those binary devs.


“Pfft” - Ada Lovelace & Joseph Marie Jacquard


HA! I remember when my "Programacion 1" teacher sent us this as part of our curriculum circa 18 years ago or so. Good to know it's still going around.


It would be interesting to finetune a LLM with The Tao of Programming and/or The Zen of Motorcycle Maintenance, and see what it would spit out.


Page with all the formatting this page removed: https://web.archive.org/web/20010208180818/http://misspiggy....


That doesn't seem to be line-wrapped correctly either. How about this one?

http://www.canonical.org/~kragen/tao-of-programming.html


Surrender! to compile

Weather the ferocious storm

You will find true bliss




What's the difference between multiplication and addiction conceptually ? It's one of my mystery in programming. The Tao has no answer for it.


> What's the difference between multiplication and addiction conceptually?

Addiction is multiplication by infinity.


Possibly the most thoughtful and profound reply to a typo i've seen.


foo times boo ...means you are adding foo, boo times... see[1]@[2] so it's a kinda shortcut.

[1] https://wikimedia.org/api/rest_v1/media/math/render/svg/e12e... [2] https://en.wikipedia.org/wiki/Multiplication

Similar relation between exponentiation (power) and multiplication... see[3]@[4]

[3] https://wikimedia.org/api/rest_v1/media/math/render/svg/dcb8... [4] https://en.wikipedia.org/wiki/Exponentiation


Given that multiplication is repeated addition, then division is repeated subtraction.


Ah ha... :) I wouldn't see division as exact opposite (or symmetrical inverse) of multiplication. Multiplication is both left-distributive and right-distributive, and thus distributive. Unlike multiplication and addition, division is not commutative, neither associative in general.


It seems as my logic holds in the sense and case that it is “an inversion of meaning in some way” - whether that can be argued as an opposite, inversion, chiral disposition towards 0 or away from 0, who knows!

But most intriguingly it applies that subtraction and division don’t have the properties you mention which is a symmetric “anti” feature of these operators and seemingly can be reduced to the primitive function of addition or subtraction as multiplication and division are just meta operators acting as a loop.

At least this is how I’m viewing it.

There’s an intuitive sense that symmetry breaks when you take away (reduce) compared to add which is in parts of a whole.

And then to realize you can use addition to implement subtraction is where my brain starts to melt even though it’s relatively straight forward. Everything is just addition, the holy monad, the primordial dimensionless unit.


So x / 0 should be equal to x right ? Because you substract x zero time.


I similarly went down that route and found the answer to be at least plausibly more definitive than undefined.

It also still reaches an intuition on what dividing by zero means, and it is not that it equals zero, but that the amount of cycles to do are 0. As in index is still 0 in the array.


Since it is from the 80’s, maybe the Motorola 68000 can answer your question.

Looks like… more than 60 clock cycles. Yikes!

https://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/timstandar...


In any field, there's always an additive inverse, not so for multiplication.


Exactly. In fact, there will always be some element a in a field¹ for which there is no multiplicative inverse. This is why with boolean algebra, both ⋀ and ⋁ are multiplication operators (for ⋀, T has no inverse; for ⋁, F has no inverse).

1. To be clear for readers, when KMag and I say, “field,” we’re referring to a specific mathematical construct in which there are + and × operators and symbols 0 and 1, the former being the additive identity and the latter the multiplicative identity.


Read the headline and was immediately taxed back to CIX when the Taos guys were teasing their operating system in a conference of the she name.


I'm reasonably sure this book is still under copyright.

It seems that a lot of people don't care about that for certain books.


The comments in this thread are about respecting copyright and if Tao is culturally insensitive.

Is this really “hacker” news? What the hell happened to this generation? Did the establishment win?


Something won, this place is a lot different than I remember it.


At the time of writing there is exactly one question about copyright and one question if this might be culturally insensitive.

Regarding if it's culturally insensitive, the majority that replied disagreed that it was. Maybe something like 2 comments saying it is. There's 1 that says it is, which got downvoted, and the other seems to be making a case as to why it could possibly be.

Not exactly a win in my opinion.


the arc of 1000 unlicensed copies begins with your first curl


Intellectual property rights should be abolished.


There are countries in which there is no IP protection, it's not the utopia you think it is.


Completely agree.


That's a slippery slope. First, it's only the Intellectual property rights, then the Intellectual property, and finally, the Intellectual.


The sections on attaining enlightenment could have been written by Calvin's dad.


I wonder what would replace COBOL in 1.2 if it was written today.


Java, C#, JavaScript, TypeScript, Python, PHP, Go, Rust, C, C++ come to mind.

The Tao (sometimes) opposes rituals and tradition, and that is exactly what these languages excel in. It is probably wiser to continue unfolding the landscape of programming languages.


> Java, C#, JavaScript, TypeScript, Python, PHP, Go, Rust, C, C++ come to mind.

Yes.

Unfortunately


Nothing. You have to get into INTERCAL territory to find something more tedious to work with than COBOL.


The title reminds me to give The Tao of Physics another read.


this is the book that made me realise programmers are losers


and not your lived experiences?


There's the programmers that just use it as a tool to accomplish stuff -- that's cool.

There's the ones that overcomplicate and overmystify everything, nerding out in pointless discussions etc -- that's just not cool at all to me.


you have been here for four years and never realized this before?


class=""


I don't get the connection to daoism. This just seems like a set of super context-sensitive worldviews set in a certain style.


The rest of the text might be parody of Taoist texts, but the opening is a Kung Fu (1972) reference:

   When you can snatch the pebble from my hand, it will be time for you to leave.
https://tvtropes.org/pmwiki/pmwiki.php/Main/WhenYouSnatchThe...

I don't think the Tao Te Ching or Zhuangzi has the pebble quote.


It's written in a set of Tao Te Ching-style aphorisms for humorous effect. That's the connection I guess!


It would come off as a lot more meaningful if it didn't try to pass itself off as a religious text the author clearly didn't value.


What makes you think the author did not value the text?


This is passing itself off as a religious text as much as The Book of Eli passes itself off as a gospel. That is, not at all.


There was a period in hacker history when hackers thought they were reviving some kind of ancient zen and dao traditions, but in a very light and not really very appreciative way


(1987)


Bunch of discussion from 3 years ago on it: https://news.ycombinator.com/item?id=25031486


Tao




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: