@puppygirlhornypost I actually prefer assert and stop over working with borked data.
Recovering database inconsistencies after a problem that could have been prevented by checking are always so annoying.
There are better ways to handle a problem of course than just asserting, but its leagues better that not checking all the thing and working with wrong data.
@4censord Oh yeah no I hate silently failing in the background as everything becomes increasingly more mangled. I would prefer an application kill itself to prevent corrupting things further.
@puppygirlhornypost database software is a great example.
Flip a bit in an essential file, and on next access everything holds with a message "this is wrong, bailing. All active transactions will be rolled back, please fix manually"
@4censord yeah and if a query fails for something that you're trying to load you don't really need to continue just display the database error to the user.
@4censord As a user of software I unironically hate it more when I just see the failing to load spirals, no placeholders, no message nothing. What are you doing software? It gets me when i just see empty stuff loading in. We have splashscreens for this reason lol wait until you can populate the entire view
@puppygirlhornypost I am like that to, but iirk current design principles say "dont overwhelm the user with an error message they cant possibly understand", and many seem to read "never show the error to the user"
@4censord worst part is when i am a power user, i can understand the error messages but i am not displayed them so i run the software in a debugger just to see what the fuck is happening lol
@4censord I HATE HATE HATE error messages that are like "An error occurred :thumbsup:" because that is such a PITA as a sysadmin... What the fuck was the user doing? can you provide any of that? Can you tell me what the failure was? Now I have to go figure out what is broken by myself.
@4censord i love when server software tries to obfuscate the underlying error codes. Shit, how am I supposed to know what you're failing on if you won't tell me. It's like a dog chewing on something, trying to say "what's in your mouth" and it running away
@puppygirlhornypost ah, and specifically db error one needs to be careful with showing to the user, as these can enable or ease exploitation of e.g sql injections
@4censord I am under the opinion that front ends should not be making raw SQL queries to the database. It should make a request for what it wants to the back end that handles queries.
@puppygirlhornypost i'd say it depends on the surrounding factors.
For a web application: Absolutely. And the backend needs to validate EVERYTHING send from the client
@4censord Preconditions, validating inputs can also just help a lot with that. I mean you have to have front end and backend team working together for it to not be convoluted. If I cannot reasonably expect data being passed to internal functions to be consistent I'll explode
@4censord@saragon I mean yeah, I've seen some C# horrors. Language does matter but only in terms of how easy is the language to pick up, how easy is the codebase going to be to maintain, how expensive are the developers who are skilled at that given language so on.
@puppygirlhornypost@saragon Thats also the reason that i hate "rewrite in rust for speed".
There are totally valid cases to switch languages. But for most software swapping to another one the deciding factor for speed is not the language, its good design and good code.
.
@4censord@saragon rewrite in rust for speed is just the modern version of rewrite in c++ for speed which is just the modern version of rewrite in c for speed which is just the modern version of rewrite in assembly for speed
@puppygirlhornypost@saragon and there are some few cases where you need to rewrite in $lang exclusivly for being able to squeze out just a little more speed.
Just most of the time thats just not worth it
@4censord@saragon yeah genuinely, how about optimizing some of the code before switching lol. Part of that speed improvement is a total rewrite of sloppy code. Deno was such a meme https://deno.com/ because of this.
@4censord@saragon it's like okay, on one hand yea rust is a powerful language with its uses. on another, most of the speed improvements come at a great cost when it comes to maintaining the code base, finding developers who want to work on it. I mean look at lemmy for instance, it's written in rust. When you pick a low level language to get minor speed improvements you're sacrificing the ability for people to work on it. There's a reason java is popular, C# and so on. They provide a decent cost (for developers) to performance.
@puppygirlhornypost@saragon of course that works both ways, e.g. fish has been rewritten in rust (from c++), not for any speed improvements, but to enable some design changes that worked nicely with rust, but where harder to do with c++. Also, one of the goals was bringing in new contributers.
@mitsunee in C and C++ casserts are so fun because the entire program just halts and explodes. Needed to gracefully shutdown the program? Save things to disk? No fuck you. explodes
@mitsunee idk it's a tough call between ABORT() or a failed cassert. Both are funny to watch a program explode on windows. you just get a dialog box with no explanation for ABORT(). I love it when I run something from an IDE, play with it and randomly it gives me ABORT().
Add comment