TOP 10 C# things you MIGHT not know (I didn't!)
Вставка
- Опубліковано 8 лют 2025
- 🌍 Watch my FREE 12 HOUR C# Course! • Learn C# FREE Tutorial...
✅ Get the Premium Version with Interactive Exercises! cmonkey.co/csh...
🌍 FREE Game Dev Report Newsletter cmonkey.co/gam...
I learned 10 C# things! (despite 10 years of experience!)
🎮 Play my Steam game! cmonkey.co/din...
❤️ Watch my FREE Complete Courses • Learn to make Games wi...
🌍 Get my Complete Courses! ✅ unitycodemonke...
👍 Learn to make awesome games step-by-step from start to finish.
🎮 Get my Steam Games unitycodemonke...
🔴 RELATED VIDEOS 🔴
Learn C# FREE Tutorial Course Beginner to Advanced! [12 HOURS] • Learn C# FREE Tutorial...
How to SURVIVE as a Game Dev for a DECADE! (Over $1,000,000 Revenue!) • How to SURVIVE as a Ga...
Simple Weapon Attachment System! (FREE DOWNLOAD - Unity Tutorial) • Simple Weapon Attachme...
How to Talk to NPCs! (or Interact with any Object, Open Doors, Push Buttons, Unity Tutorial) • How to Talk to NPCs! (...
💬 Last year I made my complete Beginner to Advanced C# course, there's a free video with all the Video lectures and a Premium version with some awesome bonuses.
In that course I made sure to cover pretty much every single C# topic, everything from the absolute basics for Beginners, to interesting topics for Intermediates, and super Advanced stuff.
Even though I've been writing code for 25 years I still learned a few things myself when doing research for this course. Things like all about Reflection, Anonymous Types, LINQ SQL Syntax, Discard keyword, and more!
🌍 Watch the FREE C# Course! • Learn C# FREE Tutorial...
📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!
✅ store.steampow...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🎮 Grab the Game Bundle at unitycodemonke...
📝 Get the Code Monkey Utilities at unitycodemonke...
#programming #csharp
--------------------------------------------------------------------
Hello and Welcome!
I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.
I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
--------------------------------------------------------------------
Website: unitycodemonke...
Twitter: / unitycodemonkey
Steam: store.steampow...
🌍 Watch my FREE 12 HOUR C# Course! ua-cam.com/video/qZpMX8Re_2Q/v-deo.html
✅ Get the Premium Version with Interactive Exercises! cmonkey.co/csharpcourse
🌍 FREE Game Dev Report Newsletter cmonkey.co/gamedevreportnewsletter
At 9:38 in "How much MONEY my Game made" you showed a GoogleAds screenshot with 500 $ ad with 10 760 clicks. Basically, if I run an ad for 50 $ can I expect at least 107 clicks ? Because I ran an ad for 15 $ and I received 0 clicks. Or simply a game can be no marketable (39 curators reviews and still less than 160 wishlists) ?
@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.
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.
!
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!
'I love learning new things', this is one of the many reasons why this guy is the goat. Thanks for the great tutorials!
learning new things is the meaning of life so everybody should love 😅
@@SondaPower couldn't agree more
learn the first 4 chapters of C# in a nutshell (the core language sections) and you will know most of this stuff. Personally, I hate learning, but it is a necessary evil if you want to accomplish something meaningful.
@ unless you want to be one of these lazy ai users, then yes learning is necessary. But personally I think it's a gift to be cherished rather than a burden to be bared.
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)
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.
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
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!
Amazing how I've been watching you for over 5 years now and every time I click on one of your videos I'm guaranteed to learn something new. Best of luck and keep doing your thing!
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
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)
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.
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.
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.
@@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
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 🙂
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.
Too bad Unity runs on an old custom version of mono. Span-fun really starts once they update to NetCore.
Great video! I knew most but learned something new :)
Thanks!
I also really liked at the end how you added bonuses, felt smooth
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 :)
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
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.
I worked with C, C++, and other languages years ago. But after watching this vid, it looks like I could use a refresher.
While C# looks somewhat similar to C and C++ (intentionally) it is a very different language and runtime.
It's not even close
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
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.
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.
@@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.
@@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.
This is great, I didn’t know a few of these and I’ve been doing this for a good few decades.
I knew about most of these but the when clause on a case statement was new to me! Thanks for sharing!
There's also the new switch syntax:
public static string GetAgeCategory(int age) => age switch
{
< 2 => "infant",
>= 2 and < 5 => "toddler",
>= 5 and < 10 => "youngster",
>= 10 and < 13 => "pre-teen",
>= 13 and < 20 => "teenager",
>= 20 => "adult"
};
They could have just introduced new "match" operator instead of just moving "switch" to the right.
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!
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.
Even though i knew most of these it's only with practice i could gain confidence that i know what I'm doing with these features.
Nice one, I just recently started using Rider and was unaware of what the option for Include top line statements did.
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).
Even though its been more then 12 years working as a software developer i have learnt very interesting things thank you soo much ❤❤
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...
This is great info! Reverence vs Copy threw me for a loop a while back when dealing with transforms. Needed a copy so I ended up using position and rotation in separate variables. Also had to use reflection in iMove so that the scripts referencing the new input system and the navMeshAgents wouldn't give the users errors when first installing the asset. A little scarry since your essentially hardcoding reflection, tried to minimize that when possible.
Another interesting thing about 'in' variable is that the value cannot be modified in the funciton.
Time stamp 3:07 You were NOT wrong all this time; in C# a method can also be called a function because a method is a function, but...not all functions are methods.
Example a cat is an animal, but not all animals are not cats. (Animal is like a function and cat is like a method.) You should buy C# in a nutshell because a lot of that stuff is explained in the first four chapters in a clear and concise way.
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
Do a UI in depth tutorial , its a must ❤
3:02 functions inside a class are called methods and variables are inside a class are called properties 😊
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.
Yup exactly, and in DOTS when making a Job they still recommend using ref/in instead of RefRW/RefRO on the parameters
Code Monkey is not only a good developer, he's also a good man.
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
Deep Seek recommends your Channel for game development.
Oh really? Lol that's good to know! I guess I'm safe when the AI overlords take over!
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.
Yeah that could be fun!
Awesome. Learnt new things about enum flags and switch cases
Local functions and lambdas can conveniently create hidden allocations via a closure if you happen to capture a stack variable.
That is something we would want to prevent during runtime.
Yup there are some interesting quirks and differences between those two. I tried to cover all the differences I could find in the full lecture. Definitely interesting to know how they differ
4:52 i didn't knew about dividedbyzeroexceptions ❤❤
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
Oh yeah I've seen that syntax a few times, definitely interesting but looks so weird so I don't think I've ever used it heh
It's not statement when switch is placed after some variable name. It's switch expression, it matches patterns and returns values.
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.
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.
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
@ Its been a long while since I heard that interview, but I think the data structures, the data is stored/indexed and the way its exposed via the Type API were all considered problematic. They probably thought it wouldn't get much use so I don't think they put much design effort into it. Oh well, hindsight as they say. At least they did a great job with the rest of C#.
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.
Had no idea there was local functions :D Great video!
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.
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).
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
@@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".
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
BTW, if you are using DOTS LINQ is not compatible with it.
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
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
@ yeah i selected bits to mark with names to apply styles to and well. After a while. Munch. It clearly was hungry
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
Yup always use the right tool for the job, if you need extreme performance then yup definitely avoid reflection
Nice video.
Avoid LINQ it allocates memory
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 😄
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.
You can't use the out keyword in an async method, but you can return a Task containing a tuple
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
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).
Yup it's by reference and read only, I covered all those differences in the full lecture on ref, out, in
Love the thumbnail!
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
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
awesome! thanks!
Could you please bring topics like asynchronous programming and multithreading
Yup I do have lectures on those in the C# course
Your tutorials are great, and I’ve learned a lot from them. Thank you for all the research and information you provide! However, I feel sad because, even though your videos have interesting titles and valuable content, they’re a too hard for me to watch. Everything starts out fine, but when the bright white colors appear like in the Unity editor, code screens(Code Compiler), or background of references it becomes too harsh on my eyes and starts to hurt even i see them one second.
This might just be a issue for me, I’m not sure how it is for others. But as a programmer, I often work late at night, and my system is always in dark mode. Maybe that’s why bright screens affect my eyes more easily.
If you consider switching to a darker theme in your videos, it might make them easier to watch and could even increase your watch time. Of course, it’s totally your choice, or you could maybe create a poll to see what others think. I’m not trying to push you just sharing an idea and want to watch your videos.
Thanks again, and keep up the amazing content!
Sorry but dark mode burns my eyes, if I look at it for more than 10 seconds I get a massive headache so it's impossible for me to record videos in dark mode. My eyes really hate focusing on white letters on a dark background.
I wish the videos could be dynamic and support light or dark mode depending on the viewer, but sadly that's not possible
@@CodeMonkeyUnity I thought there might be some issues.
I really understand you well, and thank you for your kind response. Even in white mode, I won't stop checking out your content because there's always so much useful information there.
Thanks again, and I wish you best! 🫡
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#
in is a read-only reference
ref is a read-write reference
And out is a write output parameter
Me gustaría mucho ver un video de ti acerca de UI Toolkit, siento que sería muy bueno.
super usefull Thx
Hi can you make detailed gameproject using photon fusion2
11:07 - woah this is crazy, never seen that. I knew about "ref" keyword. Isn't it the same thing?
"in" is the readonly version of "ref"
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
@@zorglug but you can write to fields of reference types, so it's only fully read only for structs.
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!
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
@@CodeMonkeyUnity Thank you so much!
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..
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
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
Oh interesting! I did not know that syntax, thanks!
I didn't know about reflection too 😅😅 6:25 6:25
2:04 "Excuse me, whaaaaaAAAAT?"
Yup functions within functions! It's madness!
@@CodeMonkeyUnity Still unsure why one would do that, especially when you can bind a delegate to a variable and then pass that, but hey, at least it's an option.
I miss programming in c# 😢
I love it! My favorite language!
Why use catch?
To catch exceptions, otherwise your code has an error and stops execution
Hello. I am developing a boardgame like Business Tour and Monopoly. Can i set the price point at 3$ or i have to make it free-to-play and some how earn money from it ? Thank you very much.
It should have a demo version at least so that players would feel is it worth to purchase it.
@@SirusStarTV So we should make a demo for a multiplayer game ?
Well you dont know what you dont know. I guess I dont know a tone im still trying to build a sucessfull game and, well most of the stuff in this video was new to me. And Ive been making games off and on for like 8 years now lol. Gamedev is def a very slow process.
I guess he doesn't make tutorials anymore
Me? I just made 2 free complete courses last month. Do you mean small standalone tutorials? Yeah lately I've been focusing more on larger projects
Even tough i hate unity i love its developers
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 ^^
Methods are functions inside class. Functions are functions. C#, iirc, doesn't have functions.
I knew all of them :D
Nice!
LINQ is too slow, avoid.
Always use the right tool for the job, if you need extreme speed then yup avoid LINQ
2:52 - I always thought that "Function" has return value and "Method" does not.
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).
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.
@@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.
Ai thumbnails 💔
Did you know it now , anyway it is pretty sad
AI is the future.
@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
Saves him a ton of time, adapt with technology. I love this video's thumbnail.
He's been using them for MANY months now, nothing new
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 😢
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 UA-cam
How much more free stuff do you want from me?
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
First
Thank you
I was expecting something but this is all really basic