this post was submitted on 14 Mar 2024
82 points (97.7% liked)
Programming
17492 readers
44 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
All the other comments are great advice. As an ex chemist who does quite a bit of code I'll add:
Do you want code that works, or code that works?! It's reasonably easy to knock out ugly code that only works once, and that can be just what you need. It takes a little more effort however to make it robust. Think about how it can fail and trap the failures. If you're sharing code with others, this is even more important a people do 'interesting' things.
There's a lot of temporary code that's had a very long life in production, this has technical debt... Is it documented? Is it stable? Is it secure? Ideally it should be
Code examples on the first page of Google tend to work ok, but are not generally secure, e.g doing SQL queries instead of using prepared statements. Doesn't take much extra effort to do it properly and gives you peace of mind. We create sboms for our code now so we can easily check if a component has gained a vulnerability. Doesn't mean our code is good, but it helps. You don't really want to be the person who's code helped let an attacker in.
Any code you write, especially stuff you share will give you a support and maintenance task long term. Pirate for it!
Code sometimes just stops working. - at least I'm my experience. Sacrifice something to the gods and all will be fine.
Finally, you probably know more than you think. You've plenty of experience. Most of the time I can do what I need without e.g. classes, but sometimes I'll intentionally use a technique in a project just to learn it. I can't learn stuff if I don't have a use for it.
I'm still learning, so if I've got any part of the above wrong, please help me out.
"Pirate for it" was probably the wrong phrase. "Plan for it" was probably what you were thinking when your fingers did something else.
Thought I did so well on my phone. It kept auto correcting code to coffee. Maybe it was telling me something.
Yes, plan for it!