I absolutely HATED this video! Not because it wasn't helpful, but it made me realize that half the custom methods and dictionaries I created could have been done with a simple two line LINQ statement! Thank you so much Jason :D
Haha, I often get the same feeling when switching to Unreal. They have so many built in methods and none of them totally fucks up the performance. Still like writing C# a lot tho. Maybe your methods will still be useful, since Linq is known to be a mayor performance killer. In my last project I had to actually switch from Linq to custom methods in favor of performance.
@@officialnickname every single collections manipulation call method in LINQ, that you wrote as a lambda expression. That the main obvious performance fucker. You still can wrote a library of methods that will work on low level and use low level technics, but will not call million of methods every loop step, This will save your performance. Its not that hard to wrote actual set of fast methods you actually need and use them across the board in your project. Actually this topic is more about how c# compiler works, how its manage memory, cache misses and so on... and what you can do about this. Im pretty sure not that much people actually cares, how data flow, how it being processed and What actually your c# code work in this cases. Its usually the main base thing for performance
@@rodrigolegendre8950, his ignorance will never be eradicated but it was reduced a little. The same applies to any human who has learned from the video, including me xd
@jcwyke He was the Chosen One! It was said that he would show the truth about LINQ , not join LINQ fan club. bring balance to the code, not leave it in darkness. :D
Yup... I always use dark mode myself. Always annoys me when some app lacks a dark mode, like MS SQL Management Studio. At least Unity finally added a dark mode that does not require the Pro version.
I just want to say thank you for compiling these examples. I've struggled for days trying to get a simple group by and sum to work in my game. And your example at 16:18 is what finally made it click for me. So thanks!
LINQ seems really powerful, and I wasn't aware of how to use it before. Thank you as always for explaining a concept with clear examples. Also, dark mode is great as it is easier on the eyes, as others have noted, but either is fine.
I absolutely Love the dark mode! I recently went over a few of your videos to help understand delegates and such a lot more and I'm glad I did! It's helped me understand a lot better what Linq is really doing, super helpful!
No joke, I just learned that the Lookup collection is a thing, and its the most useful thing ever, seriously, you could probably make a full video just going through the different c# collections and it'd be awseome content
wow thank you so so much for this video. I never realized I could get this sort of functionality this easily. Also, I like how you chose to zoom in for, "OR ZERO, IF THEY'RE ALL DEAD." it's these small creative decisions that really bring things together :)
I'm not going to comment much on the contents of the video and run the risk of stating the obvious, namely that it's AWESOME... I actually wanted to give you some positive feedback on its form... I really apreciated the clearness and the well-structured manner of the examples that you gave us. I must admit, I usually find many of your previous videos TL;DW (with long-winded explanations and an occasional rant or two... we're all just humans these days), which is such a shame, because your choice of the topics is great. But this time you performed that alchemy of transmuting the lead of your great gamedev experience into pure didactic gold which you shared with us and for which we are ever-grateful to you. As anyone among us can attest, alchemy is quite an elusive lore of magic. I wish you best of luck in perfecting it, so that we can all keep on growing alongside you. EDIT: Oh, and the dark mode is a great choice IMO :)
Jason with dark mode! please keep using it, it's much more clean then the regular one :( Also, Great video! LINQ is a life saver when it comes to making code cleaner and more understandable!
Definitely dark mode, easier on the eyes. Thanks for the video, learned some linq fundamentals in less than half an hour that weren't covered in a month at the new job.
Personally I have no issue with light mode but it can strain the eyes for some people. My gf for example can’t stand it because it genuinely is just uncomfortable to view. Dark mode is the safest prolly.
the LINQ is nice and handy but I wouldn't recommend to use it per frame as most of the methods allocate memory and create more work for garbage collector. Even lambda functions used as predicates in the examples do make some memory allocations. Actually Jason warned about the things I wrote above. Started commenting before the video ended. :) Nice one, Jason!
Great Video Jason, I have started using Linq extensively just because of this video. One suggestion for you is to put chapter markers in the Video so I can jump over to a specific position
Absolutely EXCELLENT...!!! Very nice tutorial and one I learned A LOT from watching. - Also, Dark Mode is fine. I'm not a huge fan of Dark Mode, but it forks fine for tutorials. Great job...!!!
I wish I knew about this stuff years ago. So helpful. And I really like the dark mode. It's much easier on my eyes. Plus I use the dark theme of RUclips. Black on Black!
Great video! Even better than normal! Dark v Normal: Don't mind either. What I did appreciate in this video though is that you fiddled a lot less than normal. Normaly you scroll over the code so fast it's difficult to understand anything except things you already familiar with... I'd rather skip forward things I know then have to rewatch the video, over and over again, trying to catch a glimse of some code snippet. :) Cheers!
Thanks to the dark mode, I can finally view your videos full screen without hurting my eyes. I know I should probably turn down the brightness of the monitor, but I am working on a game with a really dark story, so that's not possible.
Yo! How did I not know about this. Thanks for sharing this info dude. Linq is so powerful and all the examples are an amazing way to show off what it can do. 10/10 Video
Generally I tend to use Linq only in the Unity Editor extension, when creating tools. I honestly avoid it on the Gameplay and runtime, if it's something that will happen more than once and after the game initialization. I also have used Linq for my Dependency Injection framework, of course, but as I said that runs only at the beginning and it has some maintenance whenever we change scene, but nice vid as usual sir Jason.
Yes please, continue using dark mode. I think the text jumps out better and it isn’t straining on my eyes, which get very easily tired from non-darkmode especially when watching these vids in a dark room before going to sleep
I really like you tutotials. You do a great job . I have a little comment for this one: Not sure but I think that if you use Sort to do a random list of something, you would acheive it in O(Log(n)) where you can do faster in O(n) in normal code. I wouldn't recommend to use it this way.
One thing I found to be important to note about IEnumerable is that it refers to the Linq statement as long as it remains an IEnumerable. I had an optimization problem because of this as I had kept the collections as IEnumerable which means every time these were used, they would redo the previous Linq statements to get the data again, but if you run a ToList or ToArray it will be a more static collection instead of redoing the Linq statement code on the original source every time you use it. That highly optimized my code. So remember to make it into a list or array.
Do you ever make LINQ queries directly on a SQLite db in game? I would like to do this at some point possibly and I'm curious if you have quick thoughts on that topic
I too was worried about Linq statements, but I did some research quite long ago, and they are greatly optimized, you lose 10-15% performance at most. Great video! I am too more of the white theme, but is more damaging on our eyes (blue light), so yeah is a great idea to keep it with the dark theme.
Hey Jason, I really like your teaching style and I would love to take your courses but unfortunately as a student, I just simply can't afford to spend 1000$ on it. Have you thought about maybe adding different monetary plans like for example a monthly subscription to make your classes more accessible?
Why would you even want to take a $1000 course in the first place? It's not like there's a lack of free Unity tutorials, documentation and best practices out there. Just make a few cool projects to put on your resume, get some kind of degree in media or software engineering and then go ahead and apply. Even if you're not that experienced, chances are you will still get a job at some startup (due to a lack of Unity developers).
@@officialnickname I actually do have a unity job. And although it's true that here are a lot of free tutorials, most of them don't come close to his videos.
I was in the same boat, then I just took the plunge despite working already with Unity and not having much disposable cash. It was still well worth it, levelled up my code so much and is far ahead of the free tutorials you can find.
you didn't mention the most important part - linq statements are executed when the result of all of them is converted into a concrete type like .ToList(), .ToArray, or even .First()/.FirstOrDefault() so you can actually create a query, then pass it as a parameter somewhere else and later execute it.
Ohh, I usually used .Where(some condition) and then add .Any() to that to make sure there is any of these. I did often think it would be nice to have the condition inside the Any statement but never tried doing it, not sure why. But now I will for sure :)
Add another vote for dark mode. LINQ is awesome but it can be hard on the garbage collector. Use ToList() sparingly, better to pre-allocate List collections and then use AddRange() with the IEnumerable returned from your query. You can also use foreach() statements over the result of the LINQ enumerable without calling ToList() to do so.
AddRange also allocates a temporary array, that must be deallocated by the GC at some point in time. If you wanna write 100% optimised code you should simply Add element by element in a for loop (making sure your list has been pre-allocated with sufficient capacity).
@@Alzimovich2 That's definitely good to know, thanks! If you've already allocated space in your existing List though, does it still need to do another temporary array or is it able to just add the items "in place"?
@@Alzimovich2 most definitely! Now I'm write my own AddEnumerable() extension method to replace the AddRange() in order to do the iteration as you pointed out. I learned something new today!
My eyes thank you for the dark mode :) Linq is extremely helpful and easy if you get use to it a little bit. Also could you may be make a video for hashsets? It may not be useful like linq but helps a lot and is a good alternative for mobile development to prevent performance issues
Hey Jason love your videos, do you have a LinkedIn account. The main reason why most peoples eyes hurt in light mode is because they are using it in a dark room. Using devices with bright settings in a dark room does strain the eyes and cause blindness.
I absolutely HATED this video! Not because it wasn't helpful, but it made me realize that half the custom methods and dictionaries I created could have been done with a simple two line LINQ statement!
Thank you so much Jason :D
Then you didn't hate the video. You hated your ignorance.
Good news is: Your ignorance has been erradicated! =D
Haha, I often get the same feeling when switching to Unreal. They have so many built in methods and none of them totally fucks up the performance. Still like writing C# a lot tho. Maybe your methods will still be useful, since Linq is known to be a mayor performance killer. In my last project I had to actually switch from Linq to custom methods in favor of performance.
@@officialnickname every single collections manipulation call method in LINQ, that you wrote as a lambda expression. That the main obvious performance fucker. You still can wrote a library of methods that will work on low level and use low level technics, but will not call million of methods every loop step, This will save your performance. Its not that hard to wrote actual set of fast methods you actually need and use them across the board in your project. Actually this topic is more about how c# compiler works, how its manage memory, cache misses and so on... and what you can do about this. Im pretty sure not that much people actually cares, how data flow, how it being processed and What actually your c# code work in this cases. Its usually the main base thing for performance
@@rodrigolegendre8950, his ignorance will never be eradicated but it was reduced a little. The same applies to any human who has learned from the video, including me xd
@jcwyke He was the Chosen One! It was said that he would show the truth about LINQ , not join LINQ fan club. bring balance to the code, not leave it in darkness. :D
Dark mode is light on the eyes and makes videos easier to view.
It's ideal for those of us who watch late at night. It's probably a bad habit, but I sometimes watch development videos in bed before falling asleep.
Also battery usage on mobile's may reduce a little bit
Yeah he finally did the switch!
@@rod-abreu once you make the switch you can't go back. sometimes i wish i could use things on light theme 🙁
Yup... I always use dark mode myself. Always annoys me when some app lacks a dark mode, like MS SQL Management Studio. At least Unity finally added a dark mode that does not require the Pro version.
Keep it on the dark mode please, it's easier to watch this way
Love the dark mode. Makes it easier to watch at night without hurting the eyes.
Dark mode is an absolute must! I can't look at bright screens for long periods of time without getting headaches!
Wow a relevant sponsor. I like that. As for the dark theme. I just like the dark background.
I just want to say thank you for compiling these examples. I've struggled for days trying to get a simple group by and sum to work in my game. And your example at 16:18 is what finally made it click for me. So thanks!
You're very welcome, glad it was helpful:)
LINQ seems really powerful, and I wasn't aware of how to use it before. Thank you as always for explaining a concept with clear examples. Also, dark mode is great as it is easier on the eyes, as others have noted, but either is fine.
I found out I needed linq from my very first video game. This is great advice.
Agree with dark mode. It makes a huge difference. Love all your work. Thank you.
I absolutely Love the dark mode! I recently went over a few of your videos to help understand delegates and such a lot more and I'm glad I did! It's helped me understand a lot better what Linq is really doing, super helpful!
No joke, I just learned that the Lookup collection is a thing, and its the most useful thing ever, seriously, you could probably make a full video just going through the different c# collections and it'd be awseome content
wow thank you so so much for this video. I never realized I could get this sort of functionality this easily. Also, I like how you chose to zoom in for, "OR ZERO, IF THEY'RE ALL DEAD." it's these small creative decisions that really bring things together :)
I'm not going to comment much on the contents of the video and run the risk of stating the obvious, namely that it's AWESOME... I actually wanted to give you some positive feedback on its form... I really apreciated the clearness and the well-structured manner of the examples that you gave us. I must admit, I usually find many of your previous videos TL;DW (with long-winded explanations and an occasional rant or two... we're all just humans these days), which is such a shame, because your choice of the topics is great. But this time you performed that alchemy of transmuting the lead of your great gamedev experience into pure didactic gold which you shared with us and for which we are ever-grateful to you. As anyone among us can attest, alchemy is quite an elusive lore of magic. I wish you best of luck in perfecting it, so that we can all keep on growing alongside you.
EDIT: Oh, and the dark mode is a great choice IMO :)
The video was very helpful and I appreciate the use of dark mode. Thanks Jason!
It looked really complex to me at first, once I started using it I just got in love with linq. Very usefull and elegant
Thanks, it was useful. I already use LINQ regularly, but still learned some new stuff from the video.
Jason with dark mode! please keep using it, it's much more clean then the regular one :(
Also, Great video! LINQ is a life saver when it comes to making code cleaner and more understandable!
Amazing! I've been wondering about this for a while now, thank you for making this video Jason!
Dark mode is nice on the eyes been something I've been waiting for you to do for a while 👍always love the videos 🙂
yeah, this goes in the game dev playlist for sure
Definitely dark mode, easier on the eyes. Thanks for the video, learned some linq fundamentals in less than half an hour that weren't covered in a month at the new job.
Personally I have no issue with light mode but it can strain the eyes for some people. My gf for example can’t stand it because it genuinely is just uncomfortable to view. Dark mode is the safest prolly.
Linq is really cool, but it's yet ANOTHER thing to learn. I can't keep up! I appreciate this.
This video just blew my mind wide the hell open. Thanks Jason!
the LINQ is nice and handy but I wouldn't recommend to use it per frame as most of the methods allocate memory and create more work for garbage collector. Even lambda functions used as predicates in the examples do make some memory allocations.
Actually Jason warned about the things I wrote above.
Started commenting before the video ended. :)
Nice one, Jason!
Great Video Jason, I have started using Linq extensively just because of this video. One suggestion for you is to put chapter markers in the Video so I can jump over to a specific position
Good lord why have I not been using Linq until now... Amazing vid
Absolutely EXCELLENT...!!! Very nice tutorial and one I learned A LOT from watching. - Also, Dark Mode is fine. I'm not a huge fan of Dark Mode, but it forks fine for tutorials. Great job...!!!
I like the dark mode. .great video . . I noticed you covered linQ before, but this is very good as well. .Thanks.
I became a game developer by watching Jason, Brackeys, BlackThornProd and CodeMonkey =))) thank you so much
This is amazing! You're even helping me with work as I'm participating in a dotnet core project currently. Love your videos, man!
I wish I knew about this stuff years ago. So helpful.
And I really like the dark mode. It's much easier on my eyes. Plus I use the dark theme of RUclips. Black on Black!
The dark theme is good, thanks for that. Actually, I took it for granted ;)
I like the the dark mode :)
Thanks for the information!
Great video! Even better than normal!
Dark v Normal: Don't mind either. What I did appreciate in this video though is that you fiddled a lot less than normal. Normaly you scroll over the code so fast it's difficult to understand anything except things you already familiar with... I'd rather skip forward things I know then have to rewatch the video, over and over again, trying to catch a glimse of some code snippet.
:) Cheers!
Thanks for another great video! I support the use of dark mode 👍
That was great Jason, thanks!
This is SO GOOD! Thank you, Jason!!!
Thanks to the dark mode, I can finally view your videos full screen without hurting my eyes.
I know I should probably turn down the brightness of the monitor, but I am working on a game with a really dark story, so that's not possible.
Loving that dark theme! Video is great and detailed as always
Good topics, Jason. I like that you talk about things that are relevant to programming and not just Unity or games.
I love the kind of content and the dark mode. 👍
super helpful! Thank you for using dark theme :D
Yo! How did I not know about this. Thanks for sharing this info dude. Linq is so powerful and all the examples are an amazing way to show off what it can do. 10/10 Video
Really appreciate your videos
love dark mode please continue it, and great video.
Love dark mode... Keep it up! Also, linq is cool. Been using it for years now. Solves all sorts of complicated queries.
Great and useful example Jason! Used it a while back.
I once saw you using a LINQ statement in one of your videos a while ago, the next day I started using it and never looked back xD
Thank you for making this video!
Awesome, I was just looking for a decent tutorial series for LINQ statements the other day. Dark mode is nice btw.
You are the fucking best teacher for pro Unity developers!
Dark mode makes the text jump out of the screen better, IMO.
Very helpful. Also, my eyes like dark mode. 👍🏻
Generally I tend to use Linq only in the Unity Editor extension, when creating tools. I honestly avoid it on the Gameplay and runtime, if it's something that will happen more than once and after the game initialization. I also have used Linq for my Dependency Injection framework, of course, but as I said that runs only at the beginning and it has some maintenance whenever we change scene, but nice vid as usual sir Jason.
Same here. LINQ is wonderful, but as Jason said it totally destroys performance since it causes the GC to be called continuously :/
Yes please, continue using dark mode. I think the text jumps out better and it isn’t straining on my eyes, which get very easily tired from non-darkmode especially when watching these vids in a dark room before going to sleep
Me: Thinks of topic I want to learn
Jason:
I really like you tutotials. You do a great job . I have a little comment for this one: Not sure but I think that if you use Sort to do a random list of something, you would acheive it in O(Log(n)) where you can do faster in O(n) in normal code. I wouldn't recommend to use it this way.
Hey, I like Dark mode but I'm ok with regular as well :D
Thnx for "Linq" explanation!
Yes, thank you for using dark mode :)
I prefer dark mode, but I don't care, I come to you first when I wanna learn something, dark mode or not lmao.
Thanks for the video man
I don't comment too often. But when you asked to me to support dark mode, here I am! I even paused to video to come and comment! Dark mode 100%!
Dark mode is awesome 👌
One thing I found to be important to note about IEnumerable is that it refers to the Linq statement as long as it remains an IEnumerable. I had an optimization problem because of this as I had kept the collections as IEnumerable which means every time these were used, they would redo the previous Linq statements to get the data again, but if you run a ToList or ToArray it will be a more static collection instead of redoing the Linq statement code on the original source every time you use it.
That highly optimized my code. So remember to make it into a list or array.
Do you ever make LINQ queries directly on a SQLite db in game? I would like to do this at some point possibly and I'm curious if you have quick thoughts on that topic
Never heard of these, very glad I watched the vid, good stuff!
Also thumbs up for darkmode.
Dark mode is 🔥🔥
Very helpful.
I too was worried about Linq statements, but I did some research quite long ago, and they are greatly optimized, you lose 10-15% performance at most. Great video! I am too more of the white theme, but is more damaging on our eyes (blue light), so yeah is a great idea to keep it with the dark theme.
I like the change to dark mode. Lot easier on the eyes.
great video! what font is this?
Hey Jason, I really like your teaching style and I would love to take your courses but unfortunately as a student, I just simply can't afford to spend 1000$ on it. Have you thought about maybe adding different monetary plans like for example a monthly subscription to make your classes more accessible?
Yes! I looked at the course and wanted to do it, but being brazilian, I simply can't afford to take a $1000 course
Why would you even want to take a $1000 course in the first place? It's not like there's a lack of free Unity tutorials, documentation and best practices out there. Just make a few cool projects to put on your resume, get some kind of degree in media or software engineering and then go ahead and apply. Even if you're not that experienced, chances are you will still get a job at some startup (due to a lack of Unity developers).
@@officialnickname I actually do have a unity job. And although it's true that here are a lot of free tutorials, most of them don't come close to his videos.
I was in the same boat, then I just took the plunge despite working already with Unity and not having much disposable cash. It was still well worth it, levelled up my code so much and is far ahead of the free tutorials you can find.
@@officialnickname Ik I'm 6 months later and I absolutely agree with you
nice video today i understand link way better plus i like dark mode
Dark mode is king! So easy on the eyes :-)
definitely like the dark theme
you didn't mention the most important part - linq statements are executed when the result of all of them is converted into a concrete type like .ToList(), .ToArray, or even .First()/.FirstOrDefault()
so you can actually create a query, then pass it as a parameter somewhere else and later execute it.
You can use IEnumerables like you do a list, so there is no need to convert the to a List or Array!
What situation would you use this?
Great video buddy. Keep dark mode too - my eyes prefer it.
Dark mode is Lit !
Ohh, I usually used .Where(some condition) and then add .Any() to that to make sure there is any of these.
I did often think it would be nice to have the condition inside the Any statement but never tried doing it, not sure why. But now I will for sure :)
Yes, dark mode FTW!
Great video and dark mode yes pls
Dark mode is the way to go!
As for non-programming background, Linq is really useful feature.
Add another vote for dark mode. LINQ is awesome but it can be hard on the garbage collector. Use ToList() sparingly, better to pre-allocate List collections and then use AddRange() with the IEnumerable returned from your query. You can also use foreach() statements over the result of the LINQ enumerable without calling ToList() to do so.
AddRange also allocates a temporary array, that must be deallocated by the GC at some point in time. If you wanna write 100% optimised code you should simply Add element by element in a for loop (making sure your list has been pre-allocated with sufficient capacity).
@@Alzimovich2 That's definitely good to know, thanks! If you've already allocated space in your existing List though, does it still need to do another temporary array or is it able to just add the items "in place"?
@@joedelekto8494 It allocates no matter what, look at the AddRange implementation to find out :)
@@Alzimovich2 most definitely! Now I'm write my own AddEnumerable() extension method to replace the AddRange() in order to do the iteration as you pointed out. I learned something new today!
I prefer dark mode, since light mode can cause some eye strain for me.
Dark mode all the things!
Dark mode please, you rock!
My eyes thank you for the dark mode :) Linq is extremely helpful and easy if you get use to it a little bit. Also could you may be make a video for hashsets? It may not be useful like linq but helps a lot and is a good alternative for mobile development to prevent performance issues
Dark mode forever!
What is the advantage of Backtrace over Firebase Crashlytics?
Dark mode all day everyday. My eyes say thank you.
thank you so much
yes dark mod is better :)
Anyone know the name of the extension or feature that gives that in-code source support ( the grey on grey text e.g. :Npc )
how can I use the ".where" with private attributs in classes? 8:33 timestamp for reference
@jason can you show how to use rigidbody to an object in zero gravity so it feels less floaty I know it supposed to, but in VR it can be jarring
Yes to Dark mode :)
Dark mode 🤘
I love dark mode, yeah
Hey Jason love your videos, do you have a LinkedIn account. The main reason why most peoples eyes hurt in light mode is because they are using it in a dark room. Using devices with bright settings in a dark room does strain the eyes and cause blindness.