Recent submissions

Comment · 9 years ago
One suggestion you can make to the founders is early exercise. Some companies offer this. That at least gives the employer the benefit that people put money on the table and "invest" in the company by buying their options before they vest. It shows some belief and financial commitment.

Of course, in a very early startup, that investment might be so small they won't care, and there's a tax implication for the employee you'll want to be aware of.

Comment · 9 years ago
Comment · 9 years ago
Possibly, like driving for Uber/Lyft, shopping for Instacart or dogwalking in the time between since they have their own cars at the depot.

But the problem would still be the extremely long day. Ending with them having to drive a bus at the end of the shift, utterly exhausted.

Comment · 9 years ago
Robert, I think it's great you comment here now and then. It's awesome to occasionally get access to the original authors of erlang.

The proposed refactor in the article doesn't look like idiomatic erlang to me. How would you refactor the code in the article?

I'd do something like this;

  validate(_DbConn, {error, Reason}) ->
    {error, Reason};
  validate(DbConn, #req{body = ReqJsonStr}) ->
    validate(DbConn, json:decode(ReqJsonStr));
  validate(DbConn, {ok, #login_request{username = Username, password = Password}}) ->
    validate(DbConn, {hash_password(Password), db:find_user(DbConn, Username)});
  validate(_DbConn, {HashedPassword, {ok, #user_details{username = Username, hashed_password = HashedPassword}}}) ->
    % Hashed password matches the found user record hashed password
    % by the power of function pattern matching.
    {ok, "hello " ++ Username};
  validate(_DbConn, {_HashedPassword, _UserLookupResult}) ->
    % Hashed password did not match or user not found.
    {error, "wrong name or password"}.
Splitting into exported and "private" functions in module would leave a less messy api. This simply removes the case usage, coupling, highlights function pattern matching and makes for easily testable small functions.
Comment · 10 years ago
Comment · 12 years ago
Obligatory joke about danish summers goes here.
Comment · 12 years ago
Did your drivers ed/school teach you how to drive with a hood that's flipped up at highway speed? Mine didn't, then it happened to me.

(but yeah you're right)

Comment · 12 years ago
I worked for Andy Hertzfeld once, it was awesome in many ways, but the anecdotes... so good.
Comment · 12 years ago
Comment · 12 years ago
You wouldn't want to rely on a happening upon a cargo ship anyway. You'd rely on an EPIRB.
Comment · 12 years ago
Amex has a credit card called Blue Sky. Now I kind of want one.
Comment · 16 years ago
I'm having flashbacks to the nineties and working with CORBA and it's C bindings.

"Those who do not know history are doomed to reinvent CORBA_Environment."

(Although there are few new details, such as the aborting if the dtor determines it wasn't checked.)

Comment · 16 years ago
What's the type for "can't be bothered with personality tests" ?

If you were a pizza, which topping would you have ?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton