TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to write production-grade code?

5 点作者 actbsh大约 1 年前
Hello HN,<p>I have been writing python code (for Deep Learning&#x2F; Computer Vision) for almost 4 years professionally. However, I haven&#x27;t worked close to a production system so far but would need to in my new position. I want to understand what it means to write production-grade code?<p>So far, my understanding tells me of<p>- <i>Language specific or even general code style guidelines</i> - check<p>- <i>Logging and exception handling</i> - check<p>- <i>Tests</i> - check but not always and could be more comprehensive<p>Still, I feel like I don&#x27;t craft quality code. I have ofcourse received feedback from team members over the time and have incorporated those into my work so that I don&#x27;t get those review comments anymore. However, the feeling that my code is just simple and dumb doesn&#x27;t go away. Some say it&#x27;s a good thing but most code I come across, say libraries I use, are just different in terms of abstractions, language features they use and whatnot while mine looks like something written by a highschooler (imo)<p>So, if the more experienced among you could suggest some resources &#x2F; practices &#x2F; exercises &#x2F; whatever, that would really be helpful. Thanks in advance.

3 条评论

Shinmon大约 1 年前
This is experience and learning from each other.<p>Sure, there are general guidelines that can be applied in many cases (testing, keep it simple, ...). However, many things depend on the company and the team you are working in.<p>A lot about production grade code is also to make sure it&#x27;s easy to read and understand (thus maintainable).<p>A good question to ask is also &quot;What happens when X goes wrong?&quot;. What happens to the system in general, how critical is it, and how can you understand what happened. This is about logging and moire general observability.<p>In the AI&#x2F;ML field production grade code doesn&#x27;t necessarily mean that you need to have super abstract things. A lot of this is actually the MLOps part: getting the data to your model, saving the model in some artifactory, running inference, ... . To make this easier it&#x27;s most important that your code is somewhat modular and not just a plain script that you run when you need it.<p>Also, don&#x27;t be to hard on yourself. Your last two lines sound a lot like imposter syndrome. Look back at your code from 4 years ago and see how it has changed and how much you have learned.
rudasn大约 1 年前
If you want to write you first need to read.<p>You can go through the django source code, documentation, pull requests, mailing lists, tickets, and find all you need to produce serious software.<p>WireGuard too, but that&#x27;s in C and in Go. It&#x27;s a lot of fun seeing how the guys from tailscale submit patches to the wireguard-go library, and how brutal (in the best possible way) Jason&#x27;s comments are.
评论 #39996403 未加载
hayertjez大约 1 年前
If you have found a good resource about Logging and Exception handling let me know.