DEMYSTIFYING linq - UNITY3D!

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 185

  • @JakeThe_Dog
    @JakeThe_Dog 3 роки тому +111

    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

    • @rodrigolegendre8950
      @rodrigolegendre8950 3 роки тому +4

      Then you didn't hate the video. You hated your ignorance.
      Good news is: Your ignorance has been erradicated! =D

    • @officialnickname
      @officialnickname 3 роки тому +1

      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.

    • @nikolaynakorkeshko448
      @nikolaynakorkeshko448 3 роки тому +1

      @@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

    • @rubencruz2687
      @rubencruz2687 3 роки тому

      @@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

    • @nikolaynakorkeshko448
      @nikolaynakorkeshko448 3 роки тому +1

      @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

  • @portraitstonelabs
    @portraitstonelabs 3 роки тому +162

    Dark mode is light on the eyes and makes videos easier to view.

    • @jahoopyjaheepu497
      @jahoopyjaheepu497 3 роки тому +3

      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.

    • @MrTastelessVideos
      @MrTastelessVideos 3 роки тому

      Also battery usage on mobile's may reduce a little bit

    • @rod-abreu
      @rod-abreu 3 роки тому +1

      Yeah he finally did the switch!

    • @kippenegg
      @kippenegg 3 роки тому +1

      @@rod-abreu once you make the switch you can't go back. sometimes i wish i could use things on light theme 🙁

    • @KasperSOlesen
      @KasperSOlesen 3 роки тому

      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.

  • @KasperSOlesen
    @KasperSOlesen 3 роки тому +1

    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.

  • @playuno46
    @playuno46 3 роки тому +107

    Keep it on the dark mode please, it's easier to watch this way

  • @brianjensen2532
    @brianjensen2532 3 роки тому +6

    Wow a relevant sponsor. I like that. As for the dark theme. I just like the dark background.

  • @keelanbowker-obrien2222
    @keelanbowker-obrien2222 3 роки тому +1

    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 :)

  • @ViciousProgressor
    @ViciousProgressor 3 роки тому +4

    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.

  • @yesitsjade
    @yesitsjade 3 роки тому +2

    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!

  • @shawnw86
    @shawnw86 3 роки тому +6

    Love the dark mode. Makes it easier to watch at night without hurting the eyes.

  • @harrison298
    @harrison298 2 роки тому

    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!

    • @Unity3dCollege
      @Unity3dCollege  2 роки тому

      You're very welcome, glad it was helpful:)

  • @TheKiwiCoder
    @TheKiwiCoder 3 роки тому +1

    Amazing! I've been wondering about this for a while now, thank you for making this video Jason!

  • @FilippyPy
    @FilippyPy 3 роки тому +6

    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

  • @dererzherzog
    @dererzherzog 3 роки тому +2

    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 :)

  • @rani600
    @rani600 3 роки тому +6

    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!

  • @heyjeanwtf
    @heyjeanwtf 3 роки тому +1

    This is amazing! You're even helping me with work as I'm participating in a dotnet core project currently. Love your videos, man!

  • @ssingh134
    @ssingh134 3 роки тому

    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

  • @Trader_Logan
    @Trader_Logan 3 роки тому +1

    I found out I needed linq from my very first video game. This is great advice.

  • @MsDestroyer0
    @MsDestroyer0 3 роки тому +1

    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!

  • @markaldrich8753
    @markaldrich8753 3 роки тому +1

    Dark mode is an absolute must! I can't look at bright screens for long periods of time without getting headaches!

  • @benfeldbergcollins6568
    @benfeldbergcollins6568 3 роки тому +24

    Dark mode is nice on the eyes been something I've been waiting for you to do for a while 👍always love the videos 🙂

  • @BluesInSeattle
    @BluesInSeattle 3 роки тому

    Good topics, Jason. I like that you talk about things that are relevant to programming and not just Unity or games.

  • @RusAres
    @RusAres 3 роки тому

    Thanks, it was useful. I already use LINQ regularly, but still learned some new stuff from the video.

  • @EricOuellet2
    @EricOuellet2 3 роки тому +1

    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.

  • @Chronomatrix
    @Chronomatrix 3 роки тому +3

    Linq is really cool, but it's yet ANOTHER thing to learn. I can't keep up! I appreciate this.

  • @batatafritanhamnham
    @batatafritanhamnham 3 роки тому

    The video was very helpful and I appreciate the use of dark mode. Thanks Jason!

  • @Jay12321Jay
    @Jay12321Jay 3 роки тому

    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!

  • @LatchGameDev
    @LatchGameDev 3 роки тому

    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

  • @jonahmcconnell4818
    @jonahmcconnell4818 3 роки тому

    Loving that dark theme! Video is great and detailed as always

  • @KenLevelTen
    @KenLevelTen 3 роки тому

    Agree with dark mode. It makes a huge difference. Love all your work. Thank you.

  • @Lazzarus7
    @Lazzarus7 3 роки тому

    It looked really complex to me at first, once I started using it I just got in love with linq. Very usefull and elegant

  • @GameLargo
    @GameLargo 2 роки тому

    This video just blew my mind wide the hell open. Thanks Jason!

  • @nialltracey2599
    @nialltracey2599 3 роки тому +6

    Dark mode makes the text jump out of the screen better, IMO.

  • @1977Danijela
    @1977Danijela 3 роки тому +2

    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.

  • @Blind56
    @Blind56 3 роки тому +9

    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.

    • @CyberAngel67
      @CyberAngel67 3 роки тому

      You can use IEnumerables like you do a list, so there is no need to convert the to a List or Array!

    • @lemonke8132
      @lemonke8132 2 роки тому

      What situation would you use this?

  • @filipathtc
    @filipathtc 3 роки тому +9

    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?

    • @Pixelest_Heart
      @Pixelest_Heart 3 роки тому +2

      Yes! I looked at the course and wanted to do it, but being brazilian, I simply can't afford to take a $1000 course

    • @officialnickname
      @officialnickname 3 роки тому +2

      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).

    • @filipathtc
      @filipathtc 3 роки тому +1

      @@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.

    • @snook5555
      @snook5555 3 роки тому

      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.

    • @manuelgraca3118
      @manuelgraca3118 3 роки тому

      @@officialnickname Ik I'm 6 months later and I absolutely agree with you

  • @jahoopyjaheepu497
    @jahoopyjaheepu497 3 роки тому +3

    Me: Thinks of topic I want to learn
    Jason:

  • @duckhive-games
    @duckhive-games 3 роки тому

    Good lord why have I not been using Linq until now... Amazing vid

  • @johnleorid
    @johnleorid 3 роки тому

    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.

  • @shawngesellgaming
    @shawngesellgaming 2 роки тому

    how can I use the ".where" with private attributs in classes? 8:33 timestamp for reference

  • @Jd-zd6bh
    @Jd-zd6bh 3 роки тому

    I like the dark mode. .great video . . I noticed you covered linQ before, but this is very good as well. .Thanks.

  • @francescoc5604
    @francescoc5604 3 роки тому

    yeah, this goes in the game dev playlist for sure

  • @Calixj23
    @Calixj23 Рік тому

    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...!!!

  • @n8dev
    @n8dev 3 роки тому

    super helpful! Thank you for using dark theme :D

  • @lvx969
    @lvx969 3 роки тому

    Awesome, I was just looking for a decent tutorial series for LINQ statements the other day. Dark mode is nice btw.

  • @rod-abreu
    @rod-abreu 3 роки тому +1

    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.

    • @Alzimovich2
      @Alzimovich2 3 роки тому

      Same here. LINQ is wonderful, but as Jason said it totally destroys performance since it causes the GC to be called continuously :/

  • @borisblosse8645
    @borisblosse8645 3 роки тому

    That was great Jason, thanks!

  • @pixelb0i255
    @pixelb0i255 3 роки тому

    Great and useful example Jason! Used it a while back.

  • @danosono
    @danosono 3 роки тому

    I like the the dark mode :)
    Thanks for the information!

  • @PeterFurstenberg
    @PeterFurstenberg 3 роки тому

    Love dark mode... Keep it up! Also, linq is cool. Been using it for years now. Solves all sorts of complicated queries.

  • @ewwitsantonio
    @ewwitsantonio 3 роки тому

    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

  • @ewwitsantonio
    @ewwitsantonio 3 роки тому

    This is SO GOOD! Thank you, Jason!!!

  • @nikodemos71
    @nikodemos71 3 роки тому

    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

  • @Songfugel
    @Songfugel 3 роки тому

    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

  • @TChrisBaker
    @TChrisBaker 3 роки тому

    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 UA-cam. Black on Black!

  • @ozguroz5340
    @ozguroz5340 3 роки тому

    I became a game developer by watching Jason, Brackeys, BlackThornProd and CodeMonkey =))) thank you so much

  • @kurtiswilkins1042
    @kurtiswilkins1042 3 роки тому

    Really appreciate your videos

  • @MRxRadex
    @MRxRadex 3 роки тому +1

    The dark theme is good, thanks for that. Actually, I took it for granted ;)

  • @nilsmuller-cleve6769
    @nilsmuller-cleve6769 3 роки тому

    Never heard of these, very glad I watched the vid, good stuff!
    Also thumbs up for darkmode.

  • @SamDDK
    @SamDDK 2 роки тому

    Anyone know the name of the extension or feature that gives that in-code source support ( the grey on grey text e.g. :Npc )

  • @siulingding73
    @siulingding73 3 роки тому

    great video! what font is this?

  • @XRCADIA
    @XRCADIA 3 роки тому

    Thank you for making this video!

  • @pixelb0i255
    @pixelb0i255 3 роки тому

    @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

  • @ujjwalrajput0612
    @ujjwalrajput0612 3 роки тому

    love dark mode please continue it, and great video.

  • @TommyTheITGuy
    @TommyTheITGuy 3 роки тому

    What is the advantage of Backtrace over Firebase Crashlytics?

  • @This-Was-Sparta
    @This-Was-Sparta 3 роки тому

    I like the change to dark mode. Lot easier on the eyes.

  • @the_cosmicat
    @the_cosmicat 3 роки тому

    Thanks for another great video! I support the use of dark mode 👍

  • @supremus1305
    @supremus1305 3 роки тому

    I love the kind of content and the dark mode. 👍

  • @kdeger
    @kdeger 3 роки тому

    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

  • @AtmosMr
    @AtmosMr 2 роки тому

    hi. I couldn't see a link to the code examples...:(

  • @krissloo143
    @krissloo143 3 роки тому

    Your Stats class is Serializable, Is there any difference between it and System.Serializable?? I've been using System.Serializable only for classes for some reason

    • @wayfarergames
      @wayfarergames 3 роки тому +1

      It's the same thing, if you add "using System", you don't need "System." 😊

    • @krissloo143
      @krissloo143 3 роки тому

      @@wayfarergames I don't usually include System and Serializable still works fine :,) I thought it's only used for variables

    • @krissloo143
      @krissloo143 3 роки тому +1

      @@wayfarergames never mind. That's SerializeField xD my bad

  • @AlanZucconi
    @AlanZucconi 3 роки тому

    Awesome!
    After being sceptical for some time, I'm not a massive LINQ fan!
    It can be a super neat way to get rid of for loops ...which are quite verbose!
    I've also been writing a LINQ tutorial for Unity but... I still need to finish it! 🥲

  • @HipToBeeSquare
    @HipToBeeSquare 3 роки тому +16

    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.

  • @justinbrownakacrisiscloud7520
    @justinbrownakacrisiscloud7520 3 роки тому

    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.

  • @washynator
    @washynator 3 роки тому

    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%!

  • @Ninakoru
    @Ninakoru 3 роки тому

    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.

  • @aarongrincewicz7448
    @aarongrincewicz7448 3 роки тому

    Very helpful. Also, my eyes like dark mode. 👍🏻

  • @Aedeus
    @Aedeus 3 роки тому

    Very helpful.

  • @page0809
    @page0809 3 роки тому

    Hey, I like Dark mode but I'm ok with regular as well :D
    Thnx for "Linq" explanation!

  • @qunram
    @qunram 2 роки тому

    Where is the link to download this? :)

  • @KasperSOlesen
    @KasperSOlesen 3 роки тому

    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 :)

  • @yuchen3587
    @yuchen3587 2 роки тому

    You are the fucking best teacher for pro Unity developers!

  • @Alzimovich2
    @Alzimovich2 3 роки тому

    Dark mode is 🔥🔥

  • @mooumari8210
    @mooumari8210 3 роки тому

    Dark mode is awesome 👌

  • @pixalquarks4623
    @pixalquarks4623 3 роки тому

    Dark mode is fine, but I think a bit more contrast would make it even great for videos.

  • @JohnDoe-bo5yk
    @JohnDoe-bo5yk 2 роки тому

    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

  • @JJZzZzZzZ
    @JJZzZzZzZ 3 роки тому

    definitely like the dark theme

  • @flem1431
    @flem1431 3 роки тому +6

    I prefer dark mode, since light mode can cause some eye strain for me.

  • @woodenfences
    @woodenfences 3 роки тому

    Please keep the dark mode. The simple stats /orc/elf/ etc. examples are good too.

  • @XRCADIA
    @XRCADIA 3 роки тому +1

    Yes, thank you for using dark mode :)

  • @supertenchoo4271
    @supertenchoo4271 3 роки тому

    nice video today i understand link way better plus i like dark mode

  • @restushlogic5794
    @restushlogic5794 3 роки тому

    As for non-programming background, Linq is really useful feature.

  • @JustinHeasman
    @JustinHeasman 3 роки тому

    Great video buddy. Keep dark mode too - my eyes prefer it.

  • @modiddymo
    @modiddymo 3 роки тому +2

    Dark mode all day everyday. My eyes say thank you.

  • @paktofu123
    @paktofu123 3 роки тому

    Great video and dark mode yes pls

  • @WarpedSpace
    @WarpedSpace 3 роки тому

    Dark mode is Lit !

  • @tedsmall5360
    @tedsmall5360 3 роки тому

    Dark mode please, you rock!

  • @unitywithzaher1374
    @unitywithzaher1374 3 роки тому

    Dark is more professional
    That video came just in time, I saw that code in the past and I could not understand very well what was it going
    I wanted to search about it one day and looks like the day came to me by itself lol
    However,
    I hope you make a video about how to improve yourself after the junior level
    I have been using unity with C# for 4 years I have made a couple of small games but I still can not get a good job even though I have a not that bad portfolio
    I do not know what should I do to improve myself more to get hired, I would like to hear from you about it
    thanks a lot

  • @pixelb0i255
    @pixelb0i255 3 роки тому

    Like flying a space ship or controlling any fly able object with zero drag. My implementation is a bit too realistic that does not feel good in VR 🤣.

  • @jcoco44
    @jcoco44 3 роки тому

    Please keep dark mode! It has benefits for those with astigmatism and reduces stress on the eyes!

  • @1993Duckman
    @1993Duckman 3 роки тому

    Dark mode is king! So easy on the eyes :-)