
It’s hard work printing nothing - protomyth
http://www.tedunangst.com/flak/post/its-hard-work-printing-nothing
======
zeveb
The more I see of what goes on under the covers, the more surprised I am that
anything works at all. As an example, every gtk+ program I run spews thousands
of errors to the console. Why? Are they bad? The programs seem to run anyway,
never crashing more than one would expect. So … why the console spam?

~~~
ensiferum
I think not a single actual application is completely well formed. They all
work on luck. Especially in the embedded world. Btw, my android just rebooted.

~~~
smilekzs
"In the embedded world" covers a huge area, including mission-critical
avionics code, which likely has much higher safety standard than, say,
Android.

~~~
hexane360
Although from hearing about the Apollo Guidance Computer, it's just as much of
a miracle they were able to get it to work without any debugging or compilers,
with basically one shot to write the program to ROM.

~~~
roberthensing
Well they put in an effort of 1400 man years for just the software. They even
built an interpreter, because (flight/trajectory) requirements were changing
all the time.

Also: "The highest level of testing was performed with a high fidelity digital
simulation of the computer, spacecraft hardware, and mission environment."

[http://klabs.org/history/history_docs/mit_docs/1711.pdf](http://klabs.org/history/history_docs/mit_docs/1711.pdf)

------
akkartik
I love the dry understated link to PHK's
[http://queue.acm.org/detail.cfm?id=2349257](http://queue.acm.org/detail.cfm?id=2349257)
there.

~~~
justinlardinois
> Here is one example of an ironic piece of waste: Sam Leffler's
> graphics/libtiff is one of the 122 packages on the road to www/firefox, yet
> the resulting Firefox browser does not render TIFF images. For reasons I
> have not tried to uncover, 10 of the 122 packages need Perl and seven need
> Python; one of them, devel/glib20, needs both languages for reasons I cannot
> even imagine.

This is a better read than the linked article, really.

~~~
icebraining
That's rich coming from PHK, whose software requires a full C compiler as a
_runtime_ dependency.

The reason Firefox pulls libtiff is simply because it uses a generic image
manipulation library (libgdk-pixbuf), which in my system it's also used by
many other applications - which do require TIFF support. I guess if you have a
desktop with only FF installed that may be a waste, but how many people really
have FF and not any kind of image viewer installed?

~~~
dkarapetyan
That's a very sensible requirement. It says in the docs exactly what they use
it for. Not like they put in a bunch of other dependencies and some 3rd degree
dependency pulled in a C compiler.

~~~
icebraining
The C compiler in question pulls in a bunch of libraries for dealing with math
problems (libgmp, libisl, libmpc, libmpfr) and zlib. Does their config
language need support for "integer points bounded by linear constraints"? And
why are they pulling zlib, when they also bundle it?

I don't see the difference. Instead of including a specific compiler for their
needs, they are bazaar-ing a full generic C compiler (along with irrelevant
libraries) just like Mozilla is doing with a generic image manipulation
library, which pulls libtiff since many packages that also use it need TIFF
support.

~~~
dkarapetyan
I mean I guess they could bundle tiny C compiler but your point about the C
compiler is more about how modern distributions bundle and distribute
compilers more than about varnish depending on a C compiler. You can choose to
install the smallest subset of the libraries required to enable varnish to
perform its job. Not like varnish explicitly requires libgmp to do bignum
arithmetic. It's how your distribution of choice installs gcc and pulls in all
the stuff with it.

~~~
icebraining
No, gcc _requires_ libgmp, it's not just a choice by the distribution. But
even if it was, that is exactly why Firefox pulls libtiff - it's not like it
explicitly requires the library, it's just how the distribution installs
libgdk-pixbuf. Yet PHK uses that as an example of the waste created by the
development model.

------
cperciva
_There’s an argument to be made that silly error messages are better than
crashing browsers_

There's an argument, but it's a really lousy one. If you're passing NULL as a
string to printf, _your code is broken_. A crash which results in someone
tracking down and fixing the bug is far better than _quietly doing something
which is 100% guaranteed to be wrong_.

~~~
lotharbot
> _" A crash which results in someone tracking down and fixing the bug is far
> better than quietly doing something which is 100% guaranteed to be wrong."_

Not necessarily. Wrong is relative and can have either small or large costs,
and crashing also has a cost to the user (and to the developers if they lose
users.)

As an example, I play a very old video game (Descent). One of the major
problems with one of the modern source ports is that the game crashed under
certain conditions -- like if it received a malformed data packet. This is a
game that's already fairly tolerant to lost data, so just dropping a bad
packet is an acceptable result. By comparison, crashing in the middle of a
competitive match is a much worse result, because it affects things like
momentum and where various powerups have been left around the map.

It would be great to fix the bug that was resulting in malformed packets --
but the cost of directly affecting a high-stakes match is not worth it. I'd
rather tolerate a fraction of a percent of lost data every game for the next
20 years than _ever_ have a high-stakes match where the result was tainted by
a badly-timed crash.

~~~
lmm
If it were possible to gain an advantage in a competitive match by having your
system deliberately drop a packet, the game would quickly become impossible to
play competitively - that kind of cheating would be basically impossible to
detect because there's no way to tell it apart from a genuine bad internet
connection. If you've carefully thought through what the game should do when a
packet is malformed that's one thing, but if you haven't thought about it then
cleanly crashing is probably the best option.

~~~
MichaelBurge
That isn't true at all: Often competitive players are required to use the
tournament organizer's hardware anyways.

And often competitive players form groups to play in, so everybody knows each
other even while practicing.

You'd probably want to be on a LAN to minimize the risk of this happening
accidentally.

So in practice, I don't think it would matter too much even if money was on
the line. You would just have to take appropriate precautions, and watch to
disqualify people for cheating.

------
dkarapetyan
I always thought low-level programmers (C, C++, assembly, etc.) cared more
about minimal abstractions and minimizing dependencies. But it turns out it's
the same story no matter what level of the stack you are on. Currently working
on a project with 200+ requirements in requirements.txt and growing. Before
anyone says microservices just realize that you have taken the same
programmers that made this mess and shoveled the problem elsewhere. These
people will find a way to introduce 100+ dependencies on other services.

~~~
AnkhMorporkian
> Currently working on a project with 200+ requirements in requirements.txt
> and growing.

That's incredible. I've worked on some very large python projects before, but
200? That's pure insanity. Can I ask what that project does? I just can't
imagine a project where you'd need 200 libraries.

~~~
ebola1717
Eh, in Ruby, just installing Rails is like 80 dependencies. Would be surprised
if Django wasn't 40+

~~~
jokamoto
Django itself has no requirements besides the standard library:

    
    
        % pip freeze
        Django==1.10
    

That's after a pip install in a fresh virtual environment.

~~~
steveklabnik
Rails itself is broken up into smaller packages, so you can only load parts of
Rails if you want. Very few apps actually do. (and that's only like 8 of the
80)

------
overcast
Semi relevant, I just spent the last two hours getting an ancient machine
printing to modern copier.

~~~
MOARDONGZPLZ
I would love to hear the story if you have the inclination to go into details.

------
qwertyuiop924
Could someone give an ELI5 on this? I know talloc's snprintf test is broken,
but I'm not sure what the point is.

------
acqq
I actually consider it a good engineering decision printing "(null)" when the
0 pointer is passed to the printing function.

------
amelius
Perhaps exception handlers should run inside a sandbox by default, because we
know that exceptions are usually not well tested.

~~~
allendoerfer
So programs should just fail silently?

~~~
amelius
The sandbox could complain if the exception handler fails.

