News for hackers. Stuff that matters.

eskil

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.

Re:Performance of idiomatic Elixir code on Monday January 30, 2017 @01:12PM (#13523577)
Here's a relevant post from Basho about that and their take on it. http://basho.com/posts/technical/erlang-at-basho-five-years-...
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.

Re:Erlang encourages poor Functional Design on Friday January 13, 2017 @08:24PM (#13396265)
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.
Re:An earth-cooled beer dispenser on Friday May 23, 2014 @11:27AM (#7789741)
Obligatory joke about danish summers goes here.
Re:Gimli Glider on Thursday May 01, 2014 @08:16PM (#7683451)
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)

Re:-2000 lines of code on Wednesday April 02, 2014 @05:38PM (#7519245)
I worked for Andy Hertzfeld once, it was awesome in many ways, but the anecdotes... so good.
Re:Show HN: Luculent, a new code/terminal font on Friday March 07, 2014 @04:57PM (#7363011)
Mensch, an older code/terminal font. http://robey.lag.net/2010/06/21/mensch-font.html
Re:Rolls-Royce Drone Ships Challenge $375B Freight Industry on Tuesday February 25, 2014 @01:45PM (#7299532)
You wouldn't want to rely on a happening upon a cargo ship anyway. You'd rely on an EPIRB.
Re:Here is a thing that happened on Saturday February 22, 2014 @10:12PM (#7284769)
Amex has a credit card called Blue Sky. Now I kind of want one.
Re:Exploding Error Codes (C++) on Wednesday November 10, 2010 @09:55AM (#1890455)
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.)

Re:HN Poll: What is your personality type? on Thursday September 09, 2010 @01:41PM (#1676159)
What's the type for "can't be bothered with personality tests" ?

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