Recent submissions

Comment · 13 years ago
I hope you never find yourself in a situation where you need medical care and can't pay for it. Because the rest of us, who are in possession of at least a few scraps of human decency, would have to shell out to save your ungrateful ass.

A human life is worth more than its economic output.

Comment · 14 years ago
Comment · 14 years ago
But when the model is accessed from four different controllers representing different privilege levels (e.g. public profile page, user settings page, internal admin page) and user experiences, is it really still the model's job to figure out which incoming updates are allowed to update which fields?

This is "thin controllers" gone too far -- the model shouldn't have to figure out where it's being updated from and what to allow.

Comment · 14 years ago
To defend myself here (a day later), I was not assigning the causality in that direction. The "Because I took care of them" clause goes with the "I get to keep them", as in "I made sure to clean them and not let them get cavities, so there aren't any problems with them staying around". I thought the English was clear enough as I wrote it, but I guess parse errors are more common than I thought.
Comment · 14 years ago
My wisdom teeth actually fit in my mouth. Because I took care of them (and the rest of my teeth) as they started growing out, I get to keep them.

Dentists far too often recommend extraction for wisdom teeth when it's unnecessary, probably because they can charge a hefty fee for it.

Comment · 15 years ago
The key here is that you aren't sampling the same uniform distribution each time. You shrink the sample space by one each time you remove a card and append it to the end.
Comment · 15 years ago
It's not a subset of static typing at all.

If multimethods were a subset of static typing, then regular methods would be too. Methods are dynamic by definition: the type of the method's target is inspected at runtime and used to dispatch to the correct function entry. In Python, it's explicitly stated because the first argument of all object methods is "self". Multimethods extend this to do dynamic dispatch on all argument types, not just the target object.

Most Python object methods are declared at compile time; this doesn't make method declaration a "subset of static typing". You can add new methods to classes and objects at runtime using Python's reflection and introspection; you can just as easily add new multimethods at runtime using this framework.

Finally, the @decorator(...) syntax at compile time is just syntactic sugar for something like the following:

  def _foo(self, arg):
    ...
  foo = decorator()(_foo)
So you can use decorators at runtime whenever you want too.
Comment · 15 years ago
Begin blocks execute during compilation, immediately after they've been parsed. They're compiled themselves, and execute within the Perl interpreter before it finishes compiling the rest of the containing module. So they don't really execute prior to all compilation, but they execute prior to the compilation of anything sequentially after them in the source.
Comment · 15 years ago
There should be more of it.
Comment · 15 years ago
I remember being shown call/cc briefly in CS 61A at Berkeley and then forgetting about it until recently when I saw an article on it while I was in the middle of writing an event-driven web application using Perl and Plack. I immediately saw how useful it would be and wished I had it available to use there.
Comment · 15 years ago
COME FROM is the reason INTERCAL is among my favorite esoteric programming languages. That and the fact that its name is for "Compiler Language With No Pronounceable Acronym".

From Wikipedia: An actual example in INTERCAL would be too difficult to read

Gotta love it.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton