DEMYSTIFYING linq - UNITY3D!

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 191

  • @JakeThe_Dog
    @JakeThe_Dog 3 года назад +110

    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.

  • @playuno46
    @playuno46 3 года назад +107

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

  • @shawnw86
    @shawnw86 3 года назад +6

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

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

  • @brianjensen2532
    @brianjensen2532 3 года назад +6

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

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

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

  • @loganbranjord7855
    @loganbranjord7855 3 года назад +1

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

  • @Breezy384
    @Breezy384 3 года назад

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

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

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

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

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

  • @batatafritanhamnham
    @batatafritanhamnham 3 года назад

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

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

  • @RusAres
    @RusAres 3 года назад

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

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

  • @TheKiwiCoder
    @TheKiwiCoder 3 года назад +1

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

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

  • @francescoc5604
    @francescoc5604 3 года назад

    yeah, this goes in the game dev playlist for sure

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

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

  • @Chronomatrix
    @Chronomatrix 3 года назад +3

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

  • @GameLargo
    @GameLargo 2 года назад

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

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

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

  • @duckhive-games
    @duckhive-games 3 года назад

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

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

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

  • @ozguroz5340
    @ozguroz5340 3 года назад

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

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

  • @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 RUclips. Black on Black!

  • @MRxRadex
    @MRxRadex 3 года назад +1

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

  • @danosono
    @danosono 3 года назад

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

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

  • @the_cosmicat
    @the_cosmicat 3 года назад

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

  • @borisblosse8645
    @borisblosse8645 3 года назад

    That was great Jason, thanks!

  • @ewwitsantonio
    @ewwitsantonio 3 года назад

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

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

  • @jonahmcconnell4818
    @jonahmcconnell4818 3 года назад

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

  • @BluesInSeattle
    @BluesInSeattle 3 года назад

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

  • @supremus1305
    @supremus1305 3 года назад

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

  • @n8dev
    @n8dev 3 года назад

    super helpful! Thank you for using dark theme :D

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

  • @kurtiswilkins1042
    @kurtiswilkins1042 3 года назад

    Really appreciate your videos

  • @ujjwalrajput0612
    @ujjwalrajput0612 3 года назад

    love dark mode please continue it, and great video.

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

  • @pixelb0i255
    @pixelb0i255 3 года назад

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

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

  • @XRCADIA
    @XRCADIA 3 года назад

    Thank you for making this video!

  • @lvx969
    @lvx969 3 года назад

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

  • @yuchen3587
    @yuchen3587 Год назад

    You are the fucking best teacher for pro Unity developers!

  • @nialltracey2599
    @nialltracey2599 3 года назад +6

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

  • @aarongrincewicz7448
    @aarongrincewicz7448 3 года назад

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

  • @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 :/

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

  • @jahoopyjaheepu497
    @jahoopyjaheepu497 3 года назад +3

    Me: Thinks of topic I want to learn
    Jason:

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

  • @page0809
    @page0809 3 года назад

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

  • @XRCADIA
    @XRCADIA 3 года назад +1

    Yes, thank you for using dark mode :)

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

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

  • @mooumari8210
    @mooumari8210 3 года назад

    Dark mode is awesome 👌

  • @KasperSOlesen
    @KasperSOlesen 3 года назад

    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.

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

  • @nilsmuller-cleve6769
    @nilsmuller-cleve6769 3 года назад

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

  • @Alzimovich2
    @Alzimovich2 3 года назад

    Dark mode is 🔥🔥

  • @Aedeus
    @Aedeus 3 года назад

    Very helpful.

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

  • @This-Was-Sparta
    @This-Was-Sparta 3 года назад

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

  • @siulingding73
    @siulingding73 3 года назад

    great video! what font is 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?

    • @marcoshayman8535
      @marcoshayman8535 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 2 года назад

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

  • @supertenchoo4271
    @supertenchoo4271 3 года назад

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

  • @1993Duckman
    @1993Duckman 3 года назад

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

  • @JJZzZzZzZ
    @JJZzZzZzZ 3 года назад

    definitely like the dark theme

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

  • @JustinHeasman
    @JustinHeasman 3 года назад

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

  • @WarpedSpace
    @WarpedSpace 3 года назад

    Dark mode is Lit !

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

  • @ryanmeyer3580
    @ryanmeyer3580 3 года назад

    Yes, dark mode FTW!

  • @paktofu123
    @paktofu123 3 года назад

    Great video and dark mode yes pls

  • @DarokCx
    @DarokCx 3 года назад

    Dark mode is the way to go!

  • @restushlogic5794
    @restushlogic5794 3 года назад

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

  • @joedelekto8494
    @joedelekto8494 3 года назад +1

    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.

    • @Alzimovich2
      @Alzimovich2 3 года назад

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

    • @joedelekto8494
      @joedelekto8494 3 года назад

      @@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
      @Alzimovich2 3 года назад

      @@joedelekto8494 It allocates no matter what, look at the AddRange implementation to find out :)

    • @joedelekto8494
      @joedelekto8494 3 года назад

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

  • @flem1431
    @flem1431 3 года назад +6

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

  • @TheDrewCrawford
    @TheDrewCrawford 3 года назад

    Dark mode all the things!

  • @tedsmall5360
    @tedsmall5360 3 года назад

    Dark mode please, you rock!

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

  • @brunogattai9262
    @brunogattai9262 3 года назад +1

    Dark mode forever!

  • @TommyTheITGuy
    @TommyTheITGuy 3 года назад

    What is the advantage of Backtrace over Firebase Crashlytics?

  • @modiddymo
    @modiddymo 3 года назад +2

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

  • @YoNeyers
    @YoNeyers 3 года назад +1

    thank you so much
    yes dark mod is better :)

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

  • @shawngesellgaming
    @shawngesellgaming 2 года назад

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

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

  • @pipadrian1041
    @pipadrian1041 3 года назад

    Yes to Dark mode :)

  • @geri4367
    @geri4367 3 года назад

    Dark mode 🤘

  • @ZiplawDev
    @ZiplawDev 3 года назад

    I love dark mode, yeah

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