oop
I would recommend you first get confident in using templates before OOP in C++ as static polymorphism is nowadays more common than dynamic polymorphism
Template means? I'm new in c++ but I coded in C for a long time.
Class hierarchies are only useful during pretty anecdotal moments
Then forget C before you dive into C++ (I feel like I already told you to not think of them as the same thing)
Please say in English 🤣 it sounds like Chinese
When you will actually use class hierarchies will be moments you will regret and try to forget and then laugh about after a few years
There's usually two ways people code in C++, first is deliberately limiting yourself to near C like subset of features in C++ with some C++ conveniences like namespaces, better type system, organising functions inside of classes/structs, etc.This way of doing things is perfectly fine imo if and only if you know what you're doing (intent of avoiding OOP, etc) and it is a concious decision. It can lead to bad code so not really recommended for beginners. Second is using almost all available C++ features with the intent of writing good C++ code keeping it's strengths and weaknesses in mind. Here you'll need to let go from doing things like you would do in C. This allows you to use OOP, etc.
I think the second option is not for me because I am not going to choose c++ as my primary language. I like JS, golang, php as my motive is to be a web dev but in a better way. That's why I'm learning programming using low level languages like c and c++
Well I'll suggest you don't use OOP in C++ then.
Should I learn oop with python then? Though I don't like python that much for its indentation system
Yeah any other language will do. python, javascript, etc. If you want to do OOP in C++ better to do it with templates. Also do know that OOP is falling out of favour as "The Way To Code" because of problems it leads down the line if you do crazy stuff.
Обсуждают сегодня