Havoc's Blog

this blog contains blog posts

Return on Equity

Most people know about the price/earnings
ratio
. If you want to learn one more thing about financial
numbers, return on
equity
could be a good choice.

Return on equity is annual profit divided by net worth. If you have
$100 in net worth, and make $10 in annual profit, then you are making
10% ROE. If you think you can make a 15% return elsewhere, you could
sell your assets to net $100 in cash, and invest in the 15% return
elsewhere.

Reinvestment

Depending on the nature of the business, maybe you can add more net
worth and make more profit. If you’re making $10 on your $100 tied up,
maybe you can add another $100 and now make $20. Still 10% ROE, but
more money made.

This is supposed to determine what companies do with their profits. If
they can reinvest into the business (or at least, some business) at a
decent ROE, then they should do so. But if they can’t, they should be
paying the profits out as dividends their stockholders can invest
elsewhere.

Say you propose a project for your company to undertake. The key
questions might be the return on equity, and how much equity can be
invested. (Making 500% returns on twenty bucks might not be very
interesting for a large company.)

Where do earnings come from?

Return on equity can be broken down to understand why a
business activity is making money. An equation called the DuPont system
tries to do this.

The DuPont system is:

  ROE = 
    (Margin, how much of each sale is profit) x
    (Asset Turnover, how quickly inventory is sold) x
    (Financial Leverage, how much did we borrow)
  • Higher margin means more profit per dollar of stuff sold
  • Higher asset turnover means selling stuff more quickly
  • Higher financial leverage gives you more stuff to sell or more productive
    assets for the same net worth – you’re buying machinery or inventory
    with a loan

Different kinds of business make money in different ways, even in the
same industry. For example, some few-months-old numbers for Dell and
Apple (numbers don’t quite add up due to rounding error; numbers are
from Morningstar):

  • Dell: 5% margin x 2.0 turnover x 4.4 leverage = 43.8% ROE
  • Apple: 15.4% margin x 0.9 turnover x 1.8 leverage = 24.2% ROE

Not surprising. Dell makes money by selling a lot of stuff quickly
for a low profit, using more borrowed money. Apple makes money by
selling more slowly, but for higher profits. Both are workable models,
neither one is wrong. Both companies are single-minded about their
approach; Dell has focused on increasing turnover rather than
increasing margin, and the opposite for Apple.

Leverage is the most dangerous way to make money, because if the
margin flips negative the ROE goes negative. Banks make
their money on leverage, and they are supposed to be conservative about
ensuring the margin stays positive, for example by only making sound
loans to people who can pay them back.

The worst kind of business is high leverage with a low, but unstable,
margin. Example (other than subprime lending): airlines.

  • American Airlines a few months ago: 2.2% margin x 0.8 turnover x 10.8 leverage = 19% ROE
  • American Airlines now: -7.1% margin x 0.8 turnover * 17.42
    leverage = -98% ROE

Airlines are always about to go bankrupt. The margin depends on ticket
prices (which they can’t raise very much without losing sales),
and fuel costs (which they don’t control and which bounce around
wildly). They can’t control the margin, and on top of that the margin
is low so requires high leverage to make the ROE worthwhile.

Perhaps this explains why airlines are awful to customers. They can’t
afford to spend any money.

Applications

Here’s what a business activity should not be about: growing revenue
for its own sake. Often it’s possible to grow revenue by reinvesting
in a business (say, hiring more salespeople, building more
manufacturing capacity, running ads) … but the ROE may be too
low. If customers don’t really want the increased sales enough to pay
for them, then margins are low or even negative. At that point it
would be better to invest in an index fund, or a savings account,
rather than in the business. It doesn’t make sense to spend a
bunch of money selling stuff people don’t want.

ROE determines what sort of price/earnings ratio is acceptable,
because (in theory) the earnings will be reinvested at the ROE.
If an investment pays 10% per year reinvested at 10%, that is worth a
lot more than 10% per year reinvested at 2%. So the stock price should
be higher relative to earnings.

I find it helpful to flip price/earnings over (earnings yield). It
gives me much more pause to invest in something yielding 2% than
something with a P/E of 50. Higher P/E almost sounds good – it’s
higher, right? Maybe this explains the tech bubble.

Both ROE and P/E require all kinds of adjustments and normalizations
to remove accounting artifacts before they mean all that much. That’s
one reason it’s futile trying to buy stocks if you aren’t a qualified
analyst (or relying on one).

As concepts, though, these ratios should help you decide what makes
sense for the businesses you’re involved with as an employee or owner.
Is your company more focused on turnover or on margin, for example?
Is your new project proposal profitable enough – would you personally
invest in it instead of a mutual fund, if it were your money?

(This post was originally found at http://log.ometer.com/2008-08.html#3)

Business

Even though I spend all day as a software developer, I find it useful
to understand something about financial and business topics. Many
people (including a much younger version of myself) reflexively
dismiss business – marketing, finance, etc. – as irrelevant to them.

Sometimes this is because people think of business as in some way
distasteful. It can be. However, a better way to look at it is that
some businesses and people engaged in business are
distasteful.

Mutually beneficial exchange

Here is what business is supposed to be like. Say we live in a small
town hundreds of years ago. I am a blacksmith and you are a
farmer. You need horseshoes and I need food. We exchange one for the
other. We are both better off.

This is what a company should be like, and it’s also how I like to
view employment
(an exchange of time for money that is mutually
beneficial).

Business is not always like this. Monopolies, for example, can mean
that exchanges have lopsided benefits rather than mutual benefits.
Another issue is that large (or mismanaged) organizations
can become irrational – a public company should be a mutually
beneficial exchange between the stockholders and the customers. The
employees of the public company, specifically the management, are
supposed to act as agents of the stockholders. But it’s not unusual at
all for politics and self-interest to trump both customers and
stockholders. Or for short-term thinking to trump long-term.

It gets more complicated when customers and stockholders mutually
benefit, while some third party gets screwed. That’s when government
incentives or regulations are needed.

The more complex and “abstracted” from stockholders and customers a
business gets, the worse it can be for both stockholders and
customers. Look at the subprime mess: it was too complicated and
unclear where the mutual benefit was, with quite a few links in the
chain between investors and customers. This allowed the agents
(management, employees) in the middle to muck things up badly.

Your company should be making a profit, and your customers should be
better off than they would be without your company. True for a
one-person company, true for a thousand-person company. Nothing else
is sustainable (or ethical).

A way to get things done

Say you want to get something done. Work on a certain project, create
a better mousetrap of some kind and get it out to people, spend your
time on whatever activity, solve whatever problem in the world.

There’s no way around it: whatever you want to get done will use
resources. It will use time, materials, or both. Even if your project
is to quietly meditate in the wilderness, you’ll be spending time on
food, shelter, and other tasks to sustain yourself. You’re converting
some type of resource into some other outcome.

To get something done, you could do all the work yourself. But not all
tasks are that small. So people look for ways to achieve larger goals.

To achieve a larger goal, you can either increase your own
productivity, or you need to organize other people – ideally into a
self-sustaining snowball that keeps pushing your goal further and
further forward.

There are two ways I know of:

  • Start a business.
  • Organize volunteers and donations; but volunteer labor and
    donations are both supported by some kind of business.

Business is just cooperation

Either everyone in the world is a completely self-contained
and self-sustaining unit, doing their own hunting and gathering,
building their own shelter, etc. ; or they are engaged in
exchanges that should be mutually beneficial, i.e. they are in
business.

When specific businesses or specific business people
don’t seem to fit into this, those are bad businesses and bad business
people.

Trying to ignore business matters is a bad idea. You’ll never get
anything done (or even understand what’s going on in the world).

(This post was originally found at http://log.ometer.com/2008-08.html#3.2)

Dell Studio Hybrid

Today several people pointed out the new Dell
Studio Hybrid
, which looks pretty interesting.

(This post was originally found at http://log.ometer.com/2008-07.html#29)

Programming

Reading Planet Mozilla, Vladimir
says
programming is like this and like
this
. Love it.

(I’d seen the Mario video
before, but I wasn’t clever enough to notice it’s the perfect
metaphor for software development…)

(This post was originally found at http://log.ometer.com/2008-07.html#28)

TV Computer Build

If assembling a system from parts, it looks better to get a somewhat
larger case with a case fan, rather than a tiny case with a CPU
fan. A maybe-working example of this could be:

Total hypothetical cost: $750

This has case fans, but with the slow CPU and notebook drive it may be
possible to turn them off or dial them way down. The fanless power
supply is expensive; the Nexus
quiet power supply fan
in my development system is pretty
inaudible, so perhaps that is a better option, saving $70 or so and
bringing total cost to only $680. A power supply fan could
reduce the need to run the case fans. Scrounging for stuff on sale
could save a few more dollars no doubt.

These built-from-parts systems always run over budget when it turns
out some part doesn’t work with some other part.

An expensive version could have instead:

Total extra cost +$255 so the “deluxe” approach is $1005.

Though larger and uglier, this system would be roughly comparable in
cost to the Mac Mini, despite much better hardware specs. However, if
a next-generation Mac Mini ever came out, I’d expect it to have specs
and cost similar to the above. It would quite possibly use the X4500HD
chipset, even.

Looks like nobody sells the X4500HD Intel motherboards until late August,
so I’m not going to run out and buy anything. Maybe better
options will come along in the meantime.

Updates

Suggestions people have sent in:

  • Several people would save money by using fewer magic-special quiet
    parts, regular parts aren’t that loud anyway if you pick the right
    ones.
  • 2G is too much RAM (though only $50 anyway).
  • Use an AMD motherboard, like GA-MA78GPM-DS2H
    or GA-MA78GM-S2H
    to get more for less.

Could take another $200-300 off the price most likely messing with the
tradeoffs and shopping around for best prices.

(This post was originally found at http://log.ometer.com/2008-07.html#27)

TV Computer Update

Still looking for my perfect TV computer. Thanks to everyone for
suggestions so far, I really appreciate it. Several people expressed
interest in hearing any answers, so I’ll keep posting what I learn.

Ideas suggested so far:

None of these are quite there for me yet. I do want an actual
computer, not an appliance/”thin-client”; I don’t have another
computer free to be the server, and none of the appliances support all
the video sites and formats we use. I’d also like some future
safety. I don’t even own any Blu-Ray DVDs right now, but this thing
should last a few years, and who knows what new video services will
come out over the next 5 years. (We canceled cable in
favor of “a la carte” purchases online or in DVD form, so we don’t need
cable cards, tuners, or DVR functionality.)

Right now we’re attaching my laptop to the TV and using
the clever diNovo
Mini
as a remote. But I want to free up the laptop. (That’s the
bottom line objective here, get my laptop back.)

Any type of fan is probably a showstopper. I was almost willing to
live with the Mac Mini fan since it is somewhat quiet, but the Mac
Mini has a slow GPU in it. While a very quiet fan might be OK, my
experience with supposedly quiet fans is that they aren’t quiet
enough, especially under CPU load, and especially after a year or two
of wearing out. For my developer workstation I bought all the special
quiet parts, and it’s indeed very quiet while I type this, but the fan
spins up if the CPU is under load… for example while watching video.

In short, fans are risky.

One thing I haven’t investigated: just get a laptop. But I bet that’s
expensive-ish.

There are many good options if cost is not a factor; such as Hush, A-Tech
Fabrication
, mCubed,
or Niveus.
These are all great except they are very expensive. I’m
willing to pay extra for something good, but a thousand dollars extra
is too much.

I believe there’s probably a solution involving the Intel DG45FC or a
similar board, a slow/cheap/low-power CPU (perhaps a
single-core Celeron – that could be slower than necessary even),
a fanless case, a fanless CPU heatsink of some kind, and a
quiet/low-power 2.5-inch notebook drive.

But, there’s no way to know whether a given pile of parts will snap together
and not catch on fire.

  • Fanless CPU heatsinks are huge, and cases that hold
    mini-ITX boards don’t look big enough to fit them inside.
  • Even if they fit, fanless CPU heatsinks are probably intended to
    go in roomy cases with fans, not fanless mini-ITX
    cases.

No doubt if I wait long enough there will be something prebuilt
available. I am tempted to try the Intel board though. Maybe I can cut
a hole in the case for the heatsink 😉

(This post was originally found at http://log.ometer.com/2008-07.html#25)

TV Computer

I want a computer with the following specs to connect to a TV:

  • No fans (on case, CPU, GPU, or anywhere else)
  • HD/BluRay-capable GPU (I think this rules out the older pre-965
    Intel GPUs for example, though figuring out Intel’s product
    names
    is beyond me, so I can’t tell most of the time what a given
    system for sale actually has)
  • Not outrageously large form factor
  • Not outrageously expensive

Seems like an obvious product, but I haven’t found it yet. Anyone have
a link? Email me and I’ll post
an update if I find something.

(This post was originally found at http://log.ometer.com/2008-07.html#24)

GTK 3 thoughts

Chris Blizzard said it
struck him at GUADEC that there were two very different initiatives,
desktop and mobile, happening in the GNOME community.

Miguel’s
post
on GTK+ 3.0 reminded me of Chris’s comment.

In the mobile world GTK+ is not quite ideal, and GTK+ based platforms
are in the early-to-mid stages, not the highly-mature stage. I bet
GTK+ needs a lot of evolution to be what it could be in non-desktop
contexts.

For the Linux desktop, GTK+ should be kept stable and mature, while
for new opportunities, perhaps not.

In a post last
month
I argued that evolution was appropriate for the Linux
desktop, while revolution was appropriate for new ideas and
categories of product. But what if GTK+ is part of both?

Two new directions people are working on: 1) GTK+ as an improved
cross-platform desktop toolkit, and 2) GNOME technologies refactored into
a mobile platform.

Thought: in the GTK+ 3.0 discussion, discuss how GTK+ can
address both these new directions and the traditional Linux
desktop
, without screwing anybody.

Thought #2: as with any project, GTK+ will be driven by whoever is
doing the work. And as with most big projects (Mozilla, Linux, GTK+
itself historically), clusters of developers with funding will be able
to do a lot of work. Most of the work today seems to be funded by the
non-Linux-desktop developers (who have some significant-to-them
revenue stream attached to GTK+), not by the desktop Linux
distributions (who can’t connect GTK+ work to revenue in a compelling
way). If the Linux desktop developers can’t find revenue, and can’t
muster significant volunteer resources, they are going to have less
and less influence – that’s how open source works.

2.x forever?

GTK+ needs an ability to evolve, which means a 3.0. Another way to say
it: new toolkits should not have to start from scratch, they should be
based on existing GTK+ code. Because 3.0 would be parallel-installable, it’s
a new toolkit in the GTK+ tradition, but not the same library. It does
not replace 2.x in an operating system install.

3.0 replaces 2.x to the extent that the people working on 2.x
stop working on it, and shift to 3.x. If there’s nobody who wants to
keep working on 2.x beyond a certain point, it’s tough to argue 2.x is
important beyond that point. 2.x could live forever if someone were
interested in doing the work.

In open source, “important enough to me that I’ll work on it or
pay someone to work on it” matters. “Important enough to complain
about” does not matter much.

ABI sealing and deprecation

All approaches to GTK+ 3.0 have their downsides. The downside of
“break ABI without adding features” for me is that an ABI break
opportunity is “wasted.”

Sealing struct fields and removing deprecated stuff doesn’t much
increase the list of features that can be implemented without breaking
ABI. Most ABI breaks are semantic, not a technicality about a struct
field. Example: whether you have gtk_widget_get_window() or
((GtkWidget*)widget)->window, you still can’t get rid of the
GdkWindow, nor can you move GdkWindow creation out of realize().

Most features requiring an ABI break would end up in GTK+ 4.0, which
is in a long time. So the 3.0 ABI break will be “wasted” in that
sense.

I was kind of hoping for some things like killing all non-toplevel X
windows, or killing X11-centric GDK API in 3.0 … instead of waiting
for 4.0. That’s the part of the GTK+ 3.0 proposal that makes me a
little disappointed.

However: the sealed struct fields and deprecated-stuff-removal would
make it simpler to work on ABI-breaking features in a branch,
and simpler to maintain an ABI-incompatible device-specific or
platform-specific branch, I imagine. It would also be simpler to
automatically find all uses of a given field or behavior in a set of
apps, in order to update them. Maybe it’s ideal to have a bunch of
“4.0 candidate” feature branches over the next few years, eventually
merging them to ship 4.0 in five years.

I’m skeptical, as many others are, of claims that “cleaning
up code” or “removing deprecated stuff” are ends in
themselves… sometimes code cleanup is important, because the code is
still in active use, and it becomes impossible to make it correct or
understand it anymore. But the deprecated GTK+ widgets aren’t like
that; they are just sitting there untouched and are a cosmetic problem
at worst. They don’t significantly affect anyone who isn’t using them,
that I know of.

It bugs me when people act like deleting deprecated stuff is an end in
itself, without discussing what it enables. Even if deprecated stuff
is using up more than a few percentage points of maintainer time (is
it? I have trouble buying that), if the problem with it is
maintenance time, maybe the way to address that is to find some way to
pile another maintainer on, instead of disrupting all app developers.

Besides, the worst deprecated stuff was all kept out of GTK+
… there’s a bunch of free deprecated-stuff-ectomy still possible by
finishing Project
Ridley
.

Conclusion

I’m happy people are trying some new directions such as mobile and
GTK-as-true-cross-platform-toolkit. Ability to break ABI will be
needed for that work at some point.

To be clear:

  • I don’t know on balance what approach is best for 3.0.
  • I’m not doing the work, and those who are will/should
    decide on the future path.

Here’s to progress!

(This post was originally found at http://log.ometer.com/2008-07.html#16)

Error Codes

API design rule: error codes alone are not a reasonable way to report
errors.

You need a mechanism that can return a helpful string. Like
exceptions in most languages, or GError
in C. You can return an error code also, if appropriate.

A helpful string does NOT mean some generic string form of the error
code, as with strerror().

Here is an example from XPCOM (have to pick on someone, and this is
what I tripped on today):

Error: [Exception... "'Component does not have requested interface'
when calling method: [nsIFactory::createInstance]"  nsresult:
"0x80004002 (NS_NOINTERFACE)"  location: "<unknown>"  data: no]

Wouldn’t it be helpful to know which interface was requested, deep
inside the app someplace? I vote yes. But XPCOM doesn’t have exceptions with
messages, it has error codes. (The least helpful error code, of course, is
NS_FAILED. NS_NOINTERFACE is a little bit helpful.)

Any number of APIs manage to screw this up. X11 protocol:
guilty. SQLite: guilty. Cairo: guilty. OpenGL: guilty. I’m sure there
are dozens more.

All of the above leave programmers reading docs and tracing code to
figure out mysterious error codes, for errors that would have been
obvious given some more context in a string. In C, the function you use
to set/report/throw an error should take a format string like
printf(), so it’s easy to add context.

Unless you’re writing something very low-level and
performance-critical, like a system call, error codes are always
wrong. If an API is simple and well-specified enough, error codes can
be sufficiently clear. But, none of X11, Cairo, XPCOM, SQLite, or
OpenGL qualify for simple enough.

Error codes have one other nasty problem: people start to overload
existing codes to mean many different things, because they’re
reluctant to add new codes or because new codes would break ABI. This
is visible in UNIX system calls, X11, and of course any API with a
generic “FAILED” code.

(This post was originally found at http://log.ometer.com/2008-07.html#4)

Vegetable Box

Amy signed us up for a local community
supported agriculture
share this year, so we get a box of vegetables
every week. This first week the box contained strawberries, sweet
peas, bok choy, turnips, lettuce, spinach, cilantro, and a live basil plant.

We got the idea from The
Omnivore’s
Dilemma
and In
Defense of Food
.

The weekly box enforces quantity and variety of vegetables – we have
to come up with some way to prepare whatever shows up. If we eat the
whole box between the two of us, it’s a lot healthier than
whatever we were likely to eat otherwise.

It’s said to be good for the farmers and the environment also – the
idea is that the annual subscription gives farmers stable income at a
higher profit margin, and the food doesn’t have to be trucked in from
all over.

(This post was originally found at http://log.ometer.com/2008-06.html#23)