Python vs C++ (Advantages / Disadvantages) + Execution Speed Test

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Thank you so much for this video, I've been wanting to get into programming but didn't know if i should do python or c++, and c++ in action looks beautiful, so much faster and way better structured even tho u have to write more and in fact, to me, writing more just means better control of data :p (something I really want to achieve) .

Thanks for the vid ! :D

TheOfficialNukeDem
Автор

test is not clean. Qt is the framework over the C++, so you should use at least pure C++17

szktnfm
Автор

it took almost a year to write that code in C lol :)) you save much time avoiding those extra lines in Python

noonpe
Автор

your C++ compiler is in debug mode! Change it to release if you really want to compare speeds properly.

hameedtalebi
Автор

this hurts....

In real world though the complete time frame from starting a project from scratch till production go live matters..
we know where we write less number of code lines.. :p

mission critical = c/c++
every other scenerio=python

xtionluver
Автор

I found out that i am just knowing the fundalmentals of both languages

webwalker
Автор

Hello sir, i probably note little mistake in your c++ speed test. When i compiled this code, the compiler just deleted the expression in the loop, leaving only i++ and jmp operations (as i saw in diassembler). It give me result 21-22 ms (same as yours). So i declarate a variable in witch i wrote the result (and change type of iteraror to long long int, because programm crashes if "i" is int). Executing of this lasts 0.095-0.1 ms, this is still much more faster then python, but anyway.

Gregory-vcvs
Автор

i learned C++ in start then came to Python. and i have to say i fell in love with Python. its so easy and yet powerful. i would highly recommend anyone starting to learn programming language to go for Python. Btw Python is the future unless u wanna go for game development.

StructureSquad
Автор

by default your code is optimised away.. meaning the loop was completely ignored and wasnt part of the execution... you would have to use the main(int argc) argument for example

bnk
Автор

Thanks for the content, I ain't got a damn clue what you're talking about

SuperKeithers
Автор

Thanks for the video. Yes there are many comparisons of these Two languages. But the interesting thing is, python is used for data science and AI which to me should be very fast to process large amounts of data and handle artificial intelligence.

millerdane
Автор

Nice presentation, but I believe to achieve the best performance is to use a light-weight editor for C++ like sublime and not Qt Creator (which also costs much money for commercial apps). The disadvantage of using sublime is that you have to code everything from scratch (there are only some plugins like creating templates for c++ classes). Python is only suitable for rapid prototyping and for apps where performance does not matter. Nevertheless, it was a nice presentation. THX.

underwaterdol
Автор

I studied Python programming as a hobby. Now only since I have Java in my syllabus, I am studying it. Otherwise I would never study any other language. But my opinion is to include Python in computer applications subject instead of Java.

smithapp
Автор

Python is not slow. Python is less fast.

dedurocortorum
Автор

Adding library dependencies into C++ and editing CMake files is the biggest pain vs Python. If it weren't for that difference then it wouldn't be so bad. For me it isn't the language itself and static types that are the pitfall. It is the dependency management. In Python simply being able to do a pip install an then import is THE biggest time saver.

mattizzle
Автор

CPython has a bytecode compiler, which only compiles Python code to bytecode (unoptimized), and the bytecode is directly executed by the VM. This is generally slower than a C++ equivalent.

PyPy has a JIT compiler, which compiles Python code to native code, and sometimes the compiled code can run 6x faster... but yes, still far from C++

smanzoli
Автор

1. why you use Qt w/o reason, but ok
2. did you turn on optimization for c++ ?
3. calculate cyclic sum or somthing, otherwise c++ just optimize out your code
4. if number of iteration is known at compile time, C++ could use several iteration in loop body

RomanGen
Автор

A utility such as Pyinstaller may be used to create a standalone Python distributable app

kevinlcarlson
Автор

Alright it seems like I'll need to learn C++ for Data Science!

workflop
Автор

This is 2050, Cobra ++ has killed Python

covid-ultrapromax
join shbcf.ru