HNHacker News
TopNewBestAskShowJobs

DRMacIver

495 karma · joined July 4, 2009

submissionscomments
DRMacIver··on Exceptions for control flow considered perfectly acceptable
> This is like saying... be sure to never copy more bytes than the buffer capacity. Easier said than done.

A solved problem except when people insist on using approaches where it's not a solved problem? I couldn't agree more! :-)

firstly, the update example is a bait and switch. Partially updating an array is not inconsistent. It may be wrong depending on what the contract of the function says but that's but the same as inconsistent.

Indeed the example that prompted this article back when I wrote it many moons ago was a case where you wouldn't want the state restored

> In general, however, this is not sufficient since update may also have modified global variables and other objects on the heap

"Doctor! It hurts when I do this!" "Well don't do that then"

It's hard to write any correct code when you're mutating globals and arguments all over the place. Exceptions can certainly make this worse.

In general if you're not using globals or mutating your arguments this isn't a hard problem. If you are mutating arguments and you want to ensure a "restore all state if an exception is thrown behaviour then yes this is sometimes hard (unless your argument supports a rollback mechanism - e.g. it's a database) but I submit that a large part of why you haven't seen that is that it's a contract people don't care enough about to support

DRMacIver··on A Manifesto For Error Reporting
Yes, in retrospect I'm not sure I agree with this one as strongly as I wrote it. Perhaps better to say that you should log by default.

But that being said, problems that the code needs to fix may be symptoms and you may need them for debugging. I think they're worth logging more often than not. Maybe just less noisily than your normal error reporting.

DRMacIver··on A Manifesto For Error Reporting
I agree that this can be a problem.

I think a good default here is that if you don't know enough about what you should report, you should report as much as you reasonably can - for example if you can't say what's wrong with a value, at least say what that value was.

DRMacIver··on Exceptions for control flow considered perfectly acceptable
Do feel free to enlighten me.
DRMacIver··on Degrowth
No, but you can make decisions now which affect the rate of short term growth later.

Or to continue the calculus analogy, you divide your spending on growth between spending that increases the first derivative and second derivative of value. The former is current short term growth, but the latter may lead to more growth in the long term.

DRMacIver··on B2B Is Unsexy, and I Know It
So I've done a B2B company before and am doing one now (current place isn't intrinsically B2B but that's our main focus. It's certainly not something normal consumers would use).

I think this understates what incredibly hard work selling B2B can be. Large companies will pay you a lot of money, but are ridiculously high maintenance - they expect custom work on your product (often of the "Can you integrate it into our ActiveDirectory/Exchange/etc" form) and the sales process to them is incredibly long.

Small companies on the other hand are often strapped for cash and have weirdly distorted views of the value of their time - If what you're selling them is something they can "do now" by spending 3 hours of an employee per day it can make it very hard to convince them to pay you at a rate you'll be able to sustain a profit on.

Neither of these are impossible to overcome of course. People can and do do extremely well with B2B businesses. I just want to point out that there are real problems with selling B2B as well, and that it's not nearly as easy as it might sound.

DRMacIver··on Redis Sentinel beta released
Ah, I see. That makes sense. Thanks.
DRMacIver··on Redis Sentinel beta released
> a known bug in the hiredis library that can make Sentinel crash from time to time, but it's not a problem with Sentinel itself

Surely if a bug in a client can crash your server that's a bug in the server by definition even if the client is also buggy?

DRMacIver··on Programming Languages: What tool is right for which job?
Eh, site's held up to hacker news 4 or 5 times in the past. Never been a problem before.

It's been around for two years slowly bitrotting (I really should do some maintenance on it). Just gradually been getting slower and this time it hit the threshold where it was too slow to stay up. It happens.

DRMacIver··on Programming Languages: What tool is right for which job?
Should be running (a bit) better now, though likely still on the slow side.

Turns out a query I'd written back when there were 20k votes in the system didn't perform so well now that there are 200k votes in the system. Go figure.

DRMacIver··on Programming Languages: What tool is right for which job?
Sorry the site's having issues. I haven't done any significant work on it in most of two years and there's rather a lot more data in it than when I actually worked on it.

So, yes, it's true, I haven't used the right tool for the job. Except that as with so many things "the right tool" is "an actively maintained codebase". Looking into why it's crashing now, but don't expect any miracles

DRMacIver··on Notes on design of a Haskell API
A neutral title seemed the way to go. :-)

On the one hand, the process was pretty irritating. On the other hand most of the issues are ones I'd probably catch if I were to repeat the experience (which is why I thought it worth writing about), and the end result was pretty acceptable. All in all a fairly neutral experience.

DRMacIver··on The (Programming Language) Hat
I know. I actually keep meaning to properly learn perl (I can just about read it and don't really bother using it for one liners as I tend to find joe-random-scripting language + sedawk cover enough bases).

But when one prefaces a post with "You know what we haven’t had in a while? An irritating but catchy meme in which we shallowly compare programming languages based on superficial characteristics. Those are awesome" people who take it seriously deserve what they get :-)

DRMacIver··on The (Programming Language) Hat
Contains just about everything, so I don't have to come up with a specific justification for the comparison. ;-)
DRMacIver··on The (Programming Language) Hat
If programming languages were hacker news comments this one would be common lisp.
DRMacIver··on A “perfect” voting system
Thanks. I've only just got around to watching these, and they're really very good.
DRMacIver··on A “perfect” voting system
Hmm. I'm not sure I believe that. I'm not sure I don't believe that either mind you. Consider the following questions:

* If they're willing to do anything to stay in power, why were they running for a minority party in the first place?

* How likely are the voters to use their single vote to vote for someone who is still running as kitten party but is acting like a watered down version of the people they actually want to vote for?

DRMacIver··on A “perfect” voting system
As a side note, this does not directly address the problem proposed by Arrow's theorem, although it could easily be made to do so, but the post isn't so interesting in that context. It's more about how it interacts with a constituency system.

If you want a randomised solution to Arrow style preferential voting, the following is the best I currently know of:

1. If you have one candidate, stop. That candidate is elected.

2. If you have more than one candidate, pick a candidate at random. Call that candidate Pivot. Every candidate who the majority thinks is worse than Pivot drops out of the race. If there is no one the majority thinks are worse than Pivot, Pivot drops out.

3. Goto 1.

Edit: Err. Correction. That's an algorithm for selecting a single winner from Arrow style preferential voting. It's based on an only slightly more complicated one for giving you the full range though.

DRMacIver··on A “perfect” voting system
Both of which terms are explicitly used in the article. :)

However this is not a sortition. It's an application of random-dictator to the problem of electing a per-constituency representative. This turns into a sortition only in the degenerate case where everyone runs and votes for themself.

DRMacIver··on A “perfect” voting system
It's worth noting that the consequences of random election are not "the crazy party gets into power". It's "the crazy party gets a couple of seats". The chances of someone with even 5% of the election are astronomically low (http://twitter.com/johnmyleswhite/status/62863260566827008 - the probability of someone with a 5% minority getting the majority over the course of 50 elections).

The likely scenario here is that your crazy party gets 1, maybe 2, seats at the worst and promptly demonstrate themselves to be incompetent tools, spoiling their chances of reelection.

DRMacIver··on A “perfect” voting system
> Not only would this rob the legislature of experience,

I'm not sure it does, or at least not drastically: It robs the legislature of individual experience, but on average there's no reason you'd expect each politician to be in for the first time. They could even rerun later.

> it would also mean politicians towards the end of each term would be focused on securing their next job, rather than performing their current one.

This is a really easy problem to solve: You give a recently ousted MP a paid vacation after their term is up.

(This works better of course if you stagger elections rather than electing everyone at once, but it's fine without)

DRMacIver··on A “perfect” voting system
You know, this is a much better way of doing it.

I feel like for a complete idiot for not spotting that up front.

DRMacIver··on A “perfect” voting system
> It seems we've argued over different things.

That happens with annoying regularity. I have a system for dealing with that too, but that's a different blog post. ;-)

> I picked up the "perfect" from the headline and came up with a counter-example.

Well there's a reason "perfect" is in scare quotes. If I really thought the system were perfect I'd actually be advocating it instead of going "Hey guys, here's a neat idea. I'm not really sure if I'm actually for it or not".

The meaning of perfect here was intended to be that it has a lot of the properties which many people claim are impossible to coexist and summarise under the heading "there is no perfect voting system" (it overcomes the impossibilities by being non-deterministic), whilst remaining very similar to the existing and familiar system

DRMacIver··on A “perfect” voting system
The proposal someone provided on my blog was that you should require X signatures for a nomination. e.g. if you have a constituency with 10,000 people and you want 10ish candidates require 1000 signatures for nomination.
DRMacIver··on A “perfect” voting system
It's worth noting that this solution utterly blows the safe seats problem out of the water. This is probably my favourite feature of it.
DRMacIver··on A “perfect” voting system
I sketched a process for how this could work in a blog comment: http://www.drmaciver.com/2011/04/a-perfect-voting-system/com...
DRMacIver··on A “perfect” voting system
I agree completely, but you've not argued convincingly for this one being a more broken system. The current one is guaranteed unfair, this one is expected-fair even if the unfairness may be geographically concentrated.
DRMacIver··on A “perfect” voting system
How do those who currently get 40% of the vote and 10% of the seats feel? I'm guessing pretty cheated.
DRMacIver··on A “perfect” voting system
> I'm slightly confused about voting multiple people for a larger area. Is this PR, or something else good?

It may or may not be PR. It depends on how you elect those multiple people: They may be elected under a PR system, or they may be elected under something non-proportional.

I'm for PR in general. I'm not sure how I'd feel about a PR-per-constituency approach.

DRMacIver··on A “perfect” voting system
Yes. Agreed. I suspect it would be ridiculously hard to get this through (witness how much trouble we're having with IMO the far less controversial AV), 'though with the right framing and a sufficiently disgruntled populace I could see it happening. Maybe. Not going to hold my breath though.
← PreviousPage 4 of 5Next →