TOP 10 C# things you MIGHT not know (I didn't!)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

ความคิดเห็น • 136

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา +2

    🌍 Watch my FREE 12 HOUR C# Course! th-cam.com/video/qZpMX8Re_2Q/w-d-xo.html
    ✅ Get the Premium Version with Interactive Exercises! cmonkey.co/csharpcourse
    🌍 FREE Game Dev Report Newsletter cmonkey.co/gamedevreportnewsletter

  • @ErasableSky
    @ErasableSky 19 ชั่วโมงที่ผ่านมา +23

    'I love learning new things', this is one of the many reasons why this guy is the goat. Thanks for the great tutorials!

    • @SondaPower
      @SondaPower 18 ชั่วโมงที่ผ่านมา +3

      learning new things is the meaning of life so everybody should love 😅

    • @ErasableSky
      @ErasableSky 17 ชั่วโมงที่ผ่านมา

      @@SondaPower couldn't agree more

  • @facelessanon
    @facelessanon 15 ชั่วโมงที่ผ่านมา +5

    When Hugo said "I don't really learn much, I'm already familiar with most things", I felt very relieved.
    I'm a gamedev with 2 years of experience, and many of my friends look up to me for my skills, including fellow skilled gamedevs who admire my games.
    However, I find myself investing weeks, or even months, on games that would be reasonable if they took only 2 weeks or less.
    The reason why it is slow is not just how game development is an inherently slow process, but because despite everything I just said, I wasn't familiar with many new concepts, and I had to teach myself them before I could apply them.
    Because I was introducing new topics, I had to take more breaks, and as I took more breaks, the slower I progressed.
    Truth be told, it is a tiring process, which is why it's such a refresher to hear that Hugo has probably slain most of the demons I'm still fighting long since.
    !

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา

      Yup experience is without a doubt one of the most valuable things you can acquire!
      Everything is hard to learn at first, but after that first time it gets much much easier to remake the same thing or build something similar.
      A while ago I made a video on the topic of making small games, and in there I also mentioned experience and how for an inexperienced developer they might only be able to make a Flappy Bird clone in 2 weeks, whereas for an experienced developer they can build that same game in perhaps 2 days.
      So yup keep on learning and improving your skills and over time everything gets easier and easier! Best of luck!

  • @spydacarnage
    @spydacarnage 16 ชั่วโมงที่ผ่านมา +3

    About nethods vs functions. A method is a function member of a class/struct, so local functions are often still called functions (as they aren't members (well, not until the lowering stage anyway)

    • @b5fan504
      @b5fan504 14 ชั่วโมงที่ผ่านมา

      Came here to say the same. My understanding is that a method is a function on an OOP construct/context. Looks like another great course, Mr. Monkey! Thanks for all your work.

    • @Aeroxima
      @Aeroxima 13 ชั่วโมงที่ผ่านมา

      I've heard this since a ways back, but I still like the word function so much more. Method just feels weird to say, like it could be understood differently depending on the context, cause it's just a normal word and you have methods of doing a lot of things. A method of coding, a method of approaching/solving a problem, a method to do this or that. In that last one, which did I mean? You can guess because of the list by context, but what if I meant suddenly a function for it? If I used that word, there would be no ambiguity. I don't know when you'd want to differentiate between the two, but you could say "member function" for method

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา +1

      Oh interesting! That's right! They do call those "local functions" and not "local methods", that is indeed the only place where I've seen the C# docs mention the word "function"
      Thanks for the explanation!

  • @falricthesleeping9717
    @falricthesleeping9717 18 ชั่วโมงที่ผ่านมา +8

    On the topic of reflection, it's extremely useful for editor stuff in unity, but it's extremely slow, do not use it in runtime, and even be aware of functions that trigger a reflection call

    • @Migaroez
      @Migaroez 18 ชั่วโมงที่ผ่านมา +2

      Came here to just say that. If you need to use it anyway then cache as close to the eventual result as possible, either on first use or on initialization (in a dedicated loading portion preferably)

    • @mandisaw
      @mandisaw 18 ชั่วโมงที่ผ่านมา

      Same with SQL LINQ syntax - it takes a sizeable hit to parse to methods, on top of the performance hit of whatever Collection stuff you're doing.

    • @Me__Myself__and__I
      @Me__Myself__and__I 17 ชั่วโมงที่ผ่านมา +1

      I just posted the same thing. It can be used at runtime though, but only if you understand the performance issues and design accordingly. For example I'm using it to add mod support and load data during game startup. But not using it once the game is initialized.

    • @tonyzaddo
      @tonyzaddo 16 ชั่วโมงที่ผ่านมา +4

      Reflection is slow. But that doesn't mean you should never use it at runtime. It is sometimes very useful, you just shouldn't use it in high traffic areas.

    • @falricthesleeping9717
      @falricthesleeping9717 16 ชั่วโมงที่ผ่านมา +1

      @@tonyzaddo true, but in my experience saying never use sth leaves a better mark in someone's head, if someone really needs to use it during runtime they will think twice about where it is, and when it actually happens

  • @castlecodersltd
    @castlecodersltd 18 ชั่วโมงที่ผ่านมา +2

    Great video. I've not used Span or in before. Just shows there's always something to learn and you're the man to learn it from. Thank you 🙂

    • @tonyzaddo
      @tonyzaddo 16 ชั่วโมงที่ผ่านมา

      Neither have I. But I will certainly start using both now. In a couple seconds copilot wrote me a generic SpanList structure for replacing Lists, this will save heaps (pun intended) on GC. Only limitation is it can't be used with async.

  • @Rob_III
    @Rob_III 13 นาทีที่ผ่านมา

    @1:18 Top Level Statements
    @2:00 Local functions
    @2:48 Terminolgy
    @4:12 Exception variable (optional)
    @4:59 Reflection
    @6:06 Anonymous types, tuples, records
    @6:56 Linq SQL-like syntax
    @7:56 Enum Flag combinations
    @8:55 Environment.GetCommandLineArgs()
    @9:33 UI Toolkit
    @10:20 Threadpool
    @10:31 Discard
    @10:46 In keyword
    @11:16 Spans
    @11:36 Switch
    Please add this in the description and give us chapters to jump to.

  • @digestdig9fiut217
    @digestdig9fiut217 19 ชั่วโมงที่ผ่านมา +2

    i already knew some of them, just by finding out randomly but some thing were absolutly unknow to me, thx for cool vids and tutorials

  • @yonatanabergel
    @yonatanabergel 5 ชั่วโมงที่ผ่านมา

    Great video! I knew most but learned something new :)
    Thanks!
    I also really liked at the end how you added bonuses, felt smooth

  • @MegamanXGold
    @MegamanXGold 17 ชั่วโมงที่ผ่านมา +6

    I'm surprised how many of these were things that I learned (and used) while I was a full time game dev. I had to resist the urge to push a commit with the SQL-style LINQ code, though. I couldn't be sure anyone else on the team would've appreciated that one.

    • @Me__Myself__and__I
      @Me__Myself__and__I 17 ชั่วโมงที่ผ่านมา

      Yeah, useful stuff. Regarding the LINQ query syntax, there are a few edge cases where you eithet can't specify certain things using the function syntax or its very difficult. Don't remember the exact details anymore, but I had to push code a couple times using the query syntac for that reason.

    • @loam
      @loam 14 ชั่วโมงที่ผ่านมา

      @@Me__Myself__and__I You can always divide it into two-three separate queries putting the intermediate result into separate sensibly named variable, making your code more readable.

    • @Me__Myself__and__I
      @Me__Myself__and__I 13 ชั่วโมงที่ผ่านมา

      @@loam Well, either those separate parts aren't materializing the data (thus do nothing) or they do materialize the data. If they do this would result in the data being materialized multiple times which is inefficient and might prevent the LINQ system from performing optimizations it couldmdo if it was a single query. If the intermediate data isn't specifically required this is a bad idea.

  • @ganeshkgp
    @ganeshkgp 11 ชั่วโมงที่ผ่านมา

    Even though its been more then 12 years working as a software developer i have learnt very interesting things thank you soo much ❤❤

  • @claytonrumley
    @claytonrumley 14 ชั่วโมงที่ผ่านมา

    I knew about most of these but the when clause on a case statement was new to me! Thanks for sharing!

  • @Norritt42
    @Norritt42 18 ชั่วโมงที่ผ่านมา +1

    Watch out for thread pools!!! Some locks don’t work as you expect as the threads are reused so a look may be locked in one method and unlocked in another method as they did share the same thread. I did my own implementation on this which is free which poolsthreads but don’t shift them around but instead compleat the task.

  • @InfohazardGames
    @InfohazardGames 7 ชั่วโมงที่ผ่านมา

    My favorite feature of Spans is using the stackalloc keyword to create a stack allocated array that you can pass to other methods and doesn't generate garbage!

  • @alideveloper6945
    @alideveloper6945 5 ชั่วโมงที่ผ่านมา

    what interesting for me is that i know almost all things that you said you didnt know even exist!!! i worked with all of them in my projects...

  • @marcinIsfider
    @marcinIsfider 14 ชั่วโมงที่ผ่านมา

    Working with C# in Unity I constantly learn new things about the language. Some of the things you mention here I learned quite recently, especially the `in` keyword I read about just a few days ago. One thing you should probably take into account is that non-readonly struct passed with the `in` keyword might result in a, so called, 'defensive` copy being made inside the function. I don't know exactly when this happens, but this could lead to a slightly slower code than when passing the same struct by value.
    On the subject of `Span`, it can be used to hold a reference to a block of memory allocated on the stack using the `stackalloc` keyword in place of the `new` keyword. There are some additional restrictions enforced by the compiler that can block you from using `stackalloc`, but it's still a nice tool to have at your disposal. One thing about `stackalloc` to remember is that the allocation lives in the scope of the function, so you should be especially careful around loops :)

  • @hitarthpadaliya2621
    @hitarthpadaliya2621 7 ชั่วโมงที่ผ่านมา

    Another interesting thing about 'in' variable is that the value cannot be modified in the funciton.

  • @myprivatechannel1695
    @myprivatechannel1695 12 ชั่วโมงที่ผ่านมา +1

    Nice video.
    Avoid LINQ it allocates memory

  • @johngrey5806
    @johngrey5806 12 ชั่วโมงที่ผ่านมา

    Code Monkey is not only a good developer, he's also a good man.

  • @mehmedcavas3069
    @mehmedcavas3069 18 ชั่วโมงที่ผ่านมา +1

    For reflection your use case is really clever. However, for other production code I wouldnt recommend it. I use reflection for my editor scripts because most of my methods and variables are private. that helps to access them without changing the access modifier. Or u can use it again in editor mode when u compare with with another api or json data to check if the parameter names are the same

  • @MaxIzrin
    @MaxIzrin 18 ชั่วโมงที่ผ่านมา

    The thing about LINQ is that the query isn't executed until the collection is enumerated (you turn it into an array, list, or otherwise use it).

  • @leos-clockworks335
    @leos-clockworks335 15 ชั่วโมงที่ผ่านมา

    As much as I love using Records and Readonly record structs, be careful with them as because they are immutable, they do not serialize in Unity.
    They are best used as DTOs(Data Transfer Object) between more core features of your game.

  • @daravefa
    @daravefa 17 ชั่วโมงที่ผ่านมา +7

    10:47 the in keyword creates a defensive copy behind the scenes if the struct you are passing isn't a readonly struct. This results in about 2x performance loss which should be avoided in hotpaths. You really should mention readonly structs when you talk about the in keyword. 11:11 if you want to pass it as reference and not waste memory just use the ref keyword instead

    • @zorglug
      @zorglug 9 ชั่วโมงที่ผ่านมา +1

      They have improved it quite a bit in dotnet to the point where defensive copies have become extremely rare. I was trying it out in sharplab recently for a lecture I gave and it's gotten pretty hard to trigger by accident. But indeed, I wish he mentioned it was the read-only version of the ref keyword.

  • @Aeroxima
    @Aeroxima 13 ชั่วโมงที่ผ่านมา

    Interesting, I wonder why tuples aren't used more. Often there's an "out" variable just to return data, it seems maybe useful in some of those (especially if it's not returning a bool, cause sometimes I guess you're using it for an if statement). It seems like a clean way to return two variables

  • @odo432
    @odo432 4 ชั่วโมงที่ผ่านมา

    My understanding of "in" is that it's just like "ref" in that the argument is passed by reference rather than copied but it is immutable (data cannot be modified). Kind of like the difference between Unity.Entities RefRW and RefRO. In fact, I believe "ref" and "in" was exactly what Unity used in their earlier versions of DOTS when passing components as read-write and read-only in system queries.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา

      Yup exactly, and in DOTS when making a Job they still recommend using ref/in instead of RefRW/RefRO on the parameters

  • @CountingStars333
    @CountingStars333 19 ชั่วโมงที่ผ่านมา +11

    Deep Seek recommends your Channel for game development.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา +1

      Oh really? Lol that's good to know! I guess I'm safe when the AI overlords take over!

  • @mandisaw
    @mandisaw 17 ชั่วโมงที่ผ่านมา +1

    Would advise anyone using any intermediate or advanced C# language features to give the [.]NET docs a read first, and maybe the Unity ones as well. Some of these have gotchas for the unwary, since the ecosystem was really designed for enterprise servers, not games running on potato PCs 😅
    Some of these rely on understanding CS concepts like reference vs value types, asynchronous coding (concurrency), memory management, etc. Some are based in later versions of NET than what Unity uses (or is supported on your platform of choice). Basically these are things that will mess you up big time if you don't know what you're doing 😩
    But they can be incredibly helpful if you *do* learn how and when to use them.

  • @Me__Myself__and__I
    @Me__Myself__and__I 17 ชั่วโมงที่ผ่านมา

    Reflection is really useful for certain things. For esample adding modding support to a game. Something you didn't mention and may be unaware of though, reflection is slow. I read an interview with the creators of C# long ago and they said if they had it to do over they would do reflectionmvery differently, particularly due to performance issues. So for things like modding support do all the reflection during startup and save any needed info to prevent having to do reflection again.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Yup reflection is perfect for adding modding support and yup it's not a good tool for when you need extreme performance
      Interesting, I wonder how they could make reflection faster, it sounds like it would always be a relatively slow approach since it has to dynamically look through the codebase, yeah I guess more caching on the backend would help

  • @ganeshkgp
    @ganeshkgp 11 ชั่วโมงที่ผ่านมา

    3:02 functions inside a class are called methods and variables are inside a class are called properties 😊

  • @ragerungames
    @ragerungames 17 ชั่วโมงที่ผ่านมา

    Awesome. Learnt new things about enum flags and switch cases

  • @MarushiaDark316
    @MarushiaDark316 15 ชั่วโมงที่ผ่านมา

    Would be interesting to see a dedicated video talking about how to actually go about creating exercises like the ones you made, including separate namespaces, reflection, validation, etc. Sort of a behind-the-scenes, making-of tutorial.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Yeah that could be fun!

  • @ch0arrim
    @ch0arrim 9 ชั่วโมงที่ผ่านมา

    Had no idea there was local functions :D Great video!

  • @lizkimber
    @lizkimber 13 ชั่วโมงที่ผ่านมา

    Watching through im surprised you hadnt of most of these ..
    I havent found the UI toolkit entirely happy it can be a real pain and ive had it eat my entire UI because it got in a mood

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      It destroyed your UI? oof that sounds bad!
      Thankfully I haven't had any issues like that, so far the only thing I dislike about it is the use of strings to identify elements, but I think they're trying to improve that with the binding system

  • @Armadous
    @Armadous 19 ชั่วโมงที่ผ่านมา +2

    I advise against LINQ query syntax. It often conflicts with SOLID principles, whereas chaining extension methods does not. In the example, .WhereTeam("Red") encapsulates the Where clause and can be easily chained in any player expression-something not easily achieved with query syntax. At best, you end up with a wrapper like '... where player.IsTeam("Red") ...'.
    Additionally, LINQ query syntax quickly becomes unwieldy when handling complex operations. I’ve encountered nightmare scenarios where intricate logic was embedded in a single query expression spanning hundreds of lines, making reverse engineering a painful task. Once logic is inside a query syntax block, it becomes increasingly difficult to extend or refactor it elsewhere.

    • @mandisaw
      @mandisaw 18 ชั่วโมงที่ผ่านมา +1

      There's a significant performance hit, as well. I will say, nothing wrong with having logic in the database layer, but at that point it really should be in real SQL, using an actual datastore of some kind, to gain the benefits (e.g. query analysis).

    • @dadarkdan
      @dadarkdan 15 ชั่วโมงที่ผ่านมา

      I disagree with you both. The performance is pretty much the same, linq has gotten much much more Performant over the years.
      As for the solid principles: you can always go crazy on those methods chains whereas a single .Where on a property is perfectly fine and readable

    • @mandisaw
      @mandisaw 14 ชั่วโมงที่ผ่านมา

      @@dadarkdan Performance has improved, but to the point of using it in real-time, high-performance contexts? Or resource-restricted mobile? I dunno, man.
      Also, the main reason to avoid it is often the human factor - you can write some godawful queries in LINQ. People can fall into that trap whether they actually "know" SQL or not. There's no query analyzer or profiler to sanity-check or save your behind. Maybe that's an unfair charge to levy against LINQ itself, but still, it's the proverbial "just enough rope".

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Yeah personally I prefer using the functions, but I can imagine that for someone who is a data analyst used to using SQL that syntax would look very easy to understand

    • @jeffreyhersh908
      @jeffreyhersh908 ชั่วโมงที่ผ่านมา

      BTW, if you are using DOTS LINQ is not compatible with it.

  • @ganeshkgp
    @ganeshkgp 11 ชั่วโมงที่ผ่านมา

    4:52 i didn't knew about dividedbyzeroexceptions ❤❤

  • @yonatanabergel
    @yonatanabergel 5 ชั่วโมงที่ผ่านมา

    Love the thumbnail!

  • @avengeranubis
    @avengeranubis ชั่วโมงที่ผ่านมา

    Did you know you can assign value from switch statement directly to a variable, like that:
    ```
    int num = 1;
    string str = num switch
    {
    1 => "One",
    2 => "Two",
    3 => "Three",
    _ => "not one, two or three"
    }
    // now str is equals to "One"
    ```
    Works in .NET 8. Doesn't work in .NET Framework. Idk about other versions

  • @JasonKaler
    @JasonKaler 8 ชั่วโมงที่ผ่านมา

    Some things mentioned, like reflection and linq are pretty slow and should be avoided in code that's executed often
    On the other hand, SPAN is very efficient because it uses stack allocation instead of heap, so it does not get garbage collected. perfect for code that's executed often

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา +1

      Yup always use the right tool for the job, if you need extreme performance then yup definitely avoid reflection

  • @GameDevASMR
    @GameDevASMR 55 นาทีที่ผ่านมา

    Be careful with the in keyword, it's not just about passing the argument by reference, there is the ref keyword for that.
    Would recommend to delve deeper into the subject to fully understand the difference between in, out and ref arguments (there is the "Method parameters and modifiers" page in the C# documentation). Those keywords can definitely be useful for your codebase, or if you use Unity ECS you might have to use those keywords too (Entities.ForEach syntax for example).

  • @eduardfekete
    @eduardfekete 19 ชั่วโมงที่ผ่านมา +1

    Wouldn't the out keyword be the preferred way of getting multiple values out of a method instead of tuples?
    Also I'm not sure if I love or hate the fact that I knew almost all of this 😄

    • @mandisaw
      @mandisaw 18 ชั่วโมงที่ผ่านมา +1

      Different approaches, different use cases. Out is a good choice when you want the method to be in charge of allocating memory (or not, if there's an error / invalid state). Also great if you want a different return value, like a TryGet pattern, where you have an out for the getter, but return a boolean (false is faster than checking for null or invalid output).
      Ref is good for large structs, as mentioned, but also for similar case as out, above, but having the caller manage the memory allocation.
      Tuples are better for returning multiple, related outputs. Like say, a buffer [reference], its size or capacity, and the next index where data should be read from (or written to). Those are all tightly related - multiple out params would seem independent, but a tuple conveys the relationship.

    • @spydacarnage
      @spydacarnage 16 ชั่วโมงที่ผ่านมา +1

      You can't use the out keyword in an async method, but you can return a Task containing a tuple

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา +1

      Yup that also works fine in most cases, personally I normally use out since I'm already used to it, so as always you have multiple valid ways of solving a programming problem

  • @semicolon5585
    @semicolon5585 16 ชั่วโมงที่ผ่านมา

    One thing to note about LINQ is that it is SLOWER than a regular for-loop

    • @spydacarnage
      @spydacarnage 16 ชั่วโมงที่ผ่านมา

      Maybe in Unity, but the team have done a lot of work behind the scenes in modern C#, making LINQ on par with a for loop

    • @thatalbeeguy
      @thatalbeeguy 14 ชั่วโมงที่ผ่านมา

      the thing is, if a LINQ querry can be optimised to a for loop, it will be in the IL. The whole point of LINQ is to write readable logic, and let the lowering step take care of optimising. LINQ aint just a collection of easy methods, the built in ones are directly integrated into compiler meaning the difference betweem using them and a regular loop is almost never the issue your game will lag. Use it, its there for a reason

    • @semicolon5585
      @semicolon5585 11 ชั่วโมงที่ผ่านมา

      Linq usage is for enterprise. Games needs an optimized code to run well. If LINQ is used in Unity Editor, sure let it be, but if youre using it for runtime. Thats the downside.

    • @semicolon5585
      @semicolon5585 11 ชั่วโมงที่ผ่านมา

      ​@@spydacarnage"maybe in unity" thats the thing! This is a gamedev channel so I am mainly talking about in Unity

    • @spydacarnage
      @spydacarnage 4 ชั่วโมงที่ผ่านมา

      @ Hence the "maybe" - I'm not sure how much the modern lowering has made its way into Unity - these aren't IL/runtime changes they're making, so they _could_ work in Unity, by my understanding...

  • @KeyGameUniverse
    @KeyGameUniverse 15 ชั่วโมงที่ผ่านมา

    Hello Code Monkey! Awesome video as always. I am making a card game roguelike like slay the spire. I am very ahead of the project. I was just wondering how would you do the fan shape card holding or if you made a video similar to that

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Hmm for generating the positions? You would divide the screen size by the number of cards, then apply some rotation based on the X position so cards on the left are rotated left and cards on the right rotated right
      For animating it, I would use some sort of tweening library or just Vector3.Lerp(); unitycodemonkey.com/video.php?v=jAN2IoWdPzM

  • @MrOmega-cz9yo
    @MrOmega-cz9yo 18 ชั่วโมงที่ผ่านมา +6

    I worked with C, C++, and other languages years ago. But after watching this vid, it looks like I could use a refresher.

    • @Me__Myself__and__I
      @Me__Myself__and__I 17 ชั่วโมงที่ผ่านมา +1

      While C# looks somewhat similar to C and C++ (intentionally) it is a very different language and runtime.

  • @y0_0go
    @y0_0go 13 ชั่วโมงที่ผ่านมา

    Could you please bring topics like asynchronous programming and multithreading

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Yup I do have lectures on those in the C# course

  • @balgrime564
    @balgrime564 10 ชั่วโมงที่ผ่านมา

    Thanks for the 12-hour course, I watched it entirely. Regarding the UI Toolkit, I had a lot of trouble using it, and I would not recommend it. For instance, you cannot make your scene objects move on top of your UI Toolkit elements..

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Oh interesting. Personally yup I absolutely still prefer Unity UI for runtime UI so I don't use UI Toolkit for that, only for Editor tools and for that use case I much prefer is than using IMGUI

  • @ganeshkgp
    @ganeshkgp 11 ชั่วโมงที่ผ่านมา

    I didn't know about reflection too 😅😅 6:25 6:25

  • @loam
    @loam 14 ชั่วโมงที่ผ่านมา

    11:07 - woah this is crazy, never seen that. I knew about "ref" keyword. Isn't it the same thing?

    • @zorglug
      @zorglug 9 ชั่วโมงที่ผ่านมา

      "in" is the readonly version of "ref"

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      ref passes in as a reference that you can read/write
      in passes as a reference that is read-only
      And out is a read-write output parameter

  • @brendan2133
    @brendan2133 20 ชั่วโมงที่ผ่านมา

    Very interesting video! can you tell me what you use to draw lines over screenshots when explaining things? this would be useful for my devlogs for university!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      It's a transparent Unity window, I made that tutorial here unitycodemonkey.com/video.php?v=RqgsGaMPZTw
      And the draw mesh tutorial here unitycodemonkey.com/video.php?v=XozHdfHrb1U

  • @lemetamax
    @lemetamax 9 ชั่วโมงที่ผ่านมา

    Wait, I did not know that about the in keyword.
    How is it different from the ref keyword?
    And some really interesting things I never knew about in c#

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      in is a read-only reference
      ref is a read-write reference
      And out is a write output parameter

  • @wombozombo
    @wombozombo 10 ชั่วโมงที่ผ่านมา

    I miss programming in c# 😢

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      I love it! My favorite language!

  • @RoboGameOfficial
    @RoboGameOfficial 19 ชั่วโมงที่ผ่านมา +3

    did you know you can also do "list = [.. array ]" instead of "list = array.ToList()" and vice versa. It's a quicker way of syntactically converting a collection type

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Oh interesting! I did not know that syntax, thanks!

  • @cbuckington2933
    @cbuckington2933 15 ชั่วโมงที่ผ่านมา

    3:05 The main distinction between methods and functions, or at least how I have been tought back in university, is that if it has a return value it is a function, if it does not and returns void, then it is a Method. Methods essentially just call other stuff while functions usually calculate something... Obviously that is greatly oversimplified but this terminology stuck with me ^^

    • @zhulikkulik
      @zhulikkulik 5 ชั่วโมงที่ผ่านมา

      Methods are functions inside class. Functions are functions. C#, iirc, doesn't have functions.

  • @artwork-studios
    @artwork-studios 7 ชั่วโมงที่ผ่านมา

    Even tough i hate unity i love its developers

  • @dbweb.creative
    @dbweb.creative 15 ชั่วโมงที่ผ่านมา

    LINQ is too slow, avoid.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 ชั่วโมงที่ผ่านมา

      Always use the right tool for the job, if you need extreme speed then yup avoid LINQ

  • @dragonaher
    @dragonaher 18 ชั่วโมงที่ผ่านมา

    2:52 - I always thought that "Function" has return value and "Method" does not.

    • @mandisaw
      @mandisaw 18 ชั่วโมงที่ผ่านมา

      In some functional languages, yes that definition holds. The distinction here is because C# is [mostly] object-oriented - there are no freestanding functions, only methods associated with an object (or similar structure).

    • @Me__Myself__and__I
      @Me__Myself__and__I 17 ชั่วโมงที่ผ่านมา +2

      Depends on the language. What I'm used to is functions have results, procedures don't (equiv to void) and methods are either but only apply for OOP.

    • @mandisaw
      @mandisaw 16 ชั่วโมงที่ผ่านมา +1

      @@Me__Myself__and__I Fortran and Visual Basic had that distinction too, but for functions & subroutines. Procedures were a catch-all pointer for both (or any statement block with its own local scope). Honestly in common parlance these days ppl use them all interchangeably, but if you're writing a compiler (or taking an exam 😉) you ought to know the difference.
      I feel like it's more important to understand the differences & rationales behind object-oriented, functional, and imperative paradigms, rather than how each one labels its callstack internals. That part actually does / can have an impact on your work outside of formal academic settings.

  • @nishantjoshyabhatla1155
    @nishantjoshyabhatla1155 5 ชั่วโมงที่ผ่านมา

    Is it just me or the past few videos just feel like an ad for his courses and his older videos?
    It's just such a turn off 😢

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ชั่วโมงที่ผ่านมา

      Seriously? Last month I put out 2 completely free courses with 7 hours worth of videos.........
      This C# course also has a completely free 12 hour version here on TH-cam
      How much more free stuff do you want from me?

  • @mehmedcavas3069
    @mehmedcavas3069 18 ชั่วโมงที่ผ่านมา

    I will also give an unnecessary information. there is nothing called else if, only if and else. . it is just an else statement with a one line if statement. like
    else
    {
    if(true)
    {
    }
    }
    like u can write if statement and loops without curly braces when its one line and for else if is the same thing. removing curly braces from the else :D

  • @BrendaKirbys
    @BrendaKirbys 20 ชั่วโมงที่ผ่านมา

    Thank you for your professionalism and attention to detail. Your videos are always impressive.🤘☃️☃️

  • @bidoaymannabil9828
    @bidoaymannabil9828 20 ชั่วโมงที่ผ่านมา +23

    Ai thumbnails 💔

    • @CodyDreams
      @CodyDreams 19 ชั่วโมงที่ผ่านมา +2

      Did you know it now , anyway it is pretty sad

    • @CountingStars333
      @CountingStars333 19 ชั่วโมงที่ผ่านมา +1

      AI is the future.

    • @CodyDreams
      @CodyDreams 19 ชั่วโมงที่ผ่านมา +3

      @CountingStars333 but it is not the present, so don't move too fast . Thumbnail is the first impression and it is highly unlikely that non code monkey viewer click on the video , that has decent capabilities that identify edited vs ai , they don't like to watch

    • @prozzergames
      @prozzergames 19 ชั่วโมงที่ผ่านมา +5

      Saves him a ton of time, adapt with technology. I love this video's thumbnail.

    • @JustATortoise
      @JustATortoise 19 ชั่วโมงที่ผ่านมา +2

      He's been using them for MANY months now, nothing new

  • @SophiaRichardson-n1q
    @SophiaRichardson-n1q 20 ชั่วโมงที่ผ่านมา +1

    Watching your channel is always an exciting and educational journey. Continue to inspire and teach us with your talent!🍄🐄☘️

  • @klevialushi571
    @klevialushi571 20 ชั่วโมงที่ผ่านมา

    First

  • @istprintistprint7861
    @istprintistprint7861 19 ชั่วโมงที่ผ่านมา

    Thank you