DEV Community

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

Posted on • Edited on

1 1

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

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

Top comments (1)

Collapse
 
bredking45 profile image
Bred King
Comment hidden by post author

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay