Some of the best videos are made just after sleep.
@bobas59483 жыл бұрын
this guy is one of those 5% of youtubers who actually deserve a patreon. he puts in effort to make C++ hell feel like barbeque grill.
@NeoKailthas3 жыл бұрын
and your brain is for dinner lol
@soulninjadev3 жыл бұрын
nah it's not hell, its just on the harder side of programming, where only smort ppl are allowed
@puppergump41172 жыл бұрын
@@NeoKailthas Braaaaiiinnsss
@puppergump41172 жыл бұрын
@@soulninjadev Don't be all uppity, there's a fine line between using a bunch of libraries and not getting anything done, and either one has no room for calling yourself smort
@ashiinsane907 жыл бұрын
hands down the best programming channel on youtube, fast straight to the point thank you!
@quaffie4 жыл бұрын
and hes hot
@user-dh8oi2mk4f3 жыл бұрын
@@quaffie lol
@zanesnep2 жыл бұрын
@@quaffie you right
@aquibshaikh86114 жыл бұрын
Cherno after waking up... "lets make a video on C++"
@mmaranta7853 жыл бұрын
Dude never combs his hair
@forhadrh3 жыл бұрын
😄😄
@leixun4 жыл бұрын
*My takeaways:* ENUMS is a way to name values 0:34
@onigumo4 жыл бұрын
闭嘴,没人关心
@ganjalfthegreen53124 жыл бұрын
@@onigumo why?
@chirathpansilu57823 жыл бұрын
And also to define a 'set' of values
@dimitar.bogdanov3 жыл бұрын
@@onigumo gtfo
@antonkovachev9181 Жыл бұрын
@@dimitar.bogdanov Kaji mu go bacho Dimo
@Plasticcaz7 жыл бұрын
I discovered enum classes the other day, and I was so happy. Classic enums are kind of annoying when they leak into the current namespace.
@Ranakade5 жыл бұрын
Finally! A straight to the point explanation of enum! Subscribed!
@zsdanix6 жыл бұрын
Actually you can avoid the confusion with distingiushing the two "Error" like Log::Level::Error
@petrvaganov Жыл бұрын
Or use ERROR
@salman29727 жыл бұрын
Can you make a video for cmake...?
@vertigo69825 жыл бұрын
He would have to make a couple videos on cmake.. one video is never enough and barely would cover an intro to cmake.. cmake has decent documentation though which I find is better than video hunting because.. not every video is using your IDE/build system, or OS.. so there's different configs to learn depending on what youre building on and building for. I had a difficult time finding a video using cmake in linux to build something to put on git so I can clone it on my windows system and build it... Then I had to narrow it down more to finding videos on using cmake in linux in kdevelop... I quickly learned.. skip the videos.. just dig into the docs.
@master_spike Жыл бұрын
One of my favorite usages of Enums is as a function template parameter, with constexpr if statements if i need a function to do something *slightly* different depending on some options. It eliminates a lot of conditional instructions from compiled code while cutting down on duplicate written code.
@marcandrei80612 жыл бұрын
not great for someone who doesn't have a clue but as someone who knows c and is trying to move to c++ I really just need to learn oop so I'm thankful for his explanations that are more sophisticated than other youtubers that generally stop at explaining how to compile a program or write a variable or a function.
@foomoo10882 жыл бұрын
It would be awesome to have an updated version of this coving enum class as you mentioned, but also addressing the pesky issue in C++ enumerated regarding serialization and mapping to string names. (E.g. there’s a use-case for having ascii serialized assets which have enum values serialized as string names). Use of enum as bitfields (flags) is also another useful side topic. Thanks Cherno!
@casperes09123 жыл бұрын
Using 2^n for enum values means you can often do some bitwise AND/OR operations cleverly. Like if A = 1, B = 2, C = 4. If it's possible for two to be "active" at once, A+C = 5 which means if you & it with A it'll == A and if you & it with C it'll == C
@ChaosB7ack2 жыл бұрын
Those are called flags, I've never seen them declared as enums tbh. Most times they are #defined since they are very much used in shared headers
@casvanmarcel7 жыл бұрын
Very educational, you are a fantastic teacher Cherno. Waiting for the OpenGL series! Thank you so much for making these
@DavidBChannel Жыл бұрын
My lecturers made me forget what it's like to understand a coding lesson, thanks for reminding me! lmao
@-TheBugLord3 жыл бұрын
Thank you so much. My 122 professor started glossing over enums with operator overloading, assuming we already knew them, when my 121 teacher never taught them
@ghostravenstorm3852 жыл бұрын
"The error doesn't actaully work and gives us an error" I don't know why I chuckled at that statement.
@darimuhittin6 ай бұрын
You need to be in every university in every country .
@Tupiniviking_de_osasco2 жыл бұрын
I recently started watching your channel, even though I'm subscribed long time ago. It's amazing how your videos are elucidating even if you don't even to struggle doing it. Cheers!
@bigmamatristana6775 жыл бұрын
Great videos, this was my second time watching your static compilation and it made complete sense.
@subhamprasad13733 жыл бұрын
i started learning c++ this year , and i really thank you , your videos helped a-lot ,and please continue to keep adding new videos
@DashwoodIce94 жыл бұрын
Great tutorials man, thanks! And the hair too, love it 😂
@gabrielrosewood32572 жыл бұрын
Damn, Thank you! Your vids are short, fast, and to the point. Thank you again keep up the good work!
@krec3487 жыл бұрын
One more excellent tutorial. This series are just perfect for anyone that wants to learn C++. Thank you :P
@divyabhoi95844 жыл бұрын
When you write Log::LevelWarning, does it mean that LevelWarning is a static variable belonging to the Log class?
@GenericPhantom1 Жыл бұрын
Enums are integers behind the scenes. If you have a set of values you want to represent numerically you use enums
@Special4ce2932 жыл бұрын
So far so good, I have 99% identical code to what you wrote, (just renamed a few things but kept everything consistent... However, I am getting a 'C26812' Warning. The enum type 'Log::LogLevel' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
@UNRELATIVE Жыл бұрын
Thanks,The Cherno.
@batabatonica6 жыл бұрын
Man these are soo useful, i love this series
@Delemaroth2 жыл бұрын
Convention for all other cases with Enumerators is to completely capitalize the words used in them. is that not the case in c++ development?
@houaxiong6164 жыл бұрын
OMG! This makes so more sense! Thank you!
@rcookie51287 жыл бұрын
Once again I thought I knew everything about enums, but never knew you can explicit type the enum neither that you can directly access enums from classes without having to get the enum itself first (so Log::Error)
@rcookie51287 жыл бұрын
btw love the shaggy hair style!! :D
@heksogen47885 жыл бұрын
Example code would be great for each video, especially like this.
@yeadatwunyt80042 жыл бұрын
Just unlocked so much for me in my coding education! thank you! thank you! thank you!
@saravana80166 жыл бұрын
I love your hairstyle
@Steve-gi2yj5 жыл бұрын
@TheChernoProject, big thank you for the videos, learning a lot more than i ever have with c++ :)
@puppergump41172 жыл бұрын
sfml groups enums into their own namespaces, which is one of the better ways I've seen them grouped
@user-fn3ok4dm7f3 жыл бұрын
Thank's these tutorials help me alot!
@ashereinhorn2 жыл бұрын
Love the videos. i’ve been binging them. You’ve started looking very tired here! perhaps it’s that EA job you eventually quit. I can certainly relate! Glad you’re in a better place now!
@georgeryan14375 жыл бұрын
Sorry if this question is stupid, but does the indentation on the if statements, somehow make an exemption for curly brackets?
@georgeryan14375 жыл бұрын
@Peterolen Yes, but that doesn't explain why their is no curly brackets.
@unicorns5374 жыл бұрын
Oh my gosh it's me on a different account. I thought I'd watched this vid before, nonetheless it's always beneficial to rewatch a Cherno video.
@Jan_Jan_2 жыл бұрын
This channel is fantastic! 👏
@lessiom42557 жыл бұрын
Keep it up, fantastic video as always!
@AboutVelvet3 жыл бұрын
Now that's a well-made video.
@CZBorda016 жыл бұрын
These are amazing tutorials! Great job. I got really excited on C++ because of them. Are there any similar tutorial on youtube about C# or Java?
@fangornthewise2 жыл бұрын
I second the question but towards Javascript or Solidity.
@w3w3w34 жыл бұрын
Thanks for another great video Cherno!
@superpb6006 жыл бұрын
IDK why the conventions doesn't say to use full upper case in case of constants, so would be 'ERROR' just like Java, then those issues would not happen...
@MrCoder1016 жыл бұрын
Better yet, use enum class and forever avoid conflicts
@utoothheartyeight4 жыл бұрын
Cherno, what IDE are you using in your presentations?
@msidc12384 жыл бұрын
He's using visual studio.
@utoothheartyeight4 жыл бұрын
@@msidc1238 Thank you. I apologize for asking since all I had to do was go way back to one of Cherno's earlier videos and he more than answered the question. Bad of me.
@ahmedghallab5342 Жыл бұрын
شكرا جزيلا ♥️♥️ thank you
@Raul11madrid17 жыл бұрын
Keep going brother your videos is great and very helpful thanks
@supersonic12403 жыл бұрын
Thanks to Cherno I started to actually like C++
@sushilarya20053 жыл бұрын
Explained perfectly nice
@christosioannou99902 жыл бұрын
Can you do a video of using shortcuts when using visual studio …e.g. select a line, select a section, select multiple lines, search etc!! Thanks 🙏🏻
@JiwonSong956 жыл бұрын
It helped me a lot but bit fast for non native english speaker haha
@909666894 жыл бұрын
I can't see his vedio on normal speed. I always decrease speed and used subtitle
@darkushippotoxotai95364 жыл бұрын
I understand him but seriously, you can't code as fast if you are a beginner. I have to pause the vid. Each time he does something.
@brunocalhiari9763 жыл бұрын
I know this comment is 2 years old already but, for you or anyone facing this problem...just keep practicing watching more and more videos in English, and also try to see vídeos of the person talking directly to the camera, it is easier to understand and make you get used...and don't quit studying English until you start to understand things, also try to talk to people in English, even by text will improve very much your vocabulary....just keep pushing, and eventually you'll be talking in English without even realizing, because it is a very simple language (my native is Portuguese)...another thing that I've done was changing every electronic device I use to English, and start to read every book in English instead of Portuguese, also, another big thing was start searching in Google in English...well, I hope you're not having problems with this anymore, but if you still do, this is what I did and it worked...
@bartichaut69573 жыл бұрын
@@brunocalhiari976 Thanks for your comments. I'm french but i can understand what he said with the subtitles activated.
@Xx_McJasper_xX3 жыл бұрын
Nice and clean, as usual. Enums aren't that interesting, but I'm glad to see you described them as basically just compiler-enforced sugar.
@avinashmehtadelhi3 жыл бұрын
please do post a video on enum class. thanks
@PerchEagle5 жыл бұрын
thanks dude, I learned that I can control the size of enum members :)
@audreylee85543 жыл бұрын
what's the font do you use? I cant find a good font in VS...
@drinixgames72717 жыл бұрын
Hey Ian I think you should've talked about enum classes, the addition of enums in C++14? I think, enum classes change a lot of stuff about enums, so they are not just plain integers(well technically they are but you cannot compare two enums of different class types!
@TheCherno7 жыл бұрын
As I mentioned (twice), enum classes will be covered in a future video. Also it's *Yan
@drinixgames72717 жыл бұрын
TheChernoProject excuse me sir, also your videos are being really helpful for me :).
@TheCherno7 жыл бұрын
No worries, glad you're enjoying them :)
@batman_1st6 жыл бұрын
Can you please do a video on template class?
@nanayang3736Ай бұрын
wanna know if the the enum classes video has been out now or not
@mtraven235 ай бұрын
the way he wrote the enum ref in the main class (Log::Level) -- that looks like static member addressing, I see no static keyword on the enum, does that mean they are static by default?
@kenamreemas32955 жыл бұрын
That hair though! XD
@smitadeshpande65255 жыл бұрын
hi you can use refactor feature of visual studio for renaming a variable at multiple places automatically.
@jscorpio19875 жыл бұрын
I think he was doing it manually for the purposes of this tutorial so that we could see what’s going on more easily.
@alex.ander.bmblbn3 жыл бұрын
a great example of how you might use it in real life is how you want to use boolean type in C: instead of having an integer taking two values, you go with typedef enum { false, true } bool; and there you go, you can use your good old true and false
@alex.ander.bmblbn3 жыл бұрын
@Artem Katerynych the same way you can say that C has classes if you define a class as a structure. Im saying ORIGINALLY, without any additional includes
@autumnleaf84833 жыл бұрын
This is something in Roblox Studio(game development platform for Roblox, also learning that and as well as C++) but ENUMs work the same way how it works in Roblox Studio scripting.
@autumnleaf84833 жыл бұрын
Probably because Roblox is made of C++ and Lua.
@computerprogrammer79423 жыл бұрын
Roblox is made from C and uses Lua
@computerprogrammer79423 жыл бұрын
Roblox made their enums a bit different
@autumnleaf84833 жыл бұрын
@@computerprogrammer7942 Umm... well uh, Enums are strings with a number as their value... same goes for Roblox, except that there are Enums for Enums. Like nested Enums.
@autumnleaf84833 жыл бұрын
If I am wrong sorry, it's been a over a month nice I learned or practiced C++
@Maceta4442 жыл бұрын
5:40 Aren't we breaking encapsulation with this?!
@bradcasper48232 жыл бұрын
5:40 Now you have to use this: log.SetLevel(Log::Level::LevelWarning);
@amolkarande28316 жыл бұрын
I would like to suggest that to add an enum "count" to track the number of enums as a good practice. Correct me if I am wrong.
@1matroska4 жыл бұрын
Thanks again!
@odrabil1236 жыл бұрын
I’ve watch some of your videos, they are all great, especially the examples. Can you please tell me what IDE you use?
@DominicVictoria3 жыл бұрын
I’m just watching this again for my sanity because I’m getting tired of JavaScript tutorials on yt. I wish someone would have something well put up series like this.
@user-ug9sh3vp4n Жыл бұрын
how do you have multiple in main() functions in one project
@froycardenas5 жыл бұрын
One simple question: why a statement inside an enum type variable is not finished with a semicolon like any other statements in the body of a block of instructions?
@arnavsharma38803 жыл бұрын
Damn legend. ❤️ 👍
@pablocastaneda40212 жыл бұрын
Super vid
@floppy-disko23784 жыл бұрын
C++ guidelines or whatever were updated in 2019 with Enum.3 so now using plain "Enums" will give a warning code C26812.
@jul88032 ай бұрын
I get an error with: Log log; log.SetLevel(log::LevelError); but the following works: Log log; log.SetLevel(log.LevelError);
@ahmadverse41016 жыл бұрын
Well i have a question that why did you : unsigned char with enum? I didn't understand the size terminology.
@ckkitty5 жыл бұрын
Unsigned means that it will not have negative values, and char is an 8 bit integer char: -127 to 128 unsigned char: 0 to 256
@chrisy.7035 жыл бұрын
really enjoy ur videos and learn quite a lot new things. can you make a vieo about how to develop a project on vsc? VSC is getting pretty popular now. Thank you
@kopuz.co.uk.4 жыл бұрын
using VSC for c++ is like taking 10 steps backwards.
@brunocalhiari9763 жыл бұрын
@@kopuz.co.uk. of course visual studio is far more complete when it supports a language, but it does not top the vscode text edit features, also, if you set it properly, vscode will deliver a experience pretty near of what you'd get on visual studio
@loganayers78513 жыл бұрын
Jesus... I was about to make fun of your hair then you went and explained EXACTLY the fuck I needed to know... Like perfectly... You're hair remains off limits as long as you continue to destroy these tutorials. Thanks bruh.
@ItsTheJackpot7 жыл бұрын
Really liking these tutorials, I was told I am going to get C++ classes in the second half of the coming year, so this gives me a nice headstart. May I ask though, is it me or is the footage a bit gray?
@hamzamameche38933 жыл бұрын
I still don't get when to use the dot operator and when to use the scope operator, I get that because enum is a sort of const static ? that you access it through the scope operator?
@imadvurkadinohinto4 жыл бұрын
many thanks to this pretty guy!
@anthonyhalim9265 жыл бұрын
Can we modify enums somehow for non-integer hard-coded values? Like string, for example? Help much appreciated.
@oleholgerson34166 жыл бұрын
great videos, keep it up. although I watched so many videos I still can‘t figure out what animal is sitting on his head...
@shreeharshas68933 жыл бұрын
which is the compiler you are using??
@adrianoldchannel24946 жыл бұрын
This is good stuff.
@BrandonAB6 жыл бұрын
Brilliant.
@davidboygenius68434 жыл бұрын
Do a video on File Stream I/O for C++
@Byynx2 жыл бұрын
How at 6:55m is possible to pass an arg by only writing Log::LevelError sinse neither Log class or Levelerror are static ?
@puppergump41172 жыл бұрын
I've been using cpp for a while and I've never used the static keyword. My best guess is that the enum values are only scoped to the class, not the enum itself.
@ncky24314 жыл бұрын
How can you have log and main which both have a main function at the same time and still execute the right main function? Also when I try to remove the main function I dont want to execute I just get a bunch of linking errors which I dont know how to resolve.
@kazirojanarahaman81314 жыл бұрын
When you create an object with an enumeration as a member data, do you have to set the enumeration to something or will it give a random value automatically?
@ravisankar67796 жыл бұрын
Hi all, I didn't understand one thing.Can anybody explain specifying ": data type" after the enum name in the example (1st example) ??
@eliaswilliam13372 жыл бұрын
Whats the difference of using an enum and just #define levelerror 0 for example?
@noooeels3677 жыл бұрын
Jaaaay, video!
@henrycormen38057 жыл бұрын
please talk about template coding , thanks!!!
@AbdulMoiz-ho8rx2 жыл бұрын
great
@fedvgo3 жыл бұрын
is there a way to print the name of the enum you choose so error =0 is there a way to print just the name instead of the int
@jakubhorak6365 жыл бұрын
I prefer using enum class. You dont have to care about conflicts.
@serkanozturk4217 Жыл бұрын
Personal notes: - enum is enumerated integer at the end of the day.