Rob Pike
commandcenter.blogspot.com · Personal blog · on HN since 2009
Rob Pike, a co-creator of Go and Unix veteran, blogs about language design, programming practice, and Go.
What HN saysHN cites his posts on Go's design, such as "Less is exponentially more", and his byte order fallacy post for avoiding endianness ifdefs.
216HN people shared it
143linked it in comments
89stories submitted
3.9Kstory points
2 months agolast shared
2009people per year2026
Most-shared posts
- 1Less is exponentially more61 people · 543 points · first shared 2012 · 122 comments on HN
- 2The byte order fallacy19 people · 160 points · first shared 2012 · 103 comments on HN
- 3Self-referential functions and the design of options (2014)15 people · 37 points · first shared 2014 · 1 comments on HN
- 4Why C++ Programmers Aren't Moving to Go10 people · 14 points · first shared 2013 · 3 comments on HN
- 5Less is exponentially more (2012)8 people · 240 points · first shared 2012 · 273 comments on HN
- 6Esmerelda's imagination7 people · 62 points · first shared 2012 · 3 comments on HN
- 7Color blindness6 people · 324 points · first shared 2020 · 161 comments on HN
- 8Rob Pike on regular expressions in lexing and parsing6 people · 133 points · first shared 2011 · 39 comments on HN
- 9A Unix Quiz (With Answers)5 people · 5 points · first shared 2020 · discussion on HN
- 10Less is exponentially more5 people · first shared 2015
- 11Go: What we got right, what we got wrong4 people · 642 points · first shared 2024 · 689 comments on HN
- 12Simplicity4 people · 7 points · first shared 2023 · discussion on HN
- 13Why don't C++ programmers like Go as much as former users of dynamic languages?4 people · 5 points · first shared 2012 · 2 comments on HN
- 14UTF-8 turned 20 years old (2012)4 people · 2 points · first shared 2020 · 1 comments on HN
- 15Notes from a 1984 trip to Xerox PARC (2019)3 people · 110 points · first shared 2020 · 19 comments on HN
What HN people wrote when they linked it
rednafi · 2025-01-02
Go initially tried to capture the C/C++ space and failed miserably. Rob Pike lamented[^1] over that in a famous blog post. It got the most love from people coming from Python and Node. Then it became the defacto language for writing networking tools, and to this day, it holds that crown.
Go is in an awkward spot—it’s not dethroning Python because it’s not as expressive, academics hate it, and it’s not as fast as Zig or Rust to appeal to systems programmers. So it only makes sense to target the web services section dominated by Django and RoR.
[^1]: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.…
gregjor · 2024-09-08
You interpret Go using a different pattern for error handling as a criticism of or challenge to exceptions. Consider that languages can take different approaches, without having to get into “best” or “worse.” Every approach to error handling has advantages and shortcomings.
The Go designers have explained and talked about this decision many times. Some people don’t like it and maybe choose a different language. No one pushes FUD regarding exceptions. I get the impression that if you choose a Toyota you would think that your neighbor buying a Honda poses a criticism you have to address.
Discussed before many times on HN, such as:
https://news.ycombinator.com/item?id=4159641
Original article:
https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.…
chongli · 2023-11-10
What does it mean to have an "explicitly-endian" type? In the register, it's all the same thing.
I have seen tons of code with #if BIG_ENDIAN ... and it's a huge nightmare. Follow the Rob Pike way [1] and regain sanity.
[1] https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
andrewmcwatters · 2023-02-04
Thank you for mentioning this! I wonder if Zig is the closest modern thing to C that we have? D seems to not want to fill the ANSI C role. Walter Bright seems to be a bright guy, but I want a programming language that follows the philosophies embodied and manifested in C. You can sort of get the idea that the guys behind Go roughly had this sort of Unix-esque philosophy mentality, but they never come out and explicitly say it[1][2], and so I think it wasn't an explicit goal for them.
[1]: https://go.dev/blog/5years
[2]: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.…
Edit: Hahaha, I didn't catch myself with the "bright" thing.
maleldil · 2021-08-20
You completely missed my point. Both my examples were when a function returned an object, and the caller has no idea whether that object ever null. It has nothing to do with parameters.
For what it's worth, I completely disagree with your point. Optional arguments are there to set default values. Default values are so useful that even Rob Pike went through some efforts to use them in Go[0] after refusing to have them in the language.
[0] https://commandcenter.blogspot.com/2014/01/self-referential-functions-…
sgerenser · 2021-01-02
The snippet assumes the data being read is little endian, yes. You can make a different snippet if you want to read big endian. You use an equivalent snippet for the writing side, and boom. You never need any #ifdefs in those functions. Is it actually better than using functions like you describe? Maybe. A part of me does love the elegance of using the exact same code on any platform regardless of the native byte order. This construct was suggested/encouraged by Rob Pike: https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
jart · 2020-03-23
I don't believe you. That sounds more like bitreverse and morton interleaving. If you're serious that it's actually big endian and that it has a real use case (outside human social traditions and legacy infrastructure maintainence), then I'd love to see convincing details.
As for strings, GCC/Clang are great at vectorizing normal byte-oriented code. It doesn't matter if it generates or you hand code VPCMPEQB vs. VPCMPEQQ either, since they appear to have the exact same latency. Modern compilers have also been moving in the direction of punishing folks who do things like `* (uint32_t * )p`, due to aliasing rules rather than endianness. Rob Pike had an amusing blog post on this subject: https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
anonfunction · 2018-07-04
Wonder what he thinks (not really) of Rob Pike using blogspot: https://commandcenter.blogspot.com/
planteen · 2018-01-19
I worked on a code base using the LEON (SPARC, big-endian) and also ARM in little-endian mode for space. The code was common for both endians. I followed the sage advice of Rob Pike on it:
https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
psiclops · 2017-03-16
Rob Pike has a great blog post that talks about the creation of Go and expected adoption vs where many of them ended up migrating from
https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.…
melling · 2015-07-08
Fast builds is definitely a major feature. Go has attracted more Python developers than C++ developers.
http://commandcenter.blogspot.it/2012/06/less-is-exponentially-more.ht…
Go is great as a much faster Python, where speed matters. If Go compiles slow too much, it becomes less attractive.
1_player · 2015-02-25
You probably were sarcastic, but in case you are not there's a brilliant article from Rob Pike about using and composing functions to create flexible APIs: http://commandcenter.blogspot.co.uk/2014/01/self-referential-functions…
There is countless proof about Go's composability through functions and interface, but I keep coming back to that one document.
joeclark77 · 2014-09-21
Dropbox just upped the "Pro" account from 100GB to 1000GB. That's more than enough to store all the pictures you'll take in the next few decades. The benefit of something like Dropbox or its various copycats is that the file is stored on each of your computers as well as being stored in the cloud. So you really aren't putting all your eggs in one basket either locally or remotely.
But you should also curate and print out some of your photos. This was discussed on HN just a couple of weeks ago: (https://news.ycombinator.com/item?id=8129457). The linked article (http://commandcenter.blogspot.com/2014/08/prints.html) reminds us that we're living in a "digital dark age" that's likely to leave few traces in history. Furthermore, even if your great-grandchildren could read the photo files you store today, do you really expect them to look at all of them?
aaronblohowiak · 2013-10-21
The explanation of why I like Go is best found in: "Less is exponentially more": http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.h…
quacker · 2013-07-16
I'm not surprised the hand-written version is faster. You need to store an object for each regex. If these objects are DFAs, for example, then there is a considerable amount of overhead storing the graph to represent the DFA. The hand-written version has comparatively little state, and no generalized logic which would further slow it down.
Error-reporting is another good reason for hand-written lexers (and parsers). It's harder to get readable and accurate error messages when the logic is embedded in the regex or some library/framework.
EDIT: The link posted in the comments of the article is great. From Rob Pike:
A regular expression library is a big thing. Using one to parse identifiers is like using a Ferrari to go to the store for milk.
http://commandcenter.blogspot.com/2011/08/regular-expressions-in-lexin…
shurcooL · 2013-06-04
It's better for everyone who will use/reuse/maintain/improve that code in the future (including the person who wrote it). But of course it's not easy, and takes extra time.
Personally, at this time, I feel a lot more satisfaction when I'm able to truly understand the problem I'm working with, and refactor complicated/hacky/duplicated code into a functionally equivalent but simple and elegant code. Smart/complex code that works is a great intermediate step though, it's way better than no code. :)
Rob Pike has a very relevant article [1] on this topic.
[1] http://commandcenter.blogspot.com.au/2012/06/less-is-exponentially-mor…
luriel · 2012-09-17
There is also Rob Pike's excellent post titled "Less is Exponentially More":
http://commandcenter.blogspot.nl/2012/06/less-is-exponentially-more.ht…
wonderzombie · 2012-09-13
It's worth reading http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.h… to get some idea of the motivation behind including less.
If you believe that our software systems are increasingly complex and that some aspect of the problems we're solving are essentially complex, then the strongest path towards simplicity lies in minimizing complexity incidental to the problems we're solving. One facet of programming which routinely introduces complexity is our tools, particularly our programming languages.
I believe both Rob Pike (and the Go authors) and Rich Hickey are both motivated in part by this impulse or a variation on it. They chose very different ways of addressing the problem, but Clojure and Go are a lot more similar than you'd think.
teyc · 2012-09-10
Rob Pike said it best when he quoted his friend:
My late friend Alain Fournier once told
me that he considered the lowest form of
academic work to be taxonomy.
And you know what? Type hierarchies are
just taxonomy. You need to decide what
piece goes in what box, every type's parent,
whether A inherits from B or B from A.
Is a sortable array an array that sorts or a sorter
represented by an array?
If you believe that types address
all design issues you must make that decision.
Reference: http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.h…
DocSavage · 2012-07-02
Rob Pike recently wrote a great blog entry describing the zen of Go and how it compares to a few other languages, particularly C/C++:
http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.h…
dcminter · 2026-01-27
I roo am trying to curate my RSS feed to be doom-scrolling free. These largely achieve that for me. You'll find a smattering of political posts in them, but that's an inevitable side effect of living in abnormal political times.
https://scrollprize.org/ - The Vesuvius Challenge: Using high intensity X-ray scans and computation to attempt to retrieve lost scrolls from Pompei; real uplifting Sci-Fi stuff! Possibly the most heartwarming thing I know of on the internet; snatching ancient knowledge from the flames of history! What could be more poetic?
https://www.science.org/blogs/pipeline - In the Pipeline: The blog of Derek Lowe (pharmaceutical chemist), (in)famous for articles like "Sand Won't Save You This Time" Always interesting, though a lot of the chemistry goes way way over my head. Some political stuff lately, unavoidably given the current secretary of health.
https://blog.dshr.org/ - David Rostenthal: Digital preservationist.
https://www.jeffgeerling.com - Jeff Geerling: Raspberry Pi, Arm, digital radio, and other nerdery. I enjoy his videos, but I love that he does a plaintext version (first?) that's not just a transcript.
https://commandcenter.blogspot.com/ - Rob Pike: Programming luminary (Go, UTF-8, Unix, etc.)
https://fasterthanli.me - Faster than Lime: Amos's blog leaning heavily towards Rust. I'm a beginner in Rust, but I love this guy's style of writing even when the stuff he's writing about is beyond my current skill level.
Anyway, those are my go-tos…
Zababa · 2024-06-18
No it's not. Please read some more recent writing by Rob Pike, like here: https://commandcenter.blogspot.com/2024/01/what-we-got-right-what-we-g… The money quotes:
> In short, Go is not just a programming language. Of course it is a programming language, that's its definition, but its purpose was to help provide a better way to develop high-quality software, at least compared to our environment 14 plus years ago.
> And that's still what it's about today. Go is a project to make building production software easier and more productive.
I think there is an idea that Go is "software engineering for the masses", and that's why the word "easier" is used, and not "simpler". "easier" is fine when you're starting out and you don't know what you don't know. As times goes on, you start understanding more because you have more experience, and so you may yearn for something simpler, with less abstractions, more control. Go isn't the best language for this, but it's also far from the worst.
sargstuff · 2022-04-03
Higher level languages are based on lower level languages.
aka Have to manually do more things in lower level language to get the 'built-in' features of the higher level language.
C is a system/software engineering language, not a data science/"I don't do/use low level OS/HARDWARE stuff"/someone else needs to write the higher level stuff I want to use" language. So, using C as a scripting language, implies implimenting a scripting language in C first.
(vs. https://hackernoon.com/javascript-compilation-epoch-ebfb7b5bb664 )
C is basically assembler language macros.
Thre are many types of binary encodings.
Binary format consists of sequence of 0's & 1's, any order,
usualy arranged in groups of 8 0/1's.
Standards are used to define how a binary format encoding is interpreted/used/defined. UTF-8, UTF-16, UTF-32, ASCII, etc.
notes on https://hikari.noyu.me/blog/2022-04-01-javascript-is-a-safer-language-…
"... JavaScript has exactly one integer size supported by its integer operations: 32bits"
Umm... on a 64bit machine, wouldn't this rehash the x86/dos/windows 80's/90's 8/16/32 etc issues?
number is 64 bits & bigint goes beyond 64bits.
JavaScript can no longer safely represent integers.
Bit operations are implemented as a cast to an integral type followed by a cast back to a double representation. It is therefore not a good idea to use bit-level operations in Javascript.
C language is not the same a C math library!
Can check for NaN via…
throwaway34241 · 2021-03-24
Most of that could apply to Kotlin also (familiar from Java, etc). Go's relative lack of features seems more to do with their idiosyncratic programming philosophy [1]. The tone is a bit condescending, but they clearly consider it good enough for themselves and it's usually become their primary tool of choice when Go team members work on new projects.
Personally I can see some appeal of fewer features. When trying to solve some medium-sized problem in Go, I often end up working through in my head 5-10 ways to structure it with Go's existing features (and almost always one of them ends up being satisfactory). If I had a lot more features, I could work through 20+ ways, but what good would that do?
Of course, I'm looking forward to user-defined generics (although their absence hasn't been critical for me). I used them in C#, but I would run into limitations [2]. Although it's taken a long time to arrive, I'd prefer to work with the system that the Go team has designed (and now accepted). To me this doesn't make them look bad?
People complain about nullability etc, but I just don't spend a lot of time on those bugs...
Let's say I just don't understand other languages. What language should I use then? I need memory control (value types), reasonable perf, if GC < 2ms pauses, also cross platform. That seems to mostly leave Rust and C++... are the extra features really worth giving up GC over?
That isn't a rhetorical question by the way, that's how I ended up with…
MaxBarraclough · 2021-03-09
Sure. I'm not saying it's impossible to construct such an IR and get it to work, I'm saying I doubt it's the best way forward. See my other comment [0] where I mention Google Native Client.
It would be a poor fit for certain languages, there may be performance penalties depending on target platform, it would preclude legitimate platform-specific code such as SIMD assembly, it would preclude platform-specific build-time customization, etc.
The way toward painless portability is to move away from unsafe languages like C and C++, where you're never more than an expression away from undefined behaviour, and where programmers may be tempted to make silly mistakes like writing code sensitive to the endianness of the target architecture. [1] With C and C++, disciplined developers working carefully, can write portable code. With Safe Rust, code can be pretty close to 'portable by construction', like Java. If you feed Windows-style path strings to Linux, or vice versa, then things might go wrong, but for the most part you'll be on solid ground.
[0] https://news.ycombinator.com/item?id=26398199
[1] https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
kick · 2020-03-15
Most school Internet domain-blocks Wikipedia, libraries are not in walking distance for substantial amounts of people (and that's leaving out how library fees are prohibitive for low-income families), and entry-level smartphones are locked down to the point of making curiosity irrelevant.
When you look at who in this industry succeeds, you very rarely see people from low-income populations. There isn't substantial reason to believe that distribution of opportunity isn't the handicap for a significant amount of people.
YC: founded by the son of a nuclear physicist, and the son of one of the UNIX authors.
Microsoft: founded by the son of a lawyer whose firm is currently making a billion a year in revenue and was similarly doing great at the time.
Facebook: founded by the son of a shrink and a dentist operating in one of the richest areas of New York, rich enough to be sent to private school.
Apple: founded by the son of an engineer at Lockheed.
Amazon: founded by the son of an engineer at Exxon.
Netflix: founded by someone whose family was rich enough to extravagantly donate during the Great Depression.
Google: founded by son of someone with a PhD in Computer Science (one who had multiple thousand-dollar personal computers filling their house since said son was born at that), and the son of someone with a PhD in Computer Science and a researcher at NASA.
C: written by the son of someone...who worked at Bell Labs.
Rob Pike gave a great example once of how Computer…
dguo · 2019-07-14
Rob Pike has a great blog post in which he addresses this: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.…
"I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++."
He later writes:
"Python and Ruby programmers come to Go because they don't have to surrender much expressiveness, but gain performance and get to play with concurrency.
C++ programmers don't come to Go because they have fought hard to gain exquisite control of their programming domain, and don't want to surrender any of it. To them, software isn't just about getting the job done, it's about doing it a certain way.
The issue, then, is that Go's success would contradict their world view.
And we should have realized that from the beginning. People who are excited about C++11's new features are not going to care about a language that has so much less. Even if, in the end, it offers so much more."
latch · 2017-07-23
I definitely agree with you that Go codebases has a high level of consistency. It's certainly one of the many good things Go offers and something I hope other languages look at to see if they can replicate.
But, that doesn't really have anything to do with it being a chore. We can just agree to disagree on that.
However, I think you misunderstood my point about errors (or maybe you're just working with very different types of systems). Empirically, looking at Java codebases, the C# team found that most errors weren't "handled" beyond an outer exception handler. Anecdotally, this has been my experience as well. I admit that this is a very 'web' point of view, where requests are isolated and most exceptional situations are best handled with logging + showing the user a friendly error message.
At this point, they should adopt the Elixir approach and consistently provide a ! alternative across the stdlib (Must* is inconsistently available and verbose). They thought Go would be used by C++ programmers, instead it's being used by Ruby programmers (1). The language paradigm doesn't fit how people are using it as well as it could.
I'm not sure what other languages you've been exposed to, but your last line is hard for me to believe. If you look at other languages, you'll find a lot of techniques aimed at quality and resilience that are nowhere in Go. Again, that doesn't make Go bad, but "resilient" ? Go has mutable, shared memory, nils, no thread isolation, no generics (so…
scott_karana · 2015-12-09
> My impression of the Go community (both within Google and outside of it) is that there is a very ... moralistic? .... sense of "You don't really need that, we know best" going on.
That's by design. Rob Pike fostered that "we know best" opinionated style in the community from the very first Go announcements and tutorials. I encourage you to read the design documents if you haven't: they throw light on the majority of decisions behind the language.
It's not really for me, but I understand and generally respect where they're coming from.
----
> If you want to know how to handle some new layout situation, run gofmt; if the answer doesn't seem right, fix the program (or file a bug), don't work around it.
http://web.archive.org/web/20091113154825/http://golang.org/doc/effect…
> If it bothers you that Go is missing feature X, please forgive us and investigate the features that Go does have. You might find that they compensate in interesting ways for the lack of X.
> More directly, the program gofmt is a pretty-printer whose purpose is to enforce layout rules; it replaces the usual compendium of do's and don'ts that allows interpretation.
> Go doesn't provide assertions. They are undeniably convenient, but our experience has been that programmers use them as a crutch to avoid thinking about proper error handling and reporting
http://web.archive.org/web/20091114043443/http://golang.org/doc/go_faq…
> Orthogonality makes it easier to understand what happens…
bkeroack · 2014-09-30
Whenever this issue comes up (and on HN, it never appears to die), I'm reminded of an eye-opening moment I had reading Rob Pike's excellent essay "Less is Exponentially More" (http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.h…
An excerpt (original emphasis): "Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark...What it says is that he finds writing containers like lists of ints and maps of strings an unbearable burden. I find that an odd claim. I spend very little of my programming time struggling with those issues, even in languages without generic types...But more important, what it says is that types are the way to lift that burden. Types. Not polymorphic functions or language primitives or helpers of other kinds, but types."
It seems to me that people program heavily with types because that's what compilers are really good at. Therefore that's what most languages give us. But I don't want to be constructing huge, complex type hierarchies with every application. If I'm spending more time on that than the actual problem domain, generic type systems are more of a problem than a solution. I don't use a hammer because I love driving in nails, I use it because it's the best way to stick two pieces of wood together.
(edit: perhaps I should clarify that I'm referring to type hierarchies within the application itself as an…