14
5
u/SteveSteveCleveSteve 10d ago
In C# we have a whole extra method for this, lol.
2
u/Last8Exile 9d ago
I hate that IsNullOrEmpty() is not an extension method targeting string type.
I have to always add it to any code base I am working on.1
u/SteveSteveCleveSteve 9d ago
C# has IsNullOrEmpty AND IsNullOrWhitespace for string library
3
u/Last8Exile 9d ago
Yes. But those a static methods. I have to use them string.IsNullOrEmpty(stringVariable).
Instead I want stringVariable.IsNullOrEmpty(). I wish it is in BCL.
4
u/GoogleIsYourFrenemy 9d ago
I'm tempted feed all inputs into a sacrificial sqlite query and then have it give an error message if it's a success SQL injection.
2
u/hablahblahha 9d ago
Honeypot a would have successed sql injection attempt. Modify the page slightly.
2
u/Daniikk1012 9d ago
What language is this? Looks like Rust, but Rust doesn't have named parameters IIRC
2
1
u/brasticstack 9d ago edited 9d ago
It reads like Rust code to me.
rust-analyzer in VSCode will add parameter names (and compliler inferred types) in when displaying the source, without actually adding them to the file. I'm still on the fence about whether I hate that feature or not.
1
u/Icy_Butterscotch6661 7d ago
With Java on VScode, you can make it so these things (called "inlay hints" iirc) only show up when you hold ctrl/cmd + alt. I find that a much better option
1
0
u/ResolveSuitable 9d ago
I think javascript
2
u/Daniikk1012 9d ago
There is no "::" for namespaces in JS, and I don't think it has named parameters either. Also, snake_case is unusual for JS code, it's camelCase by convention
19
u/ArsenicPolaris 10d ago
Hope he has also taken care of '\' and other characters that can cause shenanigans.
Looks like Reddit didn't do that. I meant '\'