Just a note for this video that I think is important to point out. Apart from the switch statement being more elegant, it is also more efficient, especially when you have lots of cases. The reason being, a switch statement is generally implemented with a hash table or a similar data structure, giving you (ideally) an O(1) time complexity to get through the switch. With an if statement, worst-case scenario, you have to compare your variable to every single case, leaving you with an O(n) time complexity, n being the number of cases, which can be slow.
@rmt35899 ай бұрын
Hence why I'm here. Someone I loathe refuses to use these, and has pages of if/else. I want to be nothing like him, so I'm doubling down.
@paulzupan37322 жыл бұрын
There's one drawback to the switch statement that's quite important, and that is the fact that the cases in the statement must be compile-time constants. So if you get errors that a variable is not usable in a constant expression or the compiler complains about a call to a non-constexpr function, that's why.
@thatdude83682 жыл бұрын
Like how you go very in depth to everything em explain everything all the way through
@QuaternionPhysics13 жыл бұрын
Can’t wait for the more advanced stuff! Amazing series so far, probably the best 👀 Keep it up, Tim!
@aaravgp13323 жыл бұрын
I have finally got ther confirmation for vectors, pointers and refferences, which is what I was waiting for in the series
@seireiart3 жыл бұрын
Finally, the tutorial YandereDev need to watch the most LMAO XDD
@Jordan4Ibanez2 жыл бұрын
Switch statements create jump tables when they are compiled into machine code, for a huge list that, let's say is running 165 times a second in a list of 1000 items, this performance improvement can be EXTREME
@mariustrelea51323 жыл бұрын
I was waiting for new c++ lesson 😁😁😁
@user-sy3ny1sz2w3 жыл бұрын
Switch statement can't use string a.k.a "std::string" and C string a.k.a "const char*" as expression.
@finnqni85633 жыл бұрын
Thanks for you content Tim ;)
@zolbooenkhjargal26702 жыл бұрын
ty
@TrueGemsOnly3 жыл бұрын
My education system failed, this youtube man excelled
@yourdadsbestfriend71013 жыл бұрын
yes tim!
@pravachanpatra40123 жыл бұрын
Can you make more pygame and tutorials please in python.
@195dawids3 жыл бұрын
What chair are you using dude?
@bobdeath53 жыл бұрын
How much focus will you be putting on creating graphics or seperate windows in future videos?
@snknoid3 жыл бұрын
pls make video 5 ideas for game in pygame
@keshav.mishra3 жыл бұрын
Tim! Which degree are you doing Bsc (computer science) or Btech (computer science)
@mbmeweg2933 жыл бұрын
Thank ya)
@lemahtab Жыл бұрын
So, this is similar to SQL's CASE statement, right? Don't need it but is better than IF ELSE in some cases.
@JimPageGD3 жыл бұрын
Cool
@shehanprasanna39053 жыл бұрын
❤
@melissajones52693 жыл бұрын
huzzah
@rayaanibrahim48083 жыл бұрын
2nd
@DATABRO61303 жыл бұрын
Bro can u please explain about power shell please bro i need it please🙏🙏🙏🙏