Live data from Hacker News

If it's a nice problem to have, don't solve it now

davidnicholaswilliams.com

21–30 of 71 posts

Re: If it's a nice problem to have, don't solve it now

#21

I think this is great advice, but hard to apply or understand if you‘ve never actually had nice-to-have problems. I can totally relate to those rabbit-hole kind of problems that only feed the procrastinator in me.

> I can totally relate to those rabbit-hole kind of problems

Exactly the mechanism that this question aims to address!

Re: If it's a nice problem to have, don't solve it now

#23

The problem with issues like this is that this is patch development. If you don't look a couple steps ahead and at least think through your "nice to have" problems, you might end up getting the architecture wrong. The password reset problem might drive you to find an authentication library instead of rolling your own. Suddenly, your "nice to have" problem is fixed before you get to it, because you decided to look at…

My instinct is to agree with you, but with my practical instinct-taming hat on, I reckon you could have between thousands and tens of thousands of monthly active users (depending on demographic - how likely they are to need reset) before taking a phone call to reset it manually in db would be burdensome.

And between 0 and that many users you could have all sorts of other reasons for rethinking your authentication architecture, nevermind whether home grown or third-party library.

Re: If it's a nice problem to have, don't solve it now

#24

Just to push back a tiny bit on this, sometimes nice problems can turn into nasty problems very quickly. "My customer data isn't backed up", is a nice problem to have when you're just launching a new service and don't have any customers. But it's still a problem you'd probably like to solve relatively early. There won't be a moment where missing backups are an immediate problem but also still easily solvable; they're…

"My customer data is too big to back up with an rsync cron job" is a nice problem to have.

"My customer data isn't backed up" is a stupid problem to have, and if your friends and coworkers aren't stopping you, then you need a better class of friends.

Re: If it's a nice problem to have, don't solve it now

#25
post #18

The problem with issues like this is that this is patch development. If you don't look a couple steps ahead and at least think through your "nice to have" problems, you might end up getting the architecture wrong. The password reset problem might drive you to find an authentication library instead of rolling your own. Suddenly, your "nice to have" problem is fixed before you get to it, because you decided to look at…

I'm curious, what's the right alternative to having an email and password columns in a "customers" table?

As one example, Django's auth framework gives you a users table which it manages. You would set a foreign key column from customers to users.

I believe the point of GP was to say "use an auth framework". If you're rolling your own auth, then your approach is fine.

Re: If it's a nice problem to have, don't solve it now

#26
post #18

The problem with issues like this is that this is patch development. If you don't look a couple steps ahead and at least think through your "nice to have" problems, you might end up getting the architecture wrong. The password reset problem might drive you to find an authentication library instead of rolling your own. Suddenly, your "nice to have" problem is fixed before you get to it, because you decided to look at…

I'm curious, what's the right alternative to having an email and password columns in a "customers" table?

In addition to the sibling answer of "use a framework"; if you simply stick passwords in a database, and the database gets stolen, you've now leaked your users' passwords. So you should hash the passwords, and they should be salted, so now you need a `salt` column. Most people use too cheap a hash function, so this is an additional argument for using a library / framework.

Re: If it's a nice problem to have, don't solve it now

#27
post #26
post #18

Earlier quoted context omitted.

I'm curious, what's the right alternative to having an email and password columns in a "customers" table?

In addition to the sibling answer of "use a framework"; if you simply stick passwords in a database, and the database gets stolen, you've now leaked your users' passwords. So you should hash the passwords, and they should be salted, so now you need a `salt` column. Most people use too cheap a hash function, so this is an additional argument for using a library / framework.

Umm, but using bcrypt to hash the passwords is just a couple of lines of code (at least in Go); I'm wondering if I'm doing things wrong by not using a dedicated framework.

Re: If it's a nice problem to have, don't solve it now

#28
This can be used to justify any kind of crap being shipped in newly introduced features, merely baring regressions.

Therefore I don't value the approach as presented here. But a sane variant could be interesting: anyway I suspect it will need domain specific judgment, preventing from throwing a nice universal rule of thumb to the world.

Re: If it's a nice problem to have, don't solve it now

#29
post #27
post #26

Earlier quoted context omitted.

In addition to the sibling answer of "use a framework"; if you simply stick passwords in a database, and the database gets stolen, you've now leaked your users' passwords. So you should hash the passwords, and they should be salted, so now you need a `salt` column. Most people use too cheap a hash function, so this is an additional argument for using a library / framework.

Umm, but using bcrypt to hash the passwords is just a couple of lines of code (at least in Go); I'm wondering if I'm doing things wrong by not using a dedicated framework.

No, that's fine :) It wasn't clear to me from your original comment whether you were hashing passwords, apologies.

Re: If it's a nice problem to have, don't solve it now

#30
This can also be summarized as "Early on, don't be afraid of doing things that don't scale".

In this particular example, my "reset password" functionality could be sending me an email, and I have to reset the password manually and email you a temporary one that you can use. Bad solution? Yes. Doesn't scale? Of course. But if you have 5 customers it's not a big deal and you can use your time on something else.

The key here is to have good people in the team. A decent Senior Engineer / Architect would know that 'Reset password' will be needed. That is why a very technically solid person is gold in the first round, because they can design the signup in such a way that it's prepared for future requirements. They of course would also know that you can't store in plain text, that it should be hashed, that you might have to use a vault, that you need to randomize the hash, and that in the future limit access to the "user" table and never ever expose it through an endpoint where a user can reach it, as well as protecting against XSS and SQL injections.

Which of the list above goes off the list? There is a balance there in getting the right solution without scope creep, but also not implementing something so silly that it's going to get you into trouble later. The genius of a competent person is being able to tell what needs to be solved now vs. later

Post reply on HN