Hello HN,<p>I have been writing python code (for Deep Learning/ Computer Vision) for almost 4 years professionally. However, I haven'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'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't get those review comments anymore. However, the feeling that my code is just simple and dumb doesn't go away. Some say it'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 / practices / exercises / whatever, that would really be helpful. Thanks in advance.
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's easy to read and understand (thus maintainable).<p>A good question to ask is also "What happens when X goes wrong?". 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/ML field production grade code doesn'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'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'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.
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's in C and in Go. It'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's comments are.