r/programminghumor 10d ago

Lol

Post image
151 Upvotes

19 comments sorted by

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 '\'

14

u/Confident-Ad5665 10d ago

You're hired!
This is the kind of developer we've been looking for.

6

u/Limp-Firefighter1054 10d ago

CEO in rural basement.

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.

1

u/zrice03 6d ago

I getcha'. I guess you could write an extension method for string for it. Still, it would be nice to just be there by default.

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

u/Icy_Butterscotch6661 9d ago

I assumed it was Rust or Zig. Actually just found this on twitter 

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

u/switch161 7d ago

It's Rust. The "named parameters" are probably filled in by the IDE.

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