Live data from Hacker News

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

news.ycombinator.com

151–160 of 209 posts

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

#151
By the time things have been reduced to "best practices" the intellectual rush of discovery has been cooked out. If you a still fishing for best practices: experiment, make mistakes, fix, learn how things work, run tests, try things that make sense first, talk through problems with smart friends, and enjoy the fruits of discovery. It is often helpful to find a mentor, someone who can help structure the search for "best practices" and who will give advice.

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

#154

Don't worry about good code at a startup. Worry about building something people want. Once you hit hockey stick growth you can hire the technical talent.

I think this depends on the type of the product. It's important that the team allows and finds the right spot to restart with more focus on architecture and code quality to not loose motivation of later employees

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

#155

Don't worry about good code at a startup. Worry about building something people want. Once you hit hockey stick growth you can hire the technical talent.

>>Don't worry about good code at a startup.

Totally depends on the startup. Building a new blog engine? Sure, go wild. Making financial software? You need to be very careful, and write good, secure code.

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

#157
My advice would be not to worry about this too much at this phase. A lot of "best practice" is institutional and has to do with how the stack/org/community is structured. There's not a lot that's "best practice" in a vacuum. In terms of stuff that would be considered best practice in a vacuum, you can maybe look at some of the classic stuff like Code Complete, or any of the TDD or pattern books.

Other people have mentioned that "best practices" can be a double edged sword. Software engineering is very varied and it's hard to abstract out "best practices" that apply in all situations. Don't get blinded by "principles" and evaluate each technical situation on its own merits and weigh the tradeoffs of the solutions you can think of before proceeding. There are way too many variables for you to have a playbook that reads "in x situation do y" most of the time.

With regard to best practice being institutional, you'll formulate a lot of it on your own as the org grows (if it does.) For example, having code reviews would widely be considered a best practice across the industry, but in your situation it is obviously not reasonable. Who would review your code? You? Lots of institutions have style guides for software engineers (I would consider this a best practice) to keep software easily readable to as many team members as possible. In your situation, what engineers are you trying to keep on the same page? None? In your case, this is then not a useful best practice.

There are community best practices that sometimes spring up around quirks of the language and its tooling. I would say the best way to deal with the first is to use a lint. That will teach you a lot. The second is something you usually have to get bitten by to find out.

Finally, read a lot of code in your language/framework of choice (critically of course.) You'll learn a lot of tricks, and will also see a lot of traps to avoid by doing this. If you're in Node, reading the source to Express is probably a good place to start and is obviously applicable to your work (and can only pay dividends in that respect.)

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

#158
post #143

Conference Youtube videos. They are a goldmine of useful tips and tricks. Go look for videos from the Node [1] and MongoDB [2] conferences and you will find tons of war stories and what is actually working for people. Using this option arguably connects you directly with some of the best people in the world who are actually using this stuff. ps. using the youtube 2x playback speed option can really help digest lots o…

I would say do not look to conference videos for how to write production quality code... Most talks at conferences are shallow and at worst just the blind leading the blind. Be very careful, I've even seen people from places like Microsoft showing code at conferences that would fail even a decent code review process. I think for this reason conferences are a complete waste of time. Talks are too short to go into anyt…

You must be fun at parties.

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

#159

Earlier quoted context omitted.

Neither did the first person to encounter it, but they figured it out anyway. There is no magic one-size-fits-all process for this.

What are the chances that you are as smart as the people who figured it out decades ago?

Problem solving doesn't work like that. Many comparable issues have been found and solved by different people at different times, in parallel, unknown to each other.

With as many people as we have on Earth it is unlikely that one special unique problem can only be solved by one special unique person. While it might happen, it's unlikely to happen to a software developer at a small company. The problems and solutions you find there are often relatively comparable or even generic, and are found and solved by many people in parallel at the same time. While working together might be faster, it has nothing to do with the feasibility of detecting and repairing issues.

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

#160

I did a quick control-f "read" and almost everyone is telling you to read books or articles about best practices. That might be useful once as a highlevel overview when getting started on a topic, but my personal advice is to only do that briefly. You'll get the most bang for your buck READING CODE. There is no better way to improve as a developer than reading good code. Reading articles and books will teach you thin…

Yes, this. Read lots of code. Ask why they choose that implementation. Read their bug reports.

It'll soon become obvious which ones are good codebases and which ones aren't.

Post reply on HN