Live data from Hacker News

Ask HN: How to learn best practices when you have no one to teach you?

news.ycombinator.com

81–90 of 209 posts

Re: Ask HN: How to learn best practices when you have no one to teach you?

#82

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

That really doesn’t help. How do you know that what you are doing is a “mistake” if it works? 10K line UserManager classes “work”. That’s how you get the “expert beginner”. https://daedtech.com/how-developers-stop-learning-rise-of-th... The only feedback you get as a sole developer are your compiler and errors in production. You would never know that it isn’t a good idea to write your own AcmeDatabaseManager or AcmeL…

> How do you know that what you are doing is a “mistake” if it works?

Because it hurts.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#84

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

That really doesn’t help. How do you know that what you are doing is a “mistake” if it works? 10K line UserManager classes “work”. That’s how you get the “expert beginner”. https://daedtech.com/how-developers-stop-learning-rise-of-th... The only feedback you get as a sole developer are your compiler and errors in production. You would never know that it isn’t a good idea to write your own AcmeDatabaseManager or AcmeL…

> How do you know that what you are doing is a “mistake” if it works?

It's a good question, one that's a good nod towards the principle that you will inevitably learn more slowly if your own mind is the only one you have to work with (and lately I've been thinking about how I can get in a professional position where I'm near the bottom end of the intelligence and/or domain knowledge range in the room for this very reason).

But one answer might be: you'll know. "Works" is shorthand for satisfying a certain set of expected conditions. There's a core of reliable behavior in the software that's the minimal working definition of "works" ... but there's also the question of relative ease when it comes to reading, understanding, and changing/augmenting the code you have, or how the code "works" as an expression of the system for the purpose of presenting an interface to the developer.

Chances are pretty good you know the feeling of writing something that you either (a) are uncertain is really adequate as far as the developer experience goes or (b) you know is probably not adequate but seems to get you to the minimal definition of "works" fastest.

Listen to that feeling. Interrogate it. Try something different. Observe the tradeoffs.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#85

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

Actually this it's a good advice. For me 5 years worked.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#86

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

That really doesn’t help. How do you know that what you are doing is a “mistake” if it works? 10K line UserManager classes “work”. That’s how you get the “expert beginner”. https://daedtech.com/how-developers-stop-learning-rise-of-th... The only feedback you get as a sole developer are your compiler and errors in production. You would never know that it isn’t a good idea to write your own AcmeDatabaseManager or AcmeL…

I'd argue it's not a mistake if there are no visible consequences.

If you get a production bug that takes a week to fix because the code is a mess you feel it. If adding simple new features is a pain, you feel it.

Now, of course, you might want to skip that, by learning from others, but OP is suggesting that you make your own mistakes.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#87
Advocate for time, the time you'd spend making those mistakes is going to be a loss on the company compared to convincing your manager (or their manager) to allocate some of that senior dev time to mentorship. This isn't about walking you through tickets step-by-step but make sure that you get smallish tickets in these new areas of tech and ask your co-workers to vet your work (this usually happens in the form of a PR review).

Most (really, honestly, most) developers are interested in the way they do things and aren't opposed to teaching new people the ropes, so I don't think it's unlikely that you'd be able to get this through.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#88

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

That really doesn’t help. How do you know that what you are doing is a “mistake” if it works? 10K line UserManager classes “work”. That’s how you get the “expert beginner”. https://daedtech.com/how-developers-stop-learning-rise-of-th... The only feedback you get as a sole developer are your compiler and errors in production. You would never know that it isn’t a good idea to write your own AcmeDatabaseManager or AcmeL…

You've triggered my PTSD with the phrase "UserManager class". Seriously, OOP can be such a foot-gun sometimes. Dozens of wrapper classes and manager classes might be the sign of a cluttered mind.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#89

1. Make lots of mistakes. 2. Experience pain in the form of late, buggy software and angry clients. 3. Read books and work on side projects. (Martin Fowler’s were my favorite). 4. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2. You probably think I'm kidding...

That really doesn’t help. How do you know that what you are doing is a “mistake” if it works? 10K line UserManager classes “work”. That’s how you get the “expert beginner”. https://daedtech.com/how-developers-stop-learning-rise-of-th... The only feedback you get as a sole developer are your compiler and errors in production. You would never know that it isn’t a good idea to write your own AcmeDatabaseManager or AcmeL…

You're going to want to follow the best practice, that no file should be longer than 2 lines of code. One line for imports/requires. One line for a massive one liner.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#90
"Best practices" is a bit of a red herring. Every company differs considerably, and online blogospher experts throw the term around as sort of a gatekeep-y way to keep the order ("What do you mean you don't know (arbitrary) best practices??!?!") The only way to learn best practices is to work at multiple companies / projects.

For example, I worked at Intel, Lucent, Apple and DEC. Each one had significantly different "best practices". When I look at how we did code there vs something like, oh, the GNU project, they were WORLDS apart. So even if you made the claim, you'd still fall short from the new environment.

If you're lucky, eventually YOU'LL be the one defining best practices.

Post reply on HN