Local Functions in C# - Stay Inside Me

Learn about local functions and how you can use them for cleaner, more performant code.
Local functions were released in C# 7.
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev

Пікірлер: 130

  • @jagzhere
    @jagzhere2 жыл бұрын

    Your titles are on a whole other level

  • @murattuver1511
    @murattuver15112 жыл бұрын

    Hey, I have been watching your videos for some time now and I wanted to share my opinion about your channel :). There are not many people who cover more advanced game development topics like you do. I especially think that it is hard to find tutorials about good game development architecture. Your videos helped me a lot in that regard. I feel like you are the superhero this community was waiting for to reach the next level of game development. Please keep up the good work! Love from Turkey

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Damn bro, thank you for the kind words 🙏

  • @AcIdBARRY

    @AcIdBARRY

    Жыл бұрын

    Absolutely agree, to me tarodev is so underappreciated. He deserves way more attention on here imo!

  • @sealsharp
    @sealsharp11 ай бұрын

    Local functions are amazing, but there are some fine details one should know about. At 01:54 when the parameters of the local function are removed in favour of using variables in the scope, it does not actually remove the passing of parameters, but instead below the surface, a closure struct is created that contains the required parameters. Now if we, as someone in the comments mentions, just change the local function to a lambda, which looks like it does the same just written slightly different, the closure is not a struct but a class and that allocates memory and puts pressure on the GC. For usual dotnet that is often not a problem, but for Unity where we really try to not allocate each frame, this is a well hidden source of allocations.

  • @AlexBlackfrost
    @AlexBlackfrost2 жыл бұрын

    Before I played the video my opinion on local functions was that they aren't very readable, but after 6:15 I'm re-considering it. I feel like sometimes code conventions are biased by how programmers have coded in the past, so new things are often rejected just because they break with the tradition and the conventions that experienced programmers use nowadays.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I'm so glad that part got to someone. I completely agree with you

  • @R.B.
    @R.B. Жыл бұрын

    The biggest argument against local functions is Unit Testing. It's a really good way to encapsulate functions so that they aren't accessible outside the codeblock in which they are contained, so no side effects for calling something and using it in a way unintended, but you can't run a Unit Test against it for the same reason. This can cause problems when refactoring and you need to treat it black box. For the purpose of Unit Testing only, I wish local functions could be referenced, maybe by exposing them with a decorator or by some other syntactical reference like an arrow (class.function->local) maybe.

  • @chicao.do.blender
    @chicao.do.blender2 жыл бұрын

    thanks for the video tarodev, you're great as always, i'm big into these casual coding videos

  • @JuniorDjjrMixMods
    @JuniorDjjrMixMods2 жыл бұрын

    For 1 decade I code in the scripting language that Rockstar North created to code the missions, shops etc of the 3D Era GTA games, and originally (gta3script, based on BASIC) there is no function declaration, it works through a command called "GOSUB", that only now, with your video, I discovered that there is equivalent in C#. This looks very cool to know. In other words, missions from the older GTA games were programmed almost entirely with Local Functions. I have a gta3script tutorial and I put your video in the tutorial for those who already know C# to understand what GOSUB is about.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Very interesting. They made a language for people just to make missions?

  • @bunggo9914
    @bunggo99142 жыл бұрын

    why are you so underrated, yours is literally the best unity tutorial channel out there

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Thank you brother 🙏

  • @antijulius
    @antijulius2 жыл бұрын

    Known about local functions forever. Literally never used them before though but this video gave me a whole new perspective on them. Thanks!

  • @baroquedub
    @baroquedub2 жыл бұрын

    Love this! Thank you for yet another brilliant tip

  • @TheKr0ckeR
    @TheKr0ckeR2 жыл бұрын

    thanks for great video again! honestly, i would like to hear more about Func, I generally use Actions but very rarely used funcs

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Func is the same as an Action, but the last type is the returned data. Action of course has a return type of void. I really should have included more about Func in my delegates video...

  • @fokeyjo
    @fokeyjo Жыл бұрын

    Really great that you went as far as checking the asm for how it compiles, because coming from a JS background, I was immediately getting triggered because inner funcs (which most people write as an assignment) work like the delegates (possibly even worse because I think it recompiles it to resolve the externally-scoped vars). So good to know that inner normal functions are efficient and just affect function visibility scope. I understand your rant, there's a definite move to blindly adopt standard coding standards without assessing whether they work well for your code. I actually had a developer replace our existing perfectly good linter, that was following a standard with a couple of tweaks, with a different more limited one just because it was more standard!

  • @trapshooter
    @trapshooter2 жыл бұрын

    Really interesting, I didn't know this was possible. I'll definitely start using it. Thanks for the vid!

  • @itsdudley3243
    @itsdudley32432 жыл бұрын

    Had no idea this was possible. Great tutorial!

  • @NoirMorter
    @NoirMorter2 жыл бұрын

    When it comes to readability I agree with you. I've begun learning programing with local functions in place. In many cases for my own projects I find them more useful than the traditional way of programing.

  • @gamedevbaiyi936
    @gamedevbaiyi9362 жыл бұрын

    Very very useful for me. Thank you.

  • @firebiscuitgaming7624
    @firebiscuitgaming76242 жыл бұрын

    Note that you can make those local functions static (your multiply would be a good candidate for it) if you don't need access to the outer func parameters or local vars.

  • @radiatefromhere
    @radiatefromhere2 жыл бұрын

    I feel like I just learned how to use a shovel in a slightly different - and retrospectively - obvious way. Feels like a good thing to keep in mind for DOTS style of programming. Thanks (again) for another quickie :-)

  • @zeldinus
    @zeldinus2 жыл бұрын

    Great tip , thanks man.

  • @dageddy
    @dageddy2 жыл бұрын

    I call them Inner functions, having discovered the feature by chance. Just the cue that they serve only the parent is somehow satisfying. Glad we have something in common :)

  • @FICHEKK
    @FICHEKK2 жыл бұрын

    I am also divided. On one hand, I totally agree with minimizing scope, which makes code safer and provides more intent. On the other hand, it adds additional indentation level and makes method longer. I suppose one solution could be if IDE colored local functions differently, which would clearly make them stand out and you could easily see where "main" method body is and where local function resides, making it easy to read (parse in your head) and getting sweet clean code benefits. :)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Heyyyy, I could get on board with local function colors. Regarding the longer function argument though, I feel it's better than an entirely new function. Plus you get the other benefits they provide. Give them a whirl for a few weeks and see how you go :)

  • @FICHEKK

    @FICHEKK

    2 жыл бұрын

    @@Tarodev Will do! Thanks for the video. :)

  • @radiatefromhere

    @radiatefromhere

    2 жыл бұрын

    If I use them, I think I'll put them at the top of the method with the variable declarations.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@radiatefromhere I've always slotted them in the bottom to keep them out of the way. But putting them with the declarations does make a lot of sense.

  • @user-hb7py7xy7b
    @user-hb7py7xy7b2 жыл бұрын

    I never think about differences between local functions and Func at Runtime. Good tip.

  • @ProfessionalJason
    @ProfessionalJason Жыл бұрын

    Super helpful!

  • @kosmotion2081
    @kosmotion20812 жыл бұрын

    Cool! Woken up with new Tarodev video 😊 It’s 4.42AM btw…

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Go back to bed

  • @jesusmgw
    @jesusmgw2 жыл бұрын

    This (specially your peek at the generated assembly) got me thinking if following a super functional style would avoid heap allocation completely and be very performant. Also, this is the only correct way of doing 1 line conditionals: if (condition) { statement; }

  • @mayhem5036
    @mayhem50362 жыл бұрын

    More rants please. Love how devs arugue of code readablity and style. lol fun

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Can't help myself sometimes

  • @TaAnderson-Google
    @TaAnderson-Google2 жыл бұрын

    George Clinton was lost. He had lost his func. George called Taro and said to him: "Oh Taro, my brother, you ARE the Man You got to, got to, give me a hand This func-y stuff, I just don't understand Help me code my func-y plan And Taro replied: "Get a LOCAL type of thing to get down, here in C# town It's a better typing of coding, going round" Then Taro floated down from the Mothership and sang: "Ow, If you want one func Use a local func Ow, if you need one func Use a local func" And just like that, George Clinton had found his func. And it was groovy. kzread.info/dash/bejne/mZ5_qKWSqtTXXaQ.html

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    This was just incredible

  • @kawaiianthony8090
    @kawaiianthony80902 жыл бұрын

    Man my project has soo many classes that can use local function.... Guess I'm going to change them all now

  • @kingofroms7224
    @kingofroms72242 жыл бұрын

    Superb and awsome

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Thank you 😊

  • @victorlapin2080
    @victorlapin20802 жыл бұрын

    Good point with runtime differences

  • @TackleProd

    @TackleProd

    2 жыл бұрын

    But if he rushes it, it will be a worse video forever

  • @siddharthjain1745
    @siddharthjain17452 жыл бұрын

    I can see this being very divisive. I really like the coroutine tip for Unity. I’m 100% going to be using that. I feel most of the code in game dev is pretty one off. I’m rarely calling the same function from different places. Which would mean all the functions could be local. I’m definitely want to give it a shot but I like to keep my functions small, and this would help but not to the degree that I would be happy with.

  • @user-rm2gh2gc5f

    @user-rm2gh2gc5f

    2 жыл бұрын

    Coroutines are a really great use of local functions.

  • @youcancallmedoggie
    @youcancallmedoggie2 жыл бұрын

    He rolled in to the town with big iron on his hip

  • @Chrisbrei2502
    @Chrisbrei25022 жыл бұрын

    That's really cool! Still waiting for the Quaternion video though :p

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I'll give you the same answer as last time 😁

  • @fulongfromthegrave
    @fulongfromthegrave2 жыл бұрын

    100% agreed with this video, local methods are great!

  • @castlecodersltd
    @castlecodersltd Жыл бұрын

    Nice

  • @ncatalyst7036
    @ncatalyst70362 жыл бұрын

    This could be really useful for static constructors. Usually an Init() method is used in case there is logic in a static constructor, but you wouldn't call Init() anywhere else. I'm curious but doubtful if you can set readonly members within a local function defined in a constructor. Will try it out next time.

  • @dibaterman
    @dibaterman2 жыл бұрын

    I'm certainly still developing, but this is one of the first videos I watched where I understood what you were talking about. Though I've never used Func but I am assuming that when you set up func to be the variable multiplyfunc expects (i, i1) and then returns (i * i1) as the 3rd parameter. I've never used => in that way though, that is definitely new to me.

  • @Dxpress_

    @Dxpress_

    2 жыл бұрын

    You're correct about your Func assessment there. The "=>" is called the lambda operator/lambda expression, and it's just a shorthand syntactic sugar for either getting/setting something. A Func can reference any typical method that matches its signature like so: Func funcThatTakesIntAndReturnsString = MethodThatTakesIntAndReturnsString; string MethodThatTakesIntAndReturnsString(int x) { return "Some string " + x; } The way shown in the video is called an anonymous function, where the function is created as you assign it: Func funcThatTakesIntAndReturnsString = (int x) { return "Some string " + x; } Both the above examples can also use lambdas to shorten their method bodies like so: string MethodThatTakesIntAndReturnsString(int x) => "Some string " + x; Func funcThatTakesIntAndReturnsString = (int x) => "Some string " + x; These short-hands can be used in any kind of one-line-long function. Say you have the following class: class SomeClass { int _someValue; //Constructor public SomeClass(int someValue) { _someValue = someValue; } //Method public void IncrementSomeValue() { _someValue++; } //Property public int SomeValue { get { return _someValue; } set { _someValue = value; } } //Read-only property public int SomeValueReadonly { get { return _someValue; } } } This class's functions can all be shortened using lambda expressions as follows: class SomeClass { int _someValue; //Constructor public SomeClass(int someValue) => _someValue = someValue; //Method public void IncrementSomeValue() => _someValue++; //Property public int SomeValue { get => _someValue; set => _someValue = value; } //Read-only property public int SomeValueReadonly => _someValue; } As mentioned though, lambdas can only be used for one-line-long functions. Something like this would throw a compile error: public void IncrementSomeValue() => { int newValue = _someValue + 1; _someValue = newValue; }

  • @dibaterman

    @dibaterman

    2 жыл бұрын

    @@Dxpress_ I get it, it's just practice to cement the idea. But thank you very much. I understand the basic of getters and setters, I just haven't really used them enough to be comfortable with with them. I just think of getters as when you only want a class to get information from a property and setters to be when you want to allow that property to be changable from other classes. I've still got a very long way to go, because I know I'm still at the basics, but at least I understand it at the speed these guides pass them over with.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@Dxpress_ nice write up 👍

  • @PitiITNet
    @PitiITNet2 жыл бұрын

    Very interesting video. To be fair even though I knew the concept I haven't seen it used anywhere in 'real life projects'. I am not saying that as argument against local functions. Do you have any hmmm... More practical examples like the one with coroutine? I am really interested to see what people are 'really' using them for. BTW. Fantastic tip with the Func vs local function!

  • @RandomProduct

    @RandomProduct

    2 жыл бұрын

    I'd also love to see a more practical example. Taro says that it makes the class less cluttered but... The local function is the same number of lines. It hasn't saved any visual space being moved into another function.

  • @crummymudd8625
    @crummymudd8625 Жыл бұрын

    Around 4:40 where you compare the local function vs non-local function (Testing2 in example) in IL Viewer: local is better because it is known at compile time and does not have to create a new object, and GC. Do you get this same benefit with a static function, or with a static function in a static class?

  • @testitestmann8819
    @testitestmann88192 жыл бұрын

    "This is a lot of boiler plate" /moves the same code two lines up/ "Much better" :P

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Lol, did I do that?

  • @bazeragi
    @bazeragi2 жыл бұрын

    Faster then the funk!! 🎶

  • @moldman5694
    @moldman5694 Жыл бұрын

    I always avoided local functions because I always assumed that, like with Funcs, the runtime would just be redefining the function every time the parent function is called thereby wasting memory allocation. But after seeing 4:10, I'm a bit confused. So the local function gets pulled out at compile time and defined as a private function? Does this mean that whenever the parent function is called, the definition for the local function is basically ignored because the runtime recognises that the function has already been defined at compile time? Also, how does the compiler limit the scope of the local function to only the parent function if it compiles it as if it were a private function defined outside of the parent function? I'm still relatively new to programming but I hope the questions make sense.

  • @datablob
    @datablob2 жыл бұрын

    I feel local functions are readable just fine, coming from JS :)

  • @AlecAndersonZx

    @AlecAndersonZx

    Жыл бұрын

    to be fair, coming from javascript anything is readable just fine

  • @asembus
    @asembus2 жыл бұрын

    great video. it helps me around on using local function in unity. but sometimes i wonder. does defining local function will result in executing function that contain such local function, will define or allocate memory for local function everytime it's called ? this question pops up when i try to apply such mindset in javascript. my workaround usually still preserve such function that executed frequently without local function but tbh i don't really know. it might just me being paranoid.

  • @vintoncerf7562
    @vintoncerf75622 жыл бұрын

    That's what she said

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    😉

  • @nati7728
    @nati77282 жыл бұрын

    every time I'm repeating logic in a function, I move that to a local function. Just seems to make sense

  • @justinwhite2725
    @justinwhite27252 жыл бұрын

    I usually use local functions only in coroutines. I should expand my use of them.

  • @barisaxo
    @barisaxo2 жыл бұрын

    I've started using local functions a few months ago and it's completely helped all of my code. As to continue your point on single line code... why not use a lambda? int MultiplyFunction() => a * b;

  • @tillschonberner4910
    @tillschonberner49102 жыл бұрын

    I sometimes use a local function to subscribe to an event and then inside of it unsubscribe to the event to have it only been called once. Do you think that is also a good use case?

  • @avestea
    @avestea2 жыл бұрын

    Ah the readability talk *brings out popcorn*. I agree that local functions are a lot easier to read but the topic as a whole is very subjective. Speaking of braces and inline conditions, a company I work for (J2EE) uses google formatter which some people absolutely love. In some instances it does a good job but there are times I feel like gouging my eyes out.

  • @itchson
    @itchson2 жыл бұрын

    also known as nested functions

  • @TimeAndTactics
    @TimeAndTactics2 жыл бұрын

    Removing the arguments makes it more difficult to know what the method will do when reviewing the code where you call the method (imagine you had three local variables: a, b, c instead of just two but the multiply method only multiplied two of them).

  • @mhrohan917
    @mhrohan9172 жыл бұрын

    Still waiting for that quaternions video

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    It's coming

  • @mongrelgaming1473

    @mongrelgaming1473

    2 жыл бұрын

    As someone who is a beginner and attributes about 25% of my overall understanding to Taro... I would like to second this request!

  • @betterlifeexe4378
    @betterlifeexe43782 жыл бұрын

    single layer local functions clean up code, especially if you use the collapse functionality of your IDE. But your naming needs to be clear enough that you don't need to read the inside of the method to see what it does. If you fail to do that, it becomes burdensome. multiple layers of local functions I would qualify as code smell, or in other words - an indication that you've drifted too far from good code and need a re-write.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Agreed. Nesting local functions would certainly reduce readability.

  • @samochreno

    @samochreno

    2 жыл бұрын

    exactly my thoughts

  • @iphoeniximarco5488
    @iphoeniximarco54882 жыл бұрын

    i like the idea behind it but depending on the size this can get really messy readability wise on the indentation, just imagine many nested local functions ^^ so i normally stick to private methods, keeping them as small as possible, like this you see the scope of the function in one glance too

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I've actually never nested two or more local functions. I think at that point I would agree it would make it hard to read. One and done :)

  • @iphoeniximarco5488

    @iphoeniximarco5488

    2 жыл бұрын

    @@Tarodev having two different systems , depending on the situation could be a con to. i mostly keep to the saying "keep it simple stupid" especially if you work on a team which never use or have used local functions. maybe the clean book code influenzed me too much at this point :D

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@iphoeniximarco5488 I think I'll disagree with the "keep it simple stupid" notion (see 6:15). New features and syntactic sugar can make the code more readable in the end. If it means a new dev needs to adjust to it, so be it. We're programmers, I think we can adjust to a new convention or two :)

  • @halivudestevez2
    @halivudestevez22 жыл бұрын

    My tech lead would eat me alive if I use this :)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Scaaaaaaary new features!

  • @vitor102
    @vitor1022 жыл бұрын

    Can i nest those?

  • @MaxIzrin
    @MaxIzrin2 жыл бұрын

    If I have X amount of control modes, and I assign which is being used to a Action and invoke that in the Update method. Would a Switch be faster?

  • @MaxIzrin

    @MaxIzrin

    2 жыл бұрын

    I tested this. No significant difference. Switch statement an average of 3 ms faster than the delegate, for 1M iterations, running in editor.

  • @justinwhite2725
    @justinwhite27252 жыл бұрын

    7:09 I don't usually do that as one line. I'd have; If (raydown) Grounded = true;

  • @Armageddon2k
    @Armageddon2k Жыл бұрын

    amazing how many things get invented to "fix big classes" instead of, you know, just not writing big classes. if your method needs methods inside of it, that original method should be a class.

  • @ishan9050
    @ishan90502 жыл бұрын

    I instead find it highly readable. It makes the method somewhat compact and when revisiting the code after some time, it prevents me from jumping function to function. Btw can you make a video on code profiling?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Yes I can!

  • @ishan9050

    @ishan9050

    2 жыл бұрын

    @@Tarodev great, I'd be waiting

  • @guyginat
    @guyginat2 жыл бұрын

    Ahhhh, So this is a Quaternion

  • @markaldrich8753
    @markaldrich87532 жыл бұрын

    Can your local function have local functions? Can THOSE have local functions?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That's crazy talk man! ..yes

  • @chawlahimanshu6219
    @chawlahimanshu62192 жыл бұрын

    I usually use local coroutines never used it for a function

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    You were running before you could walk

  • @chawlahimanshu6219

    @chawlahimanshu6219

    2 жыл бұрын

    Well, what can I say, I am speed 🤣, Thanks for the reply btw love your videos

  • @manzell
    @manzell Жыл бұрын

    I love Local Functions - but I feel like I'm cheating. Especially when I use deferred calls, I can retain access to the local variables in the current scope without having to pass 5 or 6 args into the deferred call.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    It's amazing 😊

  • @_g_r_m_
    @_g_r_m_2 жыл бұрын

    Hey i've litteraly just found out by experimenting that this is possible

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    What a magical accident :)

  • @bujin1977
    @bujin19772 жыл бұрын

    I've been programming in C# for a few years but have never really considered using local functions. What if you want to be able to unit test the local function? Does this make it more difficult to do that?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I suppose it could. I generally don't test a private function whose sole responsibility is to service another function. The test will be on the primary function. But yes, it certainly could.

  • @AtelierSenna

    @AtelierSenna

    2 жыл бұрын

    In general you'd want to test the interface not the implementation - you also couldn't really unit test a private function, so this isn't really any different in that regard.

  • @odo432
    @odo4322 жыл бұрын

    Why use 'var'? I've read their only benefit is when using anonymous types and should only be used for that purpose and that using it for any other purpose is just lazy coding. However, I see 'var' used everywhere. I'm personally not a fan. I guess because I prefer to know exactly what type of variable it is I'm working with. But I am curious to know if there is an actual benefit to using them given it's recent(?) popularity.

  • @officiallyaninja

    @officiallyaninja

    2 жыл бұрын

    compare Dictionary foo = new Dictionary() and var foo = new Dictionary()

  • @victorlapin2080

    @victorlapin2080

    2 жыл бұрын

    Most IDEs are resolving var types right there, so you can see it instantly. For me it's just convenient, because I'm a Kotlin dev and used to val/var 😊

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Certainly not recent popularity. It's very rare I cannot tell a type by its assignment and if I can't I just hover the type and my IDE tells me (this happens maybe once a month). There are a few main reasons to use var: Faster to write shorter (I really don't want to see 'Dictionary myDictionary = new Dictionary();') Looks cleaner (imo) Sometimes I don't know the exact type I want to create until I start typing (think complex linq expressions) Less to change if you wanted to use a different type People may call it lazy, but while they're typing out a long ass declaration, var-bois are already on the next line.

  • @odo432

    @odo432

    2 жыл бұрын

    @@victorlapin2080 Which is definitely nice. But when I go over to github to look at some code and everything is var and I'm having to figure out what type it is, which can be made more difficult when it hasn't been assigned anything, can be a little annoying. Maybe it's just me. Even when I use Godot I still specify a type for variables when it's not necessary. I guess it's a preference thing.

  • @victorlapin2080

    @victorlapin2080

    2 жыл бұрын

    @@odo432 I'm inclined to agree. I was ranting exactly the same way back in the days when var was first introduced to C# =)

  • @SomethingToSee101
    @SomethingToSee1012 жыл бұрын

    I like the functionality but the fact that this makes it harder to read your functions as a sequence of commands turns me off enough to avoid using them. But it's a good tool to know

  • @user-rm2gh2gc5f
    @user-rm2gh2gc5f2 жыл бұрын

    Another way to use functions, both regular and local, is to self-document your code. Instead of commenting everywhere.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    For sure! I try to when I can

  • @jesusmgw

    @jesusmgw

    2 жыл бұрын

    You mean by naming them properly so we see the function name instead of the full code?

  • @user-rm2gh2gc5f

    @user-rm2gh2gc5f

    2 жыл бұрын

    @@jesusmgw Yes, for this too. I meant that the function must do a certain action, which will be clear from its name.

  • @AmNothi
    @AmNothi2 жыл бұрын

    damn foreigners!

  • @segue2ant395
    @segue2ant3952 жыл бұрын

    I need a lie down, this changes too much for me.

  • @madewithreallemons263
    @madewithreallemons2632 жыл бұрын

    My company also has the brackets on new line standard... It felt illegal

  • @spaceblade
    @spaceblade2 жыл бұрын

    Check ur discord dms

  • @ibrahimrashwan
    @ibrahimrashwan2 жыл бұрын

    Waiting for that awesome quaternion video of yours ... have been dealing with it for about 3 years now and still. I DONT KNOW what the hell i doin just calling some weird function because some guy some where said so 🥲

  • @stephenkentperez7705

    @stephenkentperez7705

    2 жыл бұрын

    Me too. And if those tutorials wont work I just tab random intellisense suggestions following the Quaternion syntax and test to see if it's works close enough to what I'm expecting and never understand why it did. "It worked! Now don't hurt it's feelings coz it might decide not to" hahaha