Train To Code

Train To Code

FrontEnd is hard

FrontEnd is hard

Async Await in Typescript

Async Await in Typescript

5 Hidden Features of C#

5 Hidden Features of C#

CSS Variables Explained

CSS Variables Explained

Пікірлер

  • @ronaldsupenieks803
    @ronaldsupenieks8032 күн бұрын

    Nice video man. What's missing in this is a hot module reload set up - something I'm trying to figure out. this way you don't need to keep running the build command but have your changes appear live in the extension

  • @tophat593
    @tophat5933 күн бұрын

    Meh, it's js. No matter what you do it's ugly.

  • @olexandrvelychko6482
    @olexandrvelychko64823 күн бұрын

    best vid i've watched so far to help me switch from java to c#, thanks for brilliant animations and succinct delivery!

  • @vedbhanushali608
    @vedbhanushali6083 күн бұрын

    sir very helpful tutorial, thank you for great explanation, I have still one query how to do background service and content service to run on it ?

  • @souleater9408
    @souleater94084 күн бұрын

    delegates and events seem like features that should be included :D

  • @pqsk
    @pqsk5 күн бұрын

    It really depends. There are some coders who just love to use syntactic sugar all over the place. Sometimes all cramped in 1 line. No comment, no explanation in the function description, etc. this can be read and understood, but you have to deconstruct it. Not very ideal. You might as well show the generated/optimized binary. There are a lot of functions that I don't know here and keywords, but with my years of experienced coupled with the different languages I've learned I can figure out what the yield does and the other, what looks like, lambdas do. Sometimes using language features can be done incorrectly. For example doing something similar in C# would work perfectly assuming you're working with an enummerable. But if this, I believe is TS, doesn't have that concept then the code big O is much longer than expected. So yes obviously agree that it helps to know the language good, but also not to clog it all up in one line either or even 2 lines what should be broken down and use meaningful variables vs xyz, abc, etc

  • @aarondcmedia9585
    @aarondcmedia95855 күн бұрын

    I know replete + fallacy, however the lower sentence has fewer syllables and is therefore more efficient, and the sentence I prefer.

  • @aarondcmedia9585
    @aarondcmedia95852 күн бұрын

    @@davidmurphy563 you're mistaking your understanding of the word, "fallacy" for "logical fallacy". Fallacy does not necessarily imply "logical fallacy" when it's used. Fallacy can just mean mistake or error.

  • @DanteMishima
    @DanteMishima6 күн бұрын

    Step 1: Remove typescript Step 2: Make it simple enough for people to understand

  • @blueyon
    @blueyon7 күн бұрын

    writing simple code comes from experience. new programmers normally produce spaghetti code.

  • @randomawesomeness852
    @randomawesomeness8526 күн бұрын

    I agree with you , as a uni student i try to use programming techniques before writing my code , i try to use dynamic programming and divide & conquer so that i have more control on my code ، but again i had to search alot about how to write clean code and more controlled code , because they don't teach or mention this in uni

  • @TizzyT455
    @TizzyT4558 күн бұрын

    0:38 "arguments" when you are pointing to parameters? 0:58 "These days C# programmers will exclusively use var everywhere", sure maybe the bad ones. "Implicit typing is good so use it", if you're a bad programmer. 1:44 "am i a joke to you" -enums

  • @collinsonOga
    @collinsonOga9 күн бұрын

    It's a lot like java. Maybe too much like Java

  • @AnwarAliCodes
    @AnwarAliCodes10 күн бұрын

    thank you for this

  • @patrikmattsson973
    @patrikmattsson97311 күн бұрын

    it can be a fine edge to balance between short and expressive or becoming so short its cryptic instead. But less lines of code generally removes the risk of bugs hiding in the forest of characters on the screen, so I'm of the opinion that you should aim to keep things as short as possible, as long as it stays easy to read. And if it's new vocabulary, short functions with clear names should help anyone new to it to quickly understand what it does.

  • @user-fk1wn7jq9i
    @user-fk1wn7jq9i12 күн бұрын

    Great presentation and great video :)

  • @Tudrum2
    @Tudrum214 күн бұрын

    2:58 false claim, classes can have methods that are less restrictive that their classes, eg. private classes can have public methods and internal classes can have public methods.

  • @opedro.salvador
    @opedro.salvador14 күн бұрын

    Thank you guy, I`m a brasilian developer and your video help me to decide for Firebase. Continue doing good videos like this. bye bye

  • @ArmanJindal-ls8yo
    @ArmanJindal-ls8yo15 күн бұрын

    Awesome video! Thanks so much. Quick q: how would you pass state from the page context to the popup context? I love that we can easily pass from popup to page via the args function, but what way would you recommend to go from page -> popup. I want to have my popup react to the current page the user is on! Thanks :)

  • @StephenBeale
    @StephenBeale20 күн бұрын

    nice one, thanks

  • @drygordspellweaver8761
    @drygordspellweaver876121 күн бұрын

    Inumewable awway uWu

  • @slapmyfunkybass
    @slapmyfunkybass23 күн бұрын

    I’ve been doing c# for around 10 years but you sure made a lot of it confusing. I had to pause it a few times and look at the code to understand what you meant. How you expect someone who’s never done the language to pick this up is beyond me. A really poor teaching method, variables, loops and conditional flow should have been covered first, then a brief look into oop. Covering generics and structs 2mins in is just ridiculous.

  • @mdnahidseo
    @mdnahidseo23 күн бұрын

    Hi Are you looking for a Professional youtube thumbnails designer and video SEO expert?

  • @traintocode
    @traintocode22 күн бұрын

    Lol what's wrong with my thumbnails?! How rude

  • @larsolepetersen4748
    @larsolepetersen474824 күн бұрын

    Thanks for de video - One thing though there IS a TRY - CATCH in the java code

  • @tayyabshaikh3286
    @tayyabshaikh328625 күн бұрын

    lets make a new video on .. c# version 1 to 13.. all features

  • @traintocode
    @traintocode23 күн бұрын

    That would take all day 😆

  • @DelPieroJoga10
    @DelPieroJoga1025 күн бұрын

    only bad thing about this, its because uses react 😆

  • @keshav_dhiman
    @keshav_dhiman26 күн бұрын

    howto implement background scripts?

  • @eliasbenjamin4228
    @eliasbenjamin422826 күн бұрын

    If you wanted to add a service-worker to the vite application, would it be in the public or src folder, and how would the manifest point to it? Thanks!

  • @traintocode
    @traintocode23 күн бұрын

    This article might help but I've not done it so can't speak from experience dev.to/reeshee/how-to-bundle-your-custom-service-worker-in-vite-without-using-pwa-4nk

  • @inalegwunoelali3629
    @inalegwunoelali362927 күн бұрын

    Awesome video! Helped me alot in completing my final year project

  • @traintocode
    @traintocode23 күн бұрын

    Thanks!!

  • @solomusic16
    @solomusic1629 күн бұрын

    I've previously done javascript, but didn't understand to much and I want to go into c# :(

  • @traintocode
    @traintocode23 күн бұрын

    They aren't all that different fundamentally, good luck with C#

  • @mikkun_
    @mikkun_29 күн бұрын

    Man this summarizes everything I've learned so far in creating chrome extensions. You earned a sub from me!

  • @traintocode
    @traintocode23 күн бұрын

    Thanks so much!!

  • @maxcohen13
    @maxcohen1329 күн бұрын

    This would make a good cheat sheet to download.

  • @traintocode
    @traintocode23 күн бұрын

    Thanks!

  • @DanCashion
    @DanCashionАй бұрын

    do not use var, we look down on auto practices. The thought process is var is fine until you submit for the pr, at that point your variables should be very specific and not be allowed to auto cast

  • @traintocode
    @traintocode23 күн бұрын

    Everybody has their own preferences, if you agree as a team you don't want to use var then fine. Many developers find it makes the code more legible and 99% of the time you don't need to know exactly what type a variable is at first sight.

  • @danilodjokic5303
    @danilodjokic5303Ай бұрын

    Just a note for all the viewers. Records do not necessarily have to be declared "record MyRecord(string prop1, int prop1);". They can be also be declared with curly brackets in the same syntax as classes and structs. The syntax above is called a "primary constructor". It basically writes the property declarations and constructor initializations for you. Records were the first feature to have this and it's idiomatic to always write them like this but as of C# 12 you can use primary constructors on classes and structs too

  • @traintocode
    @traintocode23 күн бұрын

    This is true - I actually made another video about primary constructors for classes here kzread.info/dash/bejne/iJWmp5adYqXXfdI.html

  • @heavengrrl
    @heavengrrlАй бұрын

    While obviously not going into specifics, this video was rlly good for "knowing what i dont know"

  • @traintocode
    @traintocode23 күн бұрын

    Thanks!

  • @ImNotFlutters
    @ImNotFluttersАй бұрын

    ?

  • @stevemaricic7585
    @stevemaricic7585Ай бұрын

    Excellent video. Very clear explanation.

  • @traintocode
    @traintocode23 күн бұрын

    Glad it was helpful!

  • @Bunny99s
    @Bunny99sАй бұрын

    When I saw the title I already knew that it would not fulfill it's promise :D. Almost at every point I had something to complain. Though sometimes I might be a bit picky. 00:36 "Each line is ended with a semicolon". Well especially for new users of the language this can be misleading. Not every line has a semicolon at the end but every statement. It's a bit difficult to explain this in easy terms, though it's certainly not every line. Common beginner mistakes is putting a semicolon at the end of an if statement which would end the statement right there. So the following body has no connection to the if statement this way. 00:46 Besides line comments, there are multi-line comments using /* This is a comment */ 01:26 Just like to point out that the primitive type list is a bit longer than what was shown here ^^ 01:39 Well, he said DATA-types so we might forgive missing enums, delegates, interfaces and closures. 02:01 This is a common misconception. Structs don't live on the stack unless their variable is declared on the stack. Structs are value type and as such are directly stored in the memory of the variable itself. So it depends on where the variable is stored. When the variable is a field of a class, that struct would live on the heap. 03:00 This is just false. A private class can of course have a public field or method. How would you interact with anything in that class? When a nested class is declared private, it can only be used inside that class and can never be exposed to the outside. So you can not declare a public or ptotected field of your private class type since from the outside or a derived class, that nested class would not be visible. However the fields and method inside the private class can have the full spectrum of modifiers 05:20 Those unfamiliar with C# probably should know about logical and, or, xor and not operators which are &&, ||, ^ and ! respectively. Personally I get some itching when tutorials show boolean variables inside an if statement compared to true. An if statement simply requires a boolean value. Those logical operators will return / produce a boolean expression. However a comparison with true is completely unnecessary. You could also do if (aBoolVar == true == true == true) which does the same as if (aBoolVar). The comparison of boolean operators don't need to be used inside an if statement. You can also use them to assign a boolean value. bool myVar = someString == "Hello" && age > 18; 05:57 This is called a "switch expression" which actually evaluates to a value. A switch statement is actually a control flow statement which does not evaluate to anything, like an if statement or for loop. 06:49 Even though I don't like them because they have a lot of overhead, it should be mentioned that you can have multidimensional arrays as well. They may look useful, but the performance isn't that great. For every access it has to do a bounds check on each dimension / index and calculates the flattened index every time. In most cases, especially in time critical situations (when you create games and not business apps) just using a normal 1d array and calculating the index yourself can be way faster as you usually would use nested for loops and you can pre calculate some of the offsets in the outer loops. Also when it's a 1d array it's much easier to iterate over all elements regardless their spatial relationship. 06:55 Small mistake here. The System.Collections namespace does only contain the untyped / object variants of those collections. All the types shown there are inside the System.Collections.Generic namespace. You almost never want to use the untyped variants. They are essentially an ancient leftover. Even when you want to store System.Objects / objects, most people would still use the generic List with the type object rather than the ArrayList. 06:58 It should be pointed out that "importing" a namespace does not load anything like in other languages where some kind of import would actually load or embed another file. Such a using directive will "just" shorten the type names. So this is a pure organisational feature. We use namespaces to avoid name collisions. Different namespaces can have the same class / type names, but you can not "import" both as when you get a name collision, the compiler would complain as it can't tell which type you wanted to use. It's possible to "import" or resolve individual types by: using MyType = Some.NameSpace.MyType; Here we can even rename / give the type a file wide alias name 07.23 This is only partly true as the foreach loop does first and foremost use pattern matching and only resort to the IEnumerable interface when no pattern could be found. The pattern the compiler looks for is simply if the instance passed into the foreach has a method GetEnumerator and if the returned type has a MoveNext method that has no arguments and returns a bool, and it should have a Current property that is readable. If those conditions are met, the compiler will just use those methods, even without the interface. Most of the built-in collection types use struct enumerables / enumerators to avoid creating garbage on the heap. 07:34 Again, the generic version of the IEnumerable is in the System.Collections.Generic namespace. The untyped / object version is in the System.Collections namespace. 08:44 Just to use the right terminology, the stuff after the "where" keyword is called constraints. Several constraints can be specified by separating them with a comma. Note that all constraints need to be satisfied. If a generic class or method has more than 1 generic argument and you want to put constraints on more than one, you need to use another "where" for each argument you want to constrain. Just as a warning: Generics can be quite useful, but are often misunderstood. Many want to use them like polymorphism, however generics are somewhat the opposite of that. While deriving from a base class keeps the data of the base class but allows to overwrite functionality, generics actually keep the functionality the same while being able to exchange the data the function works on. Bound generic classes are usually incompatible with each other. So a List<int> and a List<string> are two completely separate types. In rare cases there can be exceptions with the right conditions (covariance / contravariance) but that are really rare usecases. 08:55 Well a lot is missing for it to be a video about all language features ^^. I know it can't really be comprehensive, but things that weren't really mentioned are: delegates (essentially typed function pointers), anonymous methods / closures, (ability to automatically capture variables in a scope object) lambda expressions, enums, nameof, all operators (there are a lot) operator overloading in classes type conversion operators events, CIL and the ability to decompile to other .NET languages extention methods, linq (I mean the LINQ syntax which is simlar to SQL, not the classes from the System.Linq namespace), attributes (essentially static metadata that can be attached to almost everything) params (essentially allows variable arguments as the last parameter of a method) exceptions (try / catch / finally) object initializer nullable types partial type declarations ref / out (pass by reference) indexer (allows a class to be used like an array or dictionary) using statement (not to be confused with the using directive at the top. It's used to automatically dispose objects) goto (Yes, C# has goto. Now forget that I mentioned it ^^) reflection Those are just some things of the top of my head. I only focused on language feautes, not framework features or classes. Now I've spend already too much time on this post so lets wrap it up. There's still a lot missing. If you want to learn more about the syntax, look up "C Sharp syntax" on wikipedia.

  • @Jsjjskk
    @JsjjskkАй бұрын

    I went through a detailed 4 hour course over the past few days and then I watch this, it's ruining my knowledge so I stopped watching, this video is a great way to confuse people

  • @chaimspear
    @chaimspearАй бұрын

    very nice, I have been using C# for 15 years, read books, watched other videos etc. yet this is really useful and educational in just a short video. Thank you !

  • @traintocode
    @traintocode23 күн бұрын

    Glad it was helpful!

  • @llFike
    @llFikeАй бұрын

    Didn't know you could have top level functions in C#! gonna be honest, my distaste for C# is slowing wearing off

  • @traintocode
    @traintocode23 күн бұрын

    Hahaha as it should...

  • @GiridharaSaiPavanKumarGurram
    @GiridharaSaiPavanKumarGurramАй бұрын

    nice video! showing the similarities and differences. Discussing the topics which are different but are from /around the same concepts would be beneficial

  • @traintocode
    @traintocode23 күн бұрын

    Hey, thanks!

  • @_jam1eK
    @_jam1eKАй бұрын

    it should be remaked whenever new version released!

  • @alfonzo6320
    @alfonzo6320Ай бұрын

    don't do vars kids.

  • @traintocode
    @traintocode23 күн бұрын

    why?

  • @alfonzo6320
    @alfonzo632023 күн бұрын

    @@traintocode its bad and addictive. c# is strongly typed for a reason. For everyone's sake, just write the damn type lol.

  • @dmitriyvainila4227
    @dmitriyvainila4227Ай бұрын

    Wonderful video! Thank you, mate. Subscribed for more :)

  • @traintocode
    @traintocode23 күн бұрын

    Glad it was helpful!

  • @rahulgupta373
    @rahulgupta373Ай бұрын

    18:55 why i cant listen anything 😕??

  • @hurdurstudy295
    @hurdurstudy295Ай бұрын

    this tutorial is amazing

  • @traintocode
    @traintocode23 күн бұрын

    Thanks!!

  • @prashlovessamosa
    @prashlovessamosaАй бұрын

    great guide

  • @traintocode
    @traintocode21 күн бұрын

    Thanks!

  • @micky992
    @micky992Ай бұрын

    Thank you so much!

  • @traintocode
    @traintocode21 күн бұрын

    You're welcome!

  • @forwardslashbeats3091
    @forwardslashbeats3091Ай бұрын

    Maybe I’m the only one here but I hate implicit typing with a passion. Why would I ever want to put a barrier up for knowing what type I’m dealing with? It feels to me that except in a few situations where you could get different types being returned to you and this gives you an option for how to handle that, that I’m always better off making the effort to be explicit in my use of types as it’s far clearer to read?

  • @christiansongplaylist7004
    @christiansongplaylist7004Ай бұрын

    better than many courses

  • @sakthikumaran8076
    @sakthikumaran8076Ай бұрын

    Your videos are great! You earned a subscriber!

  • @traintocode
    @traintocode21 күн бұрын

    Awesome, thank you!