this post was submitted on 10 Sep 2026
-14 points (11.1% liked)

Programming

28458 readers
269 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 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] vrek@programming.dev 3 points 3 days ago (1 children)

In my experience code review is often about the logic rather than the code itself. For example do you really need to copy the whole user object just to read their username? Can't you just pass the username in as a string instead? Static validation and test suites should already of eliminated any code errors. If you show up to a code review and the code doesn't compile, you're going to have a bad time. Stuff like calculating the same distance between two objects multiple times should be called out in code review, maybe extract that into a function. Reaching out to a database to get the same value repeatedly should be called out, maybe store it as a local variable.

One time I was reviewing some code which interfaces with an external third party piece of hardware which the api required the serial number for licensing. The programmer hard coded the serial number into the code. If we swapped it due to hardware malfunction we would need to update the software. If we got a second one we would need to maintain two code bases. This should be in a configuration file or something. Ai will not catch that. Static testing won't catch this. Test suites running on the piece of hardware we had, wouldn't catch this. Only a human reviewer would.

[–] MonkderVierte@lemmy.zip 1 points 3 days ago (1 children)

Ai will not catch that. Static testing won't catch this. Test suites running on the piece of hardware we had, wouldn't catch this. Only a human reviewer would.

This explains a lot of lsecurity issues in the last few years.

Also, can't compilers catch that and complain?

[–] vrek@programming.dev 1 points 3 days ago (1 children)

Well basically it's just a 'magic number'. If you ban all of those many programs will either break or at minimum suffer sever performance degradation.

[–] MonkderVierte@lemmy.zip 1 points 2 days ago

Not ban, warn about fixed string assigned to variable. Ok, guess that would be hard to distinguish on compiler level.