Python or c++
I was thinking of making a graphical calculator from scratch, i have some, but very little experience with python (that one 12h tutorial and a little more). Should i code it in c++ or is it fine if i do it in python?
From the nature of my project it requires a lot of computation and apparently c++ is like 100x faster, thats why im asking
About this post
- Posted
- Archived
- Score
- 3 · 64% up
- Kind
- Text
- ID
- 1v6eaad
20 comments
Use one of the gajillion python libraries that is basically an API for a codebase written in C. Wham bam, problem solved. It's shrimple. Python the way God intended.
That is the best case scenario. And then the code is run like so:
It is still gonna be slow as shit compared to running a program in C
It does not matter in the case of a calculator, that OP is asking about.
But we are on a games development subreddit.
Anyone who says anything positive about Python can suck my python.
Hence why cython
Kind of performance you would need for graphical calculator, you can code it in bash script and it wouldn't matter. Go with what you already know - Python.
Alr thx
Yep
Does a calendar need to be faster? Nope
Calculator*
This is the type of questions some newbies get slimed for bc "it's too basic"
Anyways, if it's a small personal project, I'd suggest u to go for python. A graphical calculator is pretty hard to make with that 12h tutorial alone, let alone with c++ bro. However, even though it is a pretty difficult task to do as a newbie, i have two things to say:
PLEASE do not use many tutorials (tutorial trap)
YOU DO NOT have to implement many features As soon as you add one more feature, you will feel the need to add more and more like a real graphical calc. even though you're (hopefully) doing this as a personal project and trying to have fun. It leads to development hell.
DO NOT RELY on reddit to give you advice, this subreddit gets REALLY toxic sometimes and one random toxic person can make you want to prove them wrong making you work on a project out of spite instead of out of fun. Instead, use Unity Learn and try to avoid using AI too much.
Stuff like this has happened to me in the wrong way and i gave up on so many projects bc i didnt know the stuff i mentioned.
Oh thanks man, everyone was reccomending that instead of watching tutorials i should just start a project and i want to use it as a tool for learning not actually bcs i think its gonna be any good
👍
Ik most of this stuff isnt that related, but just some advice.
Take a look at Desmos Graphing Calculator, it is fully implemented in Javascript so it runs locally on your browser.
You can get the best performance and development speed with C++ since no other language provides so much control and abstraction power. However that requires a lot more effort to obtain true understanding of C++ and a good set of libraries. Unfortunately the standard libraries are not designed to maximize productivity, they are not comfy to use, don't support modern i/o like memory mapped files, and some data structures don't even provide the best performance.
Deleted before we saved it.
Python has the ability to call C++ code if you need the performance.
Python is fine, but it sounds like Javascipt is better if you're making it web-based?
They’re different types of languages. Python is high level, whereas C++ while technically high level is more halfway between high and low. As such, C++ tends to be harder to learn, and requires more coding and knowledge to do something.
That said, C++ can be faster IF DONE RIGHT. Because it’s sort of a lower level language, you have more nuanced control over executions, memory allocations, etc. than all of python’s built-in functionality - but u gotta know what you’re doing to benefit from it. Think of it like building a PC: you can go out and buy the parts and put it together and if u do it right ull get more bang for buck, but it takes more effort, more knowledge, and if u mess up you’ll wish you’dnjust bought Alienware :)