5 MORE C# keywords you (probably) never had to use

Sdílet
Vložit
  • čas přidán 22. 05. 2024
  • The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: skl.sh/nickchapsas04211
    Subscribe: bit.ly/ChapsasSub
    Become a Patreon and get source code access: / nickchapsas
    This video was sponsored by Skillshare
    Hello everybody I'm Nick and in this video I am going to cover 5 MORE C# keywords that you almost definitely never had to use. This is a followup video to my previous video about 6 C# keywords that you never had to use. If you know more keywords that aren't common please let me know in the comments down below.
    Timestamps
    Intro - 0:00
    extern alias - 0:37
    goto - 4:36
    global - 7:52
    volatile - 10:01
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    Keep coding merch: keepcoding.shop
    #cleancode #cleancoder

Komentáře • 112

  • @nickchapsas
    @nickchapsas  Před 3 lety +2

    The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: skl.sh/nickchapsas04211
    Thanks to Skillshare for supporting the channel and sponsoring this video.

  • @bartekm3878
    @bartekm3878 Před 3 lety +93

    Please do a video on the volatile keyword. I love your channel. It goes really in depth on how C# works. Something rarely looked into by other youtubers.

    • @frankroos1167
      @frankroos1167 Před 3 lety +3

      Nerd-out needed!
      And more nerding out: Differences in compiler optimizations between Debug and Release mode. Or was that already done?

  • @Albileon
    @Albileon Před 3 lety +57

    Please make a volatile video :) would love to see it! Interesting stuff

    • @lizard450
      @lizard450 Před 3 lety

      Always loved volatile from my concurrent class

    • @lizard450
      @lizard450 Před 3 lety

      Basically there are different types of memory. Cache and your Ram. Now ideally you want your code in cache it's way faster. So what your computer does is pulls data from cache. Now when you're running multiple threads one thread might not know about the cache and therefore go back to memory or vice versa. Essentially the problem is you have two representations for one data point. Volatile makes it so that everyone updates RAM directly no l1 -l3 cache. It's slower but no concurrency issues.

    • @xxx.xxx.xxx.xx1joker706
      @xxx.xxx.xxx.xx1joker706 Před 3 lety +1

      @@lizard450 This is easier to explain the volatile keyword, saying that in a memory plan, you may have memory chunks dedicated to I/O (Inputs/Outputs) in a microcontrollers. For instance, you may have a chunk of the memory dedicated to a coprocessor buffer. So, as the data in this chunk of memory may be changed by another peripheral, when volatile is used for a variable, this forces the compiler to read or write in the address of the variable instead of using a software register where the content of the variable has been stored. LOAD R0,[R1] instead of MOVE R0,R1.

    • @Uni-Coder
      @Uni-Coder Před 3 lety +3

      Compiler often makes some optimizations in assumption of memory immutability between the statements of your thread.
      C++'s volatile means that this memory may be modified by a third party (other thread, system, interrupt handler, device, etc) and disables such compiler assumptions and optimizations forcing it to read the variable each time from memory.
      I guess that C#'s volatile means the same.
      In addition, you should consider such things as reordering and memory barriers.

    • @xxx.xxx.xxx.xx1joker706
      @xxx.xxx.xxx.xx1joker706 Před 3 lety +1

      @@Uni-Coder Perfect explanation. Nothing to add. This is the same stuff for goto. This comes from unconditional branching instruction in assembly (JUMP @LabelAddress or BRA @LabelAddress). The goto instruction seems to be useless for C# coding but in some tricky loops, or low level error handling mechanism (instead of try catch finally), goto can be really useful and compact.

  • @biohaz999
    @biohaz999 Před 3 lety +24

    I program in C# for over 10 years now, and i thought is is totally impossible to import 2 libs at the same without ILmerge or some other tools. extern alias blew my mind 🤯🤯🤯🤯🤯 THANKS for new tricks

    • @thygrrr
      @thygrrr Před 3 lety +1

      Same... such a fml moment!!! :D

    • @user-wb1lg6zi8q
      @user-wb1lg6zi8q Před 3 lety

      I think any developer wants to find a job where you have time not only for hard work but also for learning new features. Of course we all do this all of the time, but in most cases it only applies to current work tasks. I can learn something new in just a few hours between finishing work and going to bed, but because of this i don't have a time for myself

    • @protox4
      @protox4 Před 2 lety

      Unfortunately, there is currently a bug in MSBuild where if you have 2 DLLs with the same name and version, extern alias doesn't work.

  • @Blu3Souls
    @Blu3Souls Před 3 lety +24

    I'd be excited to see the explanation of the volatile keyword.

  • @Lord2225
    @Lord2225 Před 2 lety +1

    6:25 goto can have impact on performance bcs you can perform trick called 'indirect jumping' which can trick jump predictor. But it have usecase only in very high performance code.

  • @BlazarVision
    @BlazarVision Před 3 lety +3

    I can see the extern alias being used for benchmarking different versions of a library/api to demonstrate performance differences between versions

  • @straybasilisk2689
    @straybasilisk2689 Před 3 lety +9

    I could see the first one (alias for multiple versions of the same library) being necessary for backwards-compatibility - e.g. needing to support data which has been serialised in multiple versions of a format which are not all compatible.
    Or perhaps you're using two third-party libraries which require you to use different, incompatible versions of some other library to construct objects to pass in to them.
    I've also used the pattern with a volatile bool quite often in game development - usually you have a few long-running threads (e.g. rendering thread, gameplay update thread, audio pump thread...) which will loop indefinitely, and you want a lightweight way to signal them to stop.

  • @ImmacHn
    @ImmacHn Před 2 lety +1

    Regarding the first one, imagine a newer version of the library has a bug that has not been fixed, but fixes another bug, that could be a very niche use case for that. I recently had to rollback a NuGet package due to a bug introduced in a newer version, and while I don't think I'd go for the alias even if I knew it at the time, it is not hard to imagine someone having to fight some legacy code that depends on a bug or a removed feature from an older version.

  • @penetrarthur
    @penetrarthur Před 3 lety +8

    Goto can be useful in switch statements, when you need to jump to another switch statement in something like parsers or state machines.

  • @LynxofCP
    @LynxofCP Před 2 lety

    I once worked for a company that had a large Visual Basic for Application (MS Access) database that was hinged entirely on a certain algorithm, written in VBA.
    Many developers thought they could write a better algorithm, but failed to understand the nuances and the impact their "Improved" algorithm would have on customers.
    I tried my "own" algorithm, whereby I ported the code verbatim from VBA to C# and saw massive performance gains and the company was stoked that it had no detrimental effect on the customers. When I told everyone how I'd achieved it, the company was shocked to find out that what they really wanted was what they already had, and the developers on my team were mortified that I had used about 13 goto statements to achieve it (because refactoring that code to eliminate them would have changed the semantics)
    At the time there was a Visual Studio extension for giving "achievements" I had installed for the lolz and I was pretty amused when I hit "compile" and got the "GOTO HELL" achievement.
    The Aliasing trick is super interesting though. I hope I never have to use it.

  • @itworks2408
    @itworks2408 Před 3 lety

    The goto keyword does have a purpose beyond the classic 3GL use case of ignoring standard logic flow. For example,
    enum LogicCases
    {
    First,
    Second,
    Third
    }
    void TestGoto(LogicCases discriminator)
    {
    switch (discriminator)
    {
    case LogicCases.First:
    // execute logic specific to the first case
    goto case LogicCases.Second;
    case LogicCases.Second:
    // execute logic specific to both the first and second case
    break;
    default:
    // execute logic for cases other than first or second
    break;
    }
    }
    Whereas the standard behaviour of switch is not to allow execution to "fall through" to another case, goto case enables you to avoid redundancy by having a case with logic that is shared by a subset of the possible cases.

  • @GlassScissors
    @GlassScissors Před 3 lety +1

    Hi Nick, I actually never used external alias before, but after you showcased it, I started using it in two of our projects.
    Our use-case requires exactly this C# feature.
    We have a solution that we develop and need to integrate a module that is developed by a partner of ours.
    This feature integration is on the code level so when they for example use Json lib 12 and we use in our application 11, it makes total sense to integrate their module together with their json lib.
    I hope that gives you a good example of where this can be useful.

  • @promant6458
    @promant6458 Před 3 lety +5

    __arglist: let me please introduce myself

    • @franeknowak6084
      @franeknowak6084 Před 3 lety +2

      __makeref, __refvalue, and __reftype too :)

    • @nickchapsas
      @nickchapsas  Před 3 lety +2

      That set of keywords will probably be in the next video on that subject

  • @Andrew90046zero
    @Andrew90046zero Před 2 lety +1

    I really like your explanation of volatile.
    You could also imagine the volatile variable being manipulated by external hardware. Like, let's say, there is a special machine that will sometimes change the value of a specific memory location. That change was not "expected" by the program/compiler, but it happened anyway. The compiler can make optimizations based on its knowledge of what is changing. And can find redundancies, and eliminate them. Any external memory manipulations are out of reach of what the compiler can handle.
    So you need a way of telling the compiler that some value is "VOLATILE" and can change unexpectedly! :D

  • @levi_zitting
    @levi_zitting Před 2 lety +5

    +1 for making a dedicated video on the volatile keyword. I love the videos you make that dig in to those really low level aspects of IL code.

  • @thatcreole9913
    @thatcreole9913 Před 3 lety +11

    “...which means you _really_ hate people” Agreed! 🤣

  • @nietschecrossout550
    @nietschecrossout550 Před 2 lety

    We're using goto in switch-case branches actually quite often when changing the state of an object. I.e you have a class usually IDisposable in which you want to perform initialization layzily on a specific method call. So you have a state integer field and perform additional initialization based on state or throw and exception . You can switch state and go-to the next state after initialization or throw an exception if state is -1. In a if else brach this logic looks quite ugly and you have to perform redundant comparisons, whereas with case go-to the behaviour is transparent. An example where this pattern is used in NET is the Iterator class.

  • @OlegKosmakov
    @OlegKosmakov Před 3 lety +1

    Thanks for the great video. Another video with explanation for volatile keyword is very much needed, because, as you say, programmer hints to the compiler to not overoptimize something. But less experienced programmers have no idea what that exactly means, and what optimization are made in first place, and start using the volatile keyword left and right in every occasion trying to fix the multithreaded code (been there, too).

  • @RobinHood70
    @RobinHood70 Před 2 lety

    The simple version of "volatile" is that it flags a value that can be changed from the outside, which the compiler has no way of being aware of. I'm actually using it in my code as part of a "Pause" function, where the UI can be used to cause an asynchronous thread (via Task.Run) to pause. It's functionally almost identical to a CancellationToken, except it doesn't cancel.

  • @joshman1019
    @joshman1019 Před 3 lety

    The developers at Dymo (label printer company) made their developer framework dependent on the Dymo Label software you had installed on a particular machine (terrible). So the extern alias imports were required when developing for those printers in certain scenarios. In my case the majority of the machines on our network did not use label printing software, and so the update cycle on them was sporadic. Sometimes you would end up with two or three versions installed on different machines. So the software I created allowed the user to set their label printing software version and the correct library would be called based on that. It was a nightmare and required constant attention. Dymo has finally updated to a new framework, but it still has some minor compatibility issues.

  • @victorgarcia3526
    @victorgarcia3526 Před 3 lety +1

    I think goto can be used also in switch case, I'm not 100% sure but I think I used it

  • @matteobarbieri2989
    @matteobarbieri2989 Před 3 lety

    Very interesting topics. Thanks

  • @shanehebert396
    @shanehebert396 Před 3 lety

    I've seen that exact pattern used for workers that you show in your "volatile" example. Basically, a task that you can kick off from the UI but also has a "cancel" type button on the UI that calls a method on the object that has the task to set a "stop" Boolean.

  • @darianferrer
    @darianferrer Před 3 lety +1

    Oh god, if I'd known about no. 1 a couple of months ago, it would have save me a lot of time :D. Basically my company forked an open source library and started using it in package X that its shared across multiple microservices, but other packages were using the original library, so we couldn't use the latest version of X (on which we added a feature we needed) until all of them were updated, I think with the alias we could probably have solved the issue and not have to wait. Thanks for sharing this Nick.

  • @amin29a39
    @amin29a39 Před 11 měsíci

    I used extern alias once
    some library had breaking changes and i also had to update it but migrating old code to new library was very hard, so i had to use both at same time.

  • @MaximilienNoal
    @MaximilienNoal Před rokem

    I "use" goto when I translate x86 assembly to low-level C# with Spice86.
    The point is of course to then translate "C# ASM" to hgih-level ASM.

  • @darenbaker4569
    @darenbaker4569 Před 3 lety

    Thanks for another great video. Great to see things that I never do but also things to understand or reinforce understanding when you have to do dotnetpeek to reverse engineer lost or out of sync code, yes it happens. I agree with one of the comments please upload more on volital key word, having done multi threading processes and changing code to be self contained I might learn something

  • @sadux
    @sadux Před 3 lety

    Thank you Nick!

  • @moab5102
    @moab5102 Před 3 lety

    Thanks Nick, Great video as always, well done. Is it possible to make a video about what's the difference between method and property and when to use one or the other, it seems a lot of devs still confused of when to use methods (functions) instead of properties and vise versa. cheers please keep he good work going.

  • @smirnability
    @smirnability Před 3 lety

    Great video, thx!

  • @bslushynskyi
    @bslushynskyi Před rokem

    I had to use volatile in my project when we were making application which interact with external embedded device and the thread of that device had to change a value of that a variable

  • @RuiSantos78
    @RuiSantos78 Před 2 lety

    You can use goto into a switch case to jump from a case to another
    Switch (variable) {
    case 1:
    Do something()
    If (some other thing) goto 2
    break
    Case 2:
    Do other thing
    Break

  • @flyingmadpakke
    @flyingmadpakke Před 3 lety

    I once used the goto keyword as a sort of continue in a foreach, but going to the beginning without moving to the next item in the enumerator.

  • @OubaydaKhayata
    @OubaydaKhayata Před 3 lety

    Very interesting!
    I really love your channel. Would you please make a video on the Aspects Oriented Programming (AOP) and its best practices.
    I know there're many libraries for AOP but I really want to know how these libraries work.
    Best Regards!

  • @superpcstation
    @superpcstation Před 3 lety

    Ayyy Sponsorship! Congrats man!

  • @derMichaEUW
    @derMichaEUW Před 3 lety

    Yes, please nerd out :) your channel is great, thank you

  • @MZZenyl
    @MZZenyl Před 2 lety

    I used "extern alias" at my previous job, where I had to work with Microsoft Graph API SDKs. Some of what I needed was in the "1.0" package (general user/group management), and some was in the "beta" package (mostly things relating to Teams for EDU), however they both share a lot of the same type definitions.

  • @JJayToKlamca
    @JJayToKlamca Před 3 lety

    Awesome video. Global keyword is also used a bit in Xamarin, when you initialize Xamarin Forms or Essentials but it's always there when you create a project to I guess it falls under automatically generated.
    An interesting idea would a video about IL, assembly or whatever is that low level stuff is called :)

  • @ryan-heath
    @ryan-heath Před 3 lety

    The only place I might use a goto is when I want to retry from a catch. Just goto is a lot cleaner and easier to understand than added state or constructs just for a retry.

  • @aminnami2608
    @aminnami2608 Před 3 lety +2

    hey nick can u make a video & explain threads and their concepts and usages in C# ? thanks for your awesome contents

  • @GregWilliamBryant
    @GregWilliamBryant Před 3 lety

    Excellent video as normal, a video on volatile Vs locks and synchronisation would be great!

  • @pavelpavlov4247
    @pavelpavlov4247 Před 2 lety

    I was heavily using the global:: keyword in my previous company. It was a 3rd party UI components vendor for XamarinForms and they wanted their namespaces to be consistent with the namespaces of the particular platforms. And when you are coding inside an assembly you can end up being in the situation you explained in the video. For example if you are in the namespace VendorName.Android.Input and you need to access something from the global Android.Input namespace...there is no other way to do it :)

  • @russosalv
    @russosalv Před 3 lety +1

    Nick pls explain volatile things.
    Also can you make some video about concurrent bag and other multithread things

  • @DxCKnew
    @DxCKnew Před rokem

    I have developed some very heavily multithreaded code with specialized collections optimized for performance for specific use cases, and there I utilized volatile quite a bit, and also Interlocked class. That was in .NET Framework 2.0, before the Concurrent collections was introduced.

  • @DmitryBaranovskiyMrBaranovskyi

    Yesterday I used stackalloc for the first time in 10 years of programming in C# (In production code). Finally, it became useful in combination with Span

  • @FazZeGaming
    @FazZeGaming Před 3 lety

    Hey love your videos, they are great and extremely useful! Is there any chance you could make some videos on getting .NET jobs, e.g. good projects, good CVs ideas etc.

  • @benjaminclehmann
    @benjaminclehmann Před 3 lety +1

    I've used global sometimes when using libraries that conflict. I think I remember having Avalonia.Imaging and System.Drawing.Common.Imaging, and for whatever reason I thought global::foo was better than referencing it explicitly.
    I've also used volatile in C, but never in C++ (or in C#) because the modern STL provides some pretty good facilities for managing concurrency.
    As for goto, I wonder if a labelled break syntax (like Java has) might be interesting, as in my mind goto is only justifiable for breaking out of nested loops (and maybe not even then) in languages which support exceptions. But I can't say that I've seen labelled breaks really be used that often in Java, so maybe it wouldn't change things that much. Plus I think labelled breaks were added as a compromise to avoid adding gotos, and C# has already added gotos anyways.

  • @maratgumerov3523
    @maratgumerov3523 Před 3 lety

    We use extern alias in our project.
    We create a library, which contains patched NewtonSoft.Json classes inside. We can't use an external NuGet package for some reasons.
    All these classes marked as internal, so end users don't have any conflicts. But we also use InternalsWisibleTo for our test project and use NewtonSoft.Json package in our tests.
    You also said that NuGet does not allow us to use aliases, but we actually found a way to do it) Take a look at this link: stackoverflow.com/questions/33460667/how-to-use-extern-alias-with-nuget
    We use an extra Target to find a referenced library that was added by NuGet and then we add an alias to it.

  • @jonas9
    @jonas9 Před 2 lety +2

    What about __arglist, __makeref and __refvalue? These are definetly used even less.

    • @nickchapsas
      @nickchapsas  Před 2 lety +2

      These are undocumented so it’s even worse. I have a video on them

  • @penetrarthur
    @penetrarthur Před 3 lety +2

    Congrats on sponsor!

  • @vitordesouza2304
    @vitordesouza2304 Před 2 lety

    Some time ago, I needed to use the external alias on a big project with dependency hell problem. After this, I always take care about package versions in projects who have references from other projects with the same package. I want never more need use this again hehehehe

  • @leathakkor
    @leathakkor Před 3 lety

    I use global all the time.
    One for code generators I've created.
    I've also had nameSpaces that has console in it. Specifically when I had multiple ways to run an app, like from the console, one from iis, one that is a service.

  • @thatcreole9913
    @thatcreole9913 Před 3 lety

    Would love a video on Volatile.

  • @Almamu
    @Almamu Před 3 lety

    Please make a volatile video going deep into it!

  • @arthursoares610
    @arthursoares610 Před 3 lety

    I already need to use global keyword when I had a namespace conflict and change namespaces would be a nightmare. Then I used it on importings.

  • @Flubberia
    @Flubberia Před 3 lety

    On some of our projects we were using extern alias but only during migrations phase of our project when we wanted to have some things from new library but all our solution were dependent on old one (times of NServiceBus 2.0 and NHibernate dont remember what version) - one word - Legacy =) As for goto I saw some algorithms using some goto statements. As for global actually not long time ago had a problem with SpecFlow and one of our libraries (you know custom Nuget for company), someone created library with 'System' namespace, and code generated by SpecFlow was just not working (I wish they actually used that keyword during code generation). As for volatile hm - few years ago we were using in some 'really' multithreading scenarious, also a lot of memory baries ah classic.

  • @matthewtrip2124
    @matthewtrip2124 Před 3 lety

    Mate I would fricking love a volatile vid

  • @Mfbzai
    @Mfbzai Před 2 lety

    This channel like c# pro.

  • @anwaraisling
    @anwaraisling Před 3 lety

    The only case in which I can imagine using the alias keyword is where someone is writing their own custom implementation of a C# game engine using OpenGL where they want maximum hardware support for older generation hardware, and thus use every version (or at least some versions) of OpenGL. However, I cannot imagine a case where they would need/want to be able to access more than one version at the same time. I think the normal use case in this instance would be to use preprocessor directives to select version.

  • @matheusreinert776
    @matheusreinert776 Před 3 lety

    please do a volatile keyword video

  • @somerandomusernameeman

    please make a video for volatile

  • @EyeOfMaat
    @EyeOfMaat Před 2 lety

    my C# is a little old, but why not use the lock feature when changing the _shouldStop variable? The last time i was multithreading I was using delegates too, if that give you an idea of how long ago it was. I havent been keeping up to date as well as i should.

  • @DevonLehmanJ
    @DevonLehmanJ Před 3 lety +1

    Global keyword is helpful when you have a wrapper library for some third party package. Go example I want all my code talking to ExternalService in MyApp.ExternalService project. The service has the top level namespace that for me is the second level. So when I refer to that library I need to use global::ExternalService.Client or else it looks for MyApp.ExternalService.Client which doesn't exist.

  • @alexvanheerden5702
    @alexvanheerden5702 Před 3 lety

    Where did you learn about these features? I've only been a backend C# developer for about a year and I've never had a use case for any these and you don't seem to have found a use case for them professionally.

  • @ronaldoperes1202
    @ronaldoperes1202 Před rokem

    I remember GOTO from Basic Language

  • @user-jg4ee5sv1d
    @user-jg4ee5sv1d Před 8 měsíci

    From 2023 on the volatile keyword: this code works perfectly even without volatile. Maybe in .NET 7 this bad release optimization is fixed?

  • @Jaws959
    @Jaws959 Před 3 lety

    I often encapsulate my usings inside the namespace and use global a fair amount when dealing with similarly named spaces or classes.
    It helps me to be explicit and not be afraid to name things accurately rather than avoid a name because it already exists somewhere else.
    E.g. building a discord bot
    MyFramework.Discord {
    using global::discord;
    }

  • @YSoreil
    @YSoreil Před 3 lety

    It should be noted that it merely "happens to work" in the debug build. There is no guarantee it will allow you to get away with that broken code.

  • @davidwilliss5555
    @davidwilliss5555 Před 3 lety

    Gotos are evil. The best explanation for volatile is that you use it when one thread needs to access a field that may be changed by another thread. Without the keyword, the optimizer thinks that nothing in the code it's compiling can modify the variable so it can move the check outside the loop. With the keyword, you're telling the optimizer that another thread may change the value so it needs to check it every time.

  • @ws_stelzi79
    @ws_stelzi79 Před 2 lety

    I like the smell of Goto in the morning! Seriously who doesn't like the smell of spaghetti code!

  • @panoukos41
    @panoukos41 Před 3 lety

    Oh yes global, the first time I used it in Xamarin project because I named it Android not Droid, didn't see why this would be a problem until I needed Android namespace :P

  • @arnaldofernandez
    @arnaldofernandez Před 3 lety

    I saw the goto keyword when in Sharplab.io converts a switch into multiple if statements.

  • @user-lz2mu9uq4e
    @user-lz2mu9uq4e Před 2 lety

    volatile = "don't cache the value"
    When you read value read it from RAM. When you write value write it to RAM. So var value is always up to date.
    A joke for russians:
    volatile UInt64 USDtoRUB;

  • @roaba3581
    @roaba3581 Před 3 lety

    +1 for the volatile vid

  • @frankroos1167
    @frankroos1167 Před 3 lety

    To me goto is a relic from the past. All the uses it had in the time of BASIC (no, not VisualBasic!) have been replaced by syntax that is way better. (Although I am curious to see someone who still has an actual use case for which there isn't one.) The way the loop was turned into a jumping exercise shows how loops were made before there were loops. That still has a scope for the if. Well, those weren't always there either. In the first versions the result of an if was a single statement. Often a goto.
    But the truth is: Under the hood, there is a LOT of goto. The really low level (assembly language) doesn't have all these nice structure things. Then goto (or branch as it is often called) is used to jump to or over the right bit of code.
    Amazing that they still put labels and goto in there, as it is so rarely needed. And now the language purists of old can tell everyone not to use C# because it has goto. (As they did in the time of BASIC.)

  • @NStripleseven
    @NStripleseven Před 2 lety

    Volatile is kinda nice actually

  • @ziaulhasanhamim3931
    @ziaulhasanhamim3931 Před 3 lety

    Please release the video on volatile

  • @nanvlad
    @nanvlad Před 3 lety +3

    volatile doesn't mean that data is used by multiple threads, volatile means that data changes frequently and this value won't be cached on a cpu. You can use volatile in a single thread scenario as well. Anyway, we're waiting for the detailed volatile video

  • @superpcstation
    @superpcstation Před 3 lety

    So global:: is like moving to the root directory?

    • @nickchapsas
      @nickchapsas  Před 3 lety +1

      Kinda. It goes as high as you can go. Even above the project's root.

  • @MattSuguisAsFondAsEverrr

    but i use goto tho
    maybe I'm niche

  • @DevDunkStudio
    @DevDunkStudio Před 3 lety

    Put the timestamps in front of the chapter to have CZcams show the chapters :p

    • @nickchapsas
      @nickchapsas  Před 3 lety

      I actually forgot to add the "Intro - 0:00" which is required for the feature to work. Thanks for pointing it out.

    • @DevDunkStudio
      @DevDunkStudio Před 3 lety

      @@nickchapsas also a possibility haha, great!

  • @rockymarquiss8327
    @rockymarquiss8327 Před 2 lety

    Goto - don't use - ever

  • @smirnability
    @smirnability Před 3 lety

    goto: !goto goto;

  • @davidwhite2011
    @davidwhite2011 Před 3 lety

    Skillshare must have your credit card number. Yuck...

  • @nimrodel3924
    @nimrodel3924 Před 3 lety +2

    apps that interact with cpp libraries use these all the time 😉

  • @sonicbhoc
    @sonicbhoc Před 2 lety

    In C#, global might be used for accessing certain VB.NET and F# things iirc (like VB.NET modules).

  • @alexclark6777
    @alexclark6777 Před 3 lety +1

    Cue the "goto" apologists in the comments...

  • @hypurban
    @hypurban Před 3 lety

    BTW, if you have nested loops and you use break in the inner loop, it doens't break out of the outer loop. So goto would be useless for that case. Break doesn't break out of all nested loops, just the one you're currently in.

    • @nickchapsas
      @nickchapsas  Před 3 lety +1

      It can break outside of nested loops if the label is further down.

  • @protox4
    @protox4 Před 2 lety

    Title says 5 keywords, video shows 4.
    I was expecting the undocumented keywords __arglist, __makeref, __reftype, __refvalue. ;)

    • @nickchapsas
      @nickchapsas  Před 2 lety

      I count extern alias as 2. There is a video on the undocumented ones coming on the 5th of August

    • @protox4
      @protox4 Před 2 lety

      @@nickchapsas Oh that's right, extern is also used for interop calls.

  • @russosalv
    @russosalv Před 3 lety

    Nick pls explain volatile things.
    Also can you make some video about concurrent bag and other multithread things