From Rust to Python through screwed up SQL queries
Antonov Mike

Antonov Mike @antonov_mike

About: Rust / Python enthusiast. Seeking my way in development. Love back-end and command line. Guitar and bass player, songwriter, artist

Location:
Tbilisi, Georgia
Joined:
Jul 16, 2022

From Rust to Python through screwed up SQL queries

Publish Date: Sep 4 '23
2 2

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

Comments 2 total

  • АнонимSep 28, 2023

    [hidden by post author]

  • Florence
    FlorenceFeb 14, 2024

    Utilize tools for SQL query generation cautiously, validating the output. Vigilantly check for discrepancies, particularly when working with geographic data like latitude and longitude. Learning from oversight, prioritize thorough testing during language transitions to catch potential issues early on. Stay attentive to data types and consistency across languages to streamline the migration process and reduce debugging time.

Add comment