r/Coding_for_Teens • • May 08 '22

Seriously, stop using C++.

I am baffled by the prominence of this obsolete language on this sub. There is no reason, none at all to use a low level language as opposed to a high level one like Py or JS. Python IS C, JavaScript IS C, they have much more functionality, nothing is lacking, much is gained. “But C++ runs percent(x) faster than those!!” Yes, but it takes times(x) longer to code. Are you guys just inspired by Minecraft?? Seriously, what is the reason?

1 Upvotes

22 comments sorted by

6

u/[deleted] May 09 '22

So, if I wanna make a resource intensive game with tens of thousands of physics objects but I can only get it up to 20 fps in python, what else can I do? Also what if I like typed languages or low level programming? How can I go about making a library if it's not fast enough for other people to use?

Why do you think C++ is so widely used? If by "on this sub" you mean "these people who are just learning how to code for the first time" then I would kind of understand you, but first, not everyone here is a total noob, and second, it's pretty nice to use C to see how a lot of things in general are made.

I wager I'd never learn about different sorting algorithms, search algorithms and stuff like that if I didn't start learning using C. I've heard from other people who had learned high level programming languages like Python or JavaScript that they had a much harder time learning lower level ones.

I don't know what you meant by "Python is C" and "JavaScript is C", did you mean that the libraries for those are made in C or something? That doesn't really help that much for my resource intensive game example.

Good luck with your learning.

4

u/[deleted] May 09 '22

C isn’t dead

4

u/[deleted] May 09 '22

Try making an OS in py or js

2

u/Useful-Character4412 May 09 '22

I mean, it has been done...

However they were more shit than py and js themselves.

1

u/[deleted] May 09 '22

No, I mean a full kernel in just Py/Js

2

u/Useful-Character4412 May 09 '22

Oh yeah i doubt that has been done then. I havent seen or even heard of someone wanting to do it anyway.

1

u/[deleted] May 08 '22

honestly id sacrifice my sanity for better performance

1

u/camelonarock May 09 '22

Minecraft isn't made using C++

And if no one uses C++, those higher level language wouldn't be available to you.

2

u/[deleted] May 09 '22

bedrock is made using c++

0

u/camelonarock May 09 '22

and it fucking sucks

1

u/[deleted] May 09 '22

but you cant deny the facts

1

u/camelonarock May 09 '22

i doubt bedrock has inspired anyone to learn c++

1

u/ThatWolfie May 09 '22

I personally don't use C++, but I've used rust and I would call that low level (compared to python and js) and i love it.

Low level languages have their purpose, and tbh, python and js are prolly the worst languages to do anything in (i know because I use both regularly).

Python and js abstract away a lot of nessecary concepts you should learn such as typing, OOP and memory management to name a few. C++ teaches that.

C++ compiles to a native executable whereas python and js are interpreted and require their respective runtimes to work.

Imho, before you start dissing low level languages in favour of (objectively) inferior languages, you should try out Rust. It's a low level languages with high level features and a really good, easy ecosystem of tools.

1

u/Lower_Quality_Hooman May 09 '22

Another good point is that C++ is taught and praised in most schools. At least in Romania, starting from 5th grade where we play in scratch and forming the “basics needed for programming” and going up to 12th grade, students are taught C++.

1

u/Yamoyek May 09 '22

Sigh.

Languages are tools, and you should always use the best tool for the job.

Do you want to make a website? Use JS or TS, simple.

Do you want to make an OS? Use C, C++, or even Rust, simple.

Do you want to learn low level graphics? Use OpenGL and pick C++.

Do you want to make games? Use C# and Unity or Python and Godot.

Just want to learn programming in general? Use Python.

1

u/[deleted] May 09 '22

If argue that for low level graphics, C is better

1

u/Yamoyek May 09 '22

I’d say C++ just cause it has so many quality of life improvements like templates, strings, classes, etc.

1

u/[deleted] May 09 '22

Eh, sure they can be nice, but there are so many drawbacks (templates just being templates) and C is honestly just good enough for all of it.Without having those features your code is so so much more simple, which is one of the reasons I love C

1

u/Yamoyek May 09 '22

What drawbacks?

1

u/[deleted] May 09 '22

Templates adding so much complexity, the STL being bloated as hell (I don’t use it if I use C++), etc. Generally I just dislike how bloated and complicated C++ is

1

u/Yamoyek May 09 '22

Templates aren’t all that complex most of the time? And you don’t have to use the whole STL, I mainly find myself using common data structures I would’ve had to implement anyways.

1

u/[deleted] May 22 '22

use C u idiot (no actually), amazing very nice to use

no seriously cython (PYTHON with C extensions) is amazing

also C++ is infintely better than js