DEV Community

Cover image for From Rust to Python through screwed up SQL queries
Antonov Mike
Antonov Mike

Posted on • Edited on

From Rust to Python through screwed up SQL queries

I had a geo-location telegram bot written in Rust, but I decided to rewrite it in Python, because I see no chance to get a Rust developer job without few years of experience or bachelors degree and residence and work permit in Europe/USA.
I'm not very experienced with Python, but I finished everything in 1.5 days. Everything except calculating distance between user location and nearest cafe (or any other object – depends on business requirements). I spent a lot of time on this project and now I have to spend even more time fixing it.
The fun part is – I asked ai to write Postgres query, because I don’t like to write queries and it created latitude and longitude as INT instead of REAL. So my code was comparing not 44.7931742 and 44.7988984 but 44 and 44. And I never checked it! It’s a shame I guess.
I think next time I will be more careful when switching between programming languages. It's important to double-check everything and make sure that everything works before moving on. And I need to focus on SQL queries.

Rust version of this telegram bot
Python version of this telegram bot

Top comments (1)

Collapse
 
bredking45 profile image
Info Comment hidden by post author - thread only accessible via permalink
Bred King

Really useful and informative article indeed.

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more