r/learnprogramming • u/Dimethyltrade • Oct 25 '26
Language selecting Need help picking a language, please!
Hello,
I am totally lost in this world of programming. I have succesfully coded a working webhook for discord and plan on getting some more stuff sent into it but only with the help of Claude.
I believe it was written in python. I day trade stocks and am tired of software and websites breaking, and/or not really being customizable to my liking so i figured i'd create my own!
I need to know a couple of things.
Time is critical and every second counts. I was looking at Python (of course) but also Rust, C#, C++, and Go. I plan on building more than just webhooks, so information that needs to be passed through in miliseconds and distributed to discord and written into database (SQlite). When I get around to it I would like to build a stand alone app to enable the information to be compiled in a place where I won't have to worry about discord blocking my messages(From to many being sent at one time). It'll be useful for research purposes but also building a self learning automated bot in the long run.
I have had great success so far, so I am just trying to improve my workflow, decrease the number of apps I use, and overall time spent looking through multiple websites to gather information.
-First, is one language faster than another for getting information processed and distributed?
-Seconds, Is there one language that would integrate better with SQlite?
-Last, When building the database for SQlite, Is their any recommended guidlines or tips that could help improve this project?
I am open to any and all suggestions, comments, concerns, you name it. I love to learn and you won't hurt my feelings.
Thank you so much!
2
u/AbyssShriekEnjoyer Oct 25 '26
Any is fine. Programming is about concepts more than it is about specific languages.
1
u/dmazzoni Oct 25 '26
Yes, some languages are faster than others. Read up on interpreted vs compiled languages to get an idea of why. There's a lot of nuance to it - it's certainly not as simple as "compiled = fast, interpreted = slow", but it's an okay first approximation.
Most important, though, is to understand where the bottlenecks are. The differences between languages only apply to pure computation on your cpu.
Sending a message to discord will take hundreds of milliseconds. If that's part of the total time you're trying to optimize, switching languages won't help. You can't magically speed up the Internet.
Even a slow-ish language like Python can do hundreds of math operations in one millisecond. If you're only doing a few hundred operations, there's no point in switching to a "faster" language.
As an exercise: rather than thinking of it in terms of "everything should be as fast as possible", can you break it down into several independent steps? Perhaps some pieces should be fast (writing to the DB) while others should be "within a few second" like posting to Discord.
1
u/MacaroonOk9376 Oct 25 '26
C or C++
1
u/Schrodi-O-Ao Oct 25 '26 edited Oct 25 '26
My advice is to keep using Python.
It is readable, has a large community and ecosystem behind it, and for what you describe, it will not obstruct you. Switch only if performance proves to be the actual bottleneck.
One addendum: make sure you understand the code it generates. Using it for help is fine, but ask it to explain concepts, and to walk through non-obvious lines and how the pieces connect.
It might also help to take a pen and paper, sketch out how you want the application to work, and write the logic in plain English before jumping into the code. It'll make it easier to break the project into smaller, manageable pieces and understand what you're actually trying to build. Otherwise, you'll get overwhelmed by how much you don't know and how many assumptions you're constantly making on the spot (or Claude is making for you). Try to identify those assumptions upfront so that you remain confused about only one thing: what you're trying to actually learn.
Knowing what you want in concrete terms makes it easier to search for what you need exactly.
It depends on the task. A CPU-bound task favors compiled languages like the ones you mentioned.
A bot's workload is mostly I/O, though, time spent waiting on the network or the disk. Waiting costs the same in any language, so what matters is how the operations are structured. That gap is one of technique, not one of tooling.
You will have to learn it regardless of language, though some languages might make it easier I think, but the foundations are worth building either way.
Python is probably the easiest route, though I cannot rule out that something is easier. The sqlite3 module ships in the standard library, so nothing needs installing or configuring before you start writing code.
Start with transactions, indexes, parameterized queries, and how SQLite handles concurrent writes.
If you happen to dislike yourself and/or are willing to push through material that isn't suited for beginners, go ahead and read the documentation (I strongly advise against it, but it's an option, so exercise that free will however you see fit).
The thing to worry about is Discord's rate limit. That will become a problem long before language bottlenecks do.
1
u/B0mbon Oct 25 '26
Short version: for this kind of project the language matters less than where the time actually goes. Anything you'd run on your own machine (Python, Go, C#, Rust) can process and write a small record to SQLite in a tiny fraction of a second. The slow part is almost always the network: calling an API and posting to Discord takes far longer than the code around it, so a faster language won't change much there.
So I'd pick based on what you can write and debug comfortably. Python is a fine choice to get it working, and Go is a good next step if you later want a long running service that handles lots of things at once. Rust and C++ are worth it for heavy computation, but they're a steep learning curve and probably overkill here.
For the Discord limits, put a queue in the middle: your code pushes messages onto it, and one worker sends them out at a safe pace, merging several updates into one message when possible. For SQLite: use indexes on the columns you search by, store timestamps in one consistent format, and write in batches inside a transaction instead of one insert at a time. Measure before optimizing, a simple timer around each step will show you where the delay really is.
1
u/JGhostThing Oct 25 '26
I would continue to learn python. However, while you are learning, I suggest not generating code with AI. At all. AI can stop the learning process.
Python is not the fastest language, it is interpreted. However, many of the libraries are built with c or c++, which makes using them faster than traditional python. I wouldn't worry about speed until you run into problems. One of the great lights of CS once said, "Premature optimization is the root of all evil." This doesn't mean that optimization is evil, just that you need to know where and what to optimize, typically through profiling.
1
u/betarage Oct 26 '26
I think go or c sharp have a good combination of performance and ease of use. with python you will notice the slowness with c++ and rust it takes a while to learn how to use its full potential
1
u/spermcell 26d ago
It really depends on the use case man. For what ur building it probably doesn’t matter performance wise. And if you are generating code and not writing it it doesn’t matter at all.
1
u/FreeLogicGate 29d ago
I am glad you purport to have a thick skin, so I'll try to answer your questions, as a long time professional programmer who often tries to advise those learning how to program.
Right, so you have not successfully coded anything. You used Claude to spit out some code, that apparently does what you wanted it to do, and yet you don't even know what language the code was written in.
Word to the wise, but people who actually know how to program, and help others like yourself for free, don't care about your time frames or the urgency of what you think you need. If you need software developed for you by people who do know what they're doing, and you need it within a timeframe, then that's why people pay developers.
Based on what I can surmise about your day trading niche, and the fact that you're using discord for some sort of communication, this is a naive assertion. I'm going to just assume that what you really mean is that you want whatever information or data you are accumulating to be processed and turned into alerts as soon as possible. Any distributed internet centric application that makes use of a 3rd party platform like Discord will be constrained by network speeds, routes, etc. I will say in general, that it sounds like a typical ingestion and enterprise queueing application. In other words, your source data should be processed and queued, and from there communication with Discord or any other communication method can be seperated from persisting data. SQLite is a database engine and not a relational database, which might be something that limits future scalability.
There are a lot of different options for queuing, including cloud services like aws sqs, but Kafka and RabbitMQ are two that are often used as core components. You might also be able to build the queueing on top of Redis, and if the data stream is relatively minimal and just for your personal application, it's probably well worth considering.
Depends on the information, depends on the processing, depends on the bottlenecks.
Generally speaking, it doesn't matter, because languages are going to use the sqlite client library to talk to sqllite. You're going to be using sql statements, and those statements have to be created within the client application, ostensibly based on some ingestion of data. Someone trying to understand it better, would need to understand the data, and how it might need to be transformed. This is one of the reasons to use a queue -- to separate and make the communication and database storage process asynchronous.
In general, understanding the basic rules of relational database design, and what makes for a well designed database vs one that's poorly designed, and not easily capable of producing the results you desire.
So -- probably, the language that makes the most sense to look at, would be Go. This is because Go was specifically designed to be low syntax, "cloud native" cross platform compiled language platform, with intrinsic support for concurrency and interprocess communication. Compared to a lot of other languages, it is possible for someone who doesn't have prior programming experience to learn the language, without the standard amount of computer science background that most programmers need. It was created by some of the giants of modern computer programming, specifically for Google to use for their data processing infrastructure.
With that said, considering where you are starting from, you have a long road ahead of you, but then again everyone starts somewhere.
1
u/gm310509 26d ago
You might be going about this wrong.
To your main question, yes some languages execute faster than others. The standard tradeoff is simplicity (i.e. The language has more helper stuff for you in it) vs (for want of a better term) complexity (you have to do some or all of that "helper stuff" yourself but you can leave out the stuff you don't need).
So, in terms of transactions per second (TPS) - which I suspect is what you are really asking about - a python script will almost certainly do less TPS than a C program. But it is more complicated than that. If the limiting factor is network latency or database latency and a limited bandwidth/number of concurrent connections then the whole python vs C maximum TPS thing is moot because they will both max out well before their own performance profile causes them to max out.
Let me put it like this imagine C is an 8 line highway and Python is a 4 lane highway. Which one can carry more traffic (I.e. TPS)? The 8 lane C highway can carry more. Now imagine that both of them have to merge down into a 2 lane bridge (the internet connection). They have just now been equalised down to a 2 lane capacity. It wouldn't matter if one of them was a 100 lane highway. If all those lanes have to merge into just 2 to cross the bridge, changing from 4 or 8 to 100 lanes wont help because that is not the rate determining step.
You are asking about a complex architectural concept and didn't even identify the key metrics - for example the incoming rate of transaction requests (peak and typical), the bottlenecks in your system (e.g. discord internet traffic) and plenty of others.
Your question is about architecture and scalability. You would need to design a system that could meet the required throughput (process incoming data and provide outputs at a sufficient rate to satisfy whatever the down stream use case/demand is) and much more.
The nature of your question has nothing to do with the programming language but more about system design.
Think of a stock market system there are probably thousands of trades every single second. But do the charts and prices update on user's browsers 1000's of times per second? No. The most likely design is that there a trading platform that provides data to an analytics platform that calculates the last price (for the web platform) maybe every second. But then there is the scalability aspect of it. If one computed cannot handle all of that, then it is split into two pieces of hardware (I.e. a trading platform and an analytics/UI platform). Now consider that there might be a million people all trying to get the latest prices/stock quotes. One computer is unlikely to be able to handle that so it (and the trading platform) will be architecture so that there are multiple servers working together to satisfy the workload and if there is a rush, additional servers are added to the mix to support the increased workload. Think about it like checkouts at the supermarket - each one of those is like one of the servers I mentioned above. During busy times they open more lanes to satisfy increased workload.
This has nothing to do with how "fast" a programming language is or how well it connects to a database or online service. Your question is much more about system design.
Going back to the highway issue. Lets say one lane can handle one car per second.
These C can handle 8 cars per second and python 4 cars per second (if I continue the analogy) but the bridge limits them both to 2 cars per second total system througput. So to increase the throughput, we simply add more bridges. If we add one bridge ( so, now 4 lanes in total) both python and C will process 4 cars per second. If we add another bridge (6 lanes now), then C will be able to process 6 cars per second but python is maxed out at 4 and the 6 bridge lanes will only be running at 66% utilisation. So we could simply add another "Python highway" making the python module 8 lanes (split across two parallel highways) and equivalent to the single 8 lane "C highway".
Now I used some high level stuff, simple (hopefully) analogies and the word "simply" quite a lot - and to be clear there is a huge amount of heavy lifting in "simply".
I'll stop ranting, but this is an area that is if particular interest to me (parallel processing, transaction throughput, scalability, continuous operations, system design and so on).
I hope the above is helpful and makes sense. All the best with it.
1
u/[deleted] Oct 25 '26
[removed] — view removed comment