this post was submitted on 01 Sep 2023
337 points (96.2% liked)

Programming

17364 readers
254 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 [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 41 points 1 year ago (28 children)

Go with what works

Error messages should contain the information that caused the error. Your average Microsoft error "error 37253" is worthless to me

Keep functions or methods short. Anything longer than 20 - 50 lines is likely too long

Comment why is happening, not what

PHP is actually a really nice language to work with both for web and command line utils

Don't over engineer, KISS. Keep It Simple Stupid

SOLID is quite okay but sometimes there are solid reasons to break those rules

MVC is a PITA in practice, avoid it when possible

[–] Omgpwnies -2 points 1 year ago* (last edited 1 year ago) (2 children)

Your average Microsoft error “error 37253” is worthless to me

This is a security thing. A descriptive error message is useful for troubleshooting, but an error message that is useful enough can also give away information about architecture (especially if the application uses remote resources). Instead, provide an error code and have the user contact support to look up what the error means, and support can walk the user through troubleshooting without revealing architecture info.

Another reason can be i18n/l10n: Instead of keeping translations for thousands of error messages, you just need to translate "An Error Has Occurred: {errnum}"

[–] [email protected] 4 points 1 year ago (1 children)

Those benefits both make sense, but are those really the original motivation for Microsoft designing the Blue Screen of Death this way? They sound more like retroactive justifications, especially since BSODs were around well before security and internationalization were common concerns.

[–] [email protected] 3 points 1 year ago

Linux has something similar, kernel panics. However, with Linux you get useful information dumped on your screen.

Nothing gets logged on Linux either, just like windows and that makes sense. The kernel itself messed up and can't trust its own memory anymore. Writing to disk may cause you to fuck up your disk, so you simply stop everything.

Still though, Linux dumps useful info whereas windows just gives you this dumb useless code.

[–] [email protected] 0 points 1 year ago

Not when it's my own computer. My computer needs to give me useful messages.If it's a website then the site MUST log correctly in the log files...

If it's a translation issue then just use English, everyone that can understand logs can (or at least should) understand that

load more comments (25 replies)