Jesus he’s a worse coder than even Yandere Dev
I don't know what you're seeing in this snippet of code that offended your programming sensibilities... but I actually asked my friend - who works with a lot of programmers on a daily basis - what his impression of Null's code was. I told him that this snippet of code was part of a larger computer program that is supposed to function as anti-DDoS software. He said that this part of the code shows
"a very simple database automation" that looks "very general purpose, something someone could've coded in any general purpose lanuage, in SQL itself or in a batch file" and
"something someone who is unfamiliar with Rust as a langauge and with Rust-specific optimizations might have coded".
When I told him that Null is originally a PHP programmer, he laughed and said:
"I would've done the same thing 10-15 years if I needed to code something similar, only I would've done it in PHP". Meaning: someone familiar with PHP and Rust can tell that Null is a PHP programmer trying to code in a new language he isn't yet fluent in.
He also wondered why Null isn't just using a stored procedure on his SQL server instead of putting it in an application. He said that doing this through an application is inefficient and that he wouldn't hardcode SQL queries, because
"it's bad practice and hard to maintain", saying
"it's better to do such queries in a stored procedure" so that you can change the SP in the event of having to change the filter, without having to change the application itself. He said that
"this something any professional programmer knows", and the only way to do it the way Null does it is because you don't want to do things professionally because you're in a hurry.
He guestimated that there might be enough functional logic in the surrounding code (which Null doesn't show) that would make coding this in Rust a good idea, but perhaps not enough to make it worthwhile to do things more thoroughly.
He concluded saying:
"The more complex an application is, the stranger it is to use hardcoded SQL queries."
... but then he figured out that Null is using the
ScyllaDB library (a database driver that allows one to formulate semi-direct SQL queries, which is used for load balancing, asynch execution, retry policies, error handling, etc), whereupon he admitted being unfamiliar with
Cassandra (which he suspects is what Null is using), but he would still like to know why Null is not carrying out such a simple task on the server, if only from an efficiency viewpoint.
This is what an impartial outsider who doesn't know Null or his website had to say about Null's Rust code upon seeing it for the first time.