Anonymous
Yes, you can
Anonymous
Putting this-> everywhere decreases code's readability
I_Interface
Remember what using initialise list is always better
I_Interface
Better code optimization for compiler
Anonymous
Just believe😂 It's a good practice
Anonymous
Lol
What?
I_Interface
And if u are using const it will be more faster
I_Interface
If u using constexpr it will be more faster
I_Interface
))
ubwzwd
const can be faster?
Anonymous
It's not important for him right now
Anonymous
const can be faster?
Yes It gives plenty of options for compiler to optimize your code
ubwzwd
Oh, I don't even notice this
I_Interface
Oh, I don't even notice this
Watch cppcon video from Jason Turner about Practical participate
Anonymous
Oh, I don't even notice this
Of course you didn't It can be noticable in high performance applications mostly You can play around with it and look the generated assembly code
Anonymous
Consider you have a class with such constructor: Class(int x); And you have a function: void func(Class arg);
Anonymous
Then you call the function func(5);
Anonymous
This code is correct
Anonymous
But the func doesn't take an int as a parameter, right?
Anonymous
So compiler looks at the list of constructors of the Class And it like "well, i can construct a Class object from an int, so it's a valid function call"
Anonymous
Sometimes it's an appropriate behavior, sometimes it's not
Anonymous
The explicit keyword tells compiler that it cannot create an object of a class implicitly
Anonymous
If a Class has such a constructor: explicit Class(int x);
Anonymous
Then you call the function func(5);
It's not a valid func call anymore
Anonymous
It's not a valid func call anymore
To make it valid, you should explicitly tell the compiler func(Class(5));
Anonymous
Because we declared such a constructor
Anonymous
Well, what programming experience do you have?
Anonymous
Well
Anonymous
You're on the wrong way, my friend
Anonymous
Because classes should not be the first topic in anyone's programming learning path
Anonymous
You should start with a book called "C++ Primer Plus" by Stephen Prata
I_Interface
It's a wrong book
Anonymous
What is the book, again? And the author?
I_Interface
Anonymous
I_Interface
Why?
I_Interface
Idk why he don't like it, but it was a good book for me as for beginner
Anonymous
Just believe me
Anonymous
I don't does it suck or not
Anonymous
But if the first chapter is about classes
Anonymous
There's something wrong
Anonymous
Ok?
Anonymous
There's something wrong
Maybe it is not for a beginner Or maybe it just sucks :)
Anonymous
I don't like it
I_Interface
I don't like it
Class before oop, lol
Anonymous
I don't like how the info is structured
Anonymous
It should not be in that order
Anonymous
So it officially sucks
Anonymous
Just take the Prata's book and be happy
Anonymous
It's recommend by good c++ developers
Anonymous
Simple projects and another, more advanced, book
Stephanos
After the First book i guess you should start watching talks
Stephanos
In YouTube or at conferences
Anonymous
After the First book i guess you should start watching talks
Yeah, it's a good learning resource too
Stephanos
And Always Look Up Terms one doesnt know on cppreference or stackoverflow
Anonymous
But it's harder to know which talk you should watch
Stephanos
I guess getting a Mentor is the best Thing
Stephanos
But getting the right one is also really hard
Anonymous
But it's harder to know which talk you should watch
Because most of the talks are on advanced topics
Stephanos
Because you never know whos a jerk
Anonymous
I can recommend Kate Gregory's talks
Anonymous
So start Prata, try some things by yourself Try to build your own programs Google what you don't understand
Anonymous
It's too early for you to watch talks
Anonymous
Learn basics first
Anonymous
Then you can try to start Qt
Anonymous
And other things
Anonymous
Use Prata, ok?
Putera
Hi. Does anyone here know about basic programming language?
Anonymous
/get ossu
Anonymous
neat