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

  • @seancpp
    @seancpp 5 ปีที่แล้ว +51

    Love the video! Just one thing:
    Make sure to clarify that the ES6 classes are still using the same prototypal inheritance as normal JS, and shouldn't be confused with the way inheritance works in languages like C++ and Java. (only the syntax is similar)
    The prototype chain and the quirks of the "this" context are all still present. The syntax for classes in ES6 hides this fact and can cause a lot of confusing errors.
    Hope this makes sense.

  • @PuzaExplores
    @PuzaExplores 5 ปีที่แล้ว +52

    I have always dreamed of a teacher like you 😍.

    • @kathy9124
      @kathy9124 4 ปีที่แล้ว

      Me too! 🤗

    • @aymenfyi
      @aymenfyi 2 ปีที่แล้ว

      me too

  • @williamhorn411
    @williamhorn411 2 ปีที่แล้ว

    I love how straight-to-the-boint this video is!

  • @CodingAdventures
    @CodingAdventures 2 ปีที่แล้ว +1

    Oldies but goldies. This is a nice video with a good explanation!

  • @Patrick-iy1rb
    @Patrick-iy1rb 5 ปีที่แล้ว +6

    You are my new favorite teacher. I hope you'll decide to start teaching full JavaScript courses and sell them at Udemy or something.

  • @danielluna7648
    @danielluna7648 3 ปีที่แล้ว

    Great video! I like how this series dives into the theory and what's happening under the hood and why more than your typical videos. I'm not the type of person who can just say "because that's how it works", I have to know WHY. So thank you.

  • @oksanaserhiivna2634
    @oksanaserhiivna2634 5 ปีที่แล้ว +1

    I wish all videos about JS were the same expressive and enthralling as yours. :) Many thanks for your work!

  • @mattmmilli8287
    @mattmmilli8287 5 ปีที่แล้ว +3

    Your dedication to educating about JS is impressive. I hope this channel pays of for you in the end even if that is not the goal.

  • @WaseemYusuf
    @WaseemYusuf 5 ปีที่แล้ว +8

    Honestly, these videos are so wholesome, I never thought the day would come where I'm gonna watch OOP explanation videos on TH-cam just to brighten up my day, but here we are.

    • @samplower5860
      @samplower5860 5 ปีที่แล้ว

      wholesome like your mom.

  • @aparnaiyer5873
    @aparnaiyer5873 3 ปีที่แล้ว +1

    How wonderful! Your energy is infectious, thanks sir!

  • @Jbortoletto
    @Jbortoletto 5 ปีที่แล้ว +3

    Hi Mr. teacher! Your classes are awesome, no matter if subjects are simple or complex. Thank you for sharing and inspiring!

  • @lukasluftlaufer1093
    @lukasluftlaufer1093 4 ปีที่แล้ว +1

    Oh Daniel, you helped me once again so much! Thank you for these videos!!! You really are the best.

  • @iamamirali3424
    @iamamirali3424 3 ปีที่แล้ว +1

    I couldn't understand how to use Super correctly to inherit the mother class until I found your video. Thanks for this paranormal energy!

  • @mxc_clips
    @mxc_clips 4 ปีที่แล้ว

    Your videos are the best. I am smiling while learning and watching a js tutorial.
    I always hope that someday I could take my skills and become a teacher to the next generation of programmers and I strive to be as good a teacher as you!

  • @mshahzebraza
    @mshahzebraza 2 ปีที่แล้ว

    Wow! It's real fun to see your code. You're so immersed in what you're doing brother. Keep it up!

  • @luismolinatanco1330
    @luismolinatanco1330 3 ปีที่แล้ว

    I am 49 yrs old. I grew as a programmer with c++. Since 2007 or so I use Processing and Arduino in my teaching. I love your videos and from watching them I’m wondering if I should be teaching p5.js instead of Processing. My students are Fine Arts students. I would love to have a conversation with you about this!

  • @kabirrsinghsahni7792
    @kabirrsinghsahni7792 4 ปีที่แล้ว

    He has the all-new ways to learn code, cheers!

  • @juliofslt
    @juliofslt 3 ปีที่แล้ว +1

    I think I already found my fav coding channel on YT, you make the learning process really enjoyable! :)

  • @codybui6252
    @codybui6252 2 ปีที่แล้ว

    Wonderful lesson. Thank you very much.

  • @PiyushKumar-qj8ue
    @PiyushKumar-qj8ue 5 ปีที่แล้ว +13

    Expert, always motivating me.

  • @pinkleprechaun52
    @pinkleprechaun52 2 ปีที่แล้ว

    The most adorable teacher on youtube

  • @johnjohnson4484
    @johnjohnson4484 4 ปีที่แล้ว +1

    your tuts are the gold standard here on yt

  • @kingykronous2284
    @kingykronous2284 5 ปีที่แล้ว +3

    I've recently discovered your channel and I love it!

  • @hoxas
    @hoxas 3 ปีที่แล้ว +1

    Best teacher ever, lol burst out laughing at boint.

  • @vishank7
    @vishank7 4 ปีที่แล้ว

    It feels sooo good to understand something like this! Thank you sir!

  • @ShaneLeeCoding
    @ShaneLeeCoding 5 ปีที่แล้ว +1

    When I was learning Java, Interitance was something that took me a while to get my head around. I wish I had this video when I was learning this. You've made this way more clear than anyone else. Thanks Daniel.

  • @charlesngerem3198
    @charlesngerem3198 2 ปีที่แล้ว

    You're simply a blessing

  • @hi-techlogics3831
    @hi-techlogics3831 3 ปีที่แล้ว

    You are a universal treasure.

  • @tntdogs6910
    @tntdogs6910 4 ปีที่แล้ว

    Nice video, helped me. I'm doing web-components now in my comp sci class

  • @ashwinramaswamy4059
    @ashwinramaswamy4059 3 ปีที่แล้ว +1

    For those using the Processing desktop editor - you might sometimes get a weird console error saying the superclass name is not defined when you try to extend it. I think this is because the editor rewrites index.html to always execute your .js files in alphabetical order of their filenames. So if you make a file 'B.js' and another 'A.js' where class A extends class B, you'll get a console error saying 'B is undefined', because it executes the subclass first.
    My solution is to just rename your subclasses to something beginning with a different alphabet, but it's a weird editor bug I think.

  • @d_v_d1070
    @d_v_d1070 5 ปีที่แล้ว

    happy to see concepts as such explained.

  • @josephgaribaldi4340
    @josephgaribaldi4340 5 ปีที่แล้ว

    I'm one of the people that's beeen watching you from the future. So had the opportunity to notice your hair styles evolution .... from happy relaxed to happy "businessman" style. So is this latest style just temp?

  • @nicchunglow
    @nicchunglow 3 ปีที่แล้ว

    You are really good at teaching!

  • @shaimaa3424
    @shaimaa3424 4 ปีที่แล้ว

    U made me love Coding 😍😍😍😂😂

  • @aleksd286
    @aleksd286 5 ปีที่แล้ว

    As a JS developer I can say that composition is preferred over inheritance. Please do a video about it, people will love it 😀

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      Can you link to some good resources so I can read up on and research?

    • @aleksd286
      @aleksd286 5 ปีที่แล้ว

      @@TheCodingTrain I think this article explains it well. medium.com/humans-create-software/composition-over-inheritance-cb6f88070205

  • @pierrem2983
    @pierrem2983 5 ปีที่แล้ว

    I finally realized that you have to be a good programmer to code in JavaScript

  • @lavdixit2267
    @lavdixit2267 4 ปีที่แล้ว

    you explained it very well

  • @osamasy5802
    @osamasy5802 4 ปีที่แล้ว

    You are really the best @😊

  • @reimarpb
    @reimarpb 5 ปีที่แล้ว +5

    Awesome! Btw I do like it when you start explaining classes and everything, even though I already know that and I'm here to learn about inheritance, but it does make it easier to understand

  • @RSkyCar
    @RSkyCar 5 ปีที่แล้ว

    Thank you Daniel! It was really useful stream, I learned a lot, so it's all makes sense now, how to write less code and organize a project. Hope you continue with Polymorphism in the next video.

  • @halimchu9346
    @halimchu9346 4 ปีที่แล้ว

    super duper helpful! Thank you!

  • @FernandoPonteFilho
    @FernandoPonteFilho 5 ปีที่แล้ว +2

    It's awesome to have english subtitles, thanks.

  • @7Chikchan
    @7Chikchan 5 ปีที่แล้ว

    Really appreciate your videos! Learned a lot from you

  • @bluestonecreeper720
    @bluestonecreeper720 5 ปีที่แล้ว

    Hi coding train. Take a look at the came screeps. Good vid

  • @zacharymcarthur9013
    @zacharymcarthur9013 4 ปีที่แล้ว

    I’m curious you said that a class can only inherit one other class, do you mean for example I couldn’t say “class Bat extends mammal, bird” to for example get the mammal class and as well pull flight from the bird class? I hope that makes sense. Thank you.

  • @marnix2452
    @marnix2452 5 ปีที่แล้ว +7

    It would be cool if you make an implementation of the strategy design pattern. It follows the design principle "favour composition over inheritence"

  • @forktrader7870
    @forktrader7870 5 ปีที่แล้ว

    do you really need different classes to work with? and is it really bad to have conditionals within the class? example I have BigDataGrid class, do I really need to create separate DataGrid for each report? it seems highly maintainable in the future but highly quite alot to type with. anyway, thanks for the idea.

  • @carlkitstie
    @carlkitstie 2 ปีที่แล้ว

    You are just amazing

  • @grahamhelton5395
    @grahamhelton5395 5 ปีที่แล้ว

    So to create the Tree, you would for example (in place of Particle class) have Animal class and then the (in place of Confetti class) have 'class Mammal extends Animal'? To do the tree would the next just be for example 'class Four legs extends Mammal' or 'class Four legs extends Animal'? Does the new class become the new super class?

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      You can do either! But "class FourLegs extends Mammal" would by definition also extend Animal, but not the other way around!

  • @imajt5
    @imajt5 5 ปีที่แล้ว

    Wow, you are awesome. Really great explanation.

  • @AhmadAlmutiry
    @AhmadAlmutiry 5 ปีที่แล้ว

    Thank you,
    May you explain what difference between abstraction and encapsulation?

  • @lubomiratanasov6714
    @lubomiratanasov6714 5 ปีที่แล้ว

    Hi,
    I would like to know, what is the difference between Class-Inheritance and Object-inheritance.
    Thank you.

  • @rdmammad5721
    @rdmammad5721 4 ปีที่แล้ว

    Perfect tutor ever😂

  • @kingundfaker
    @kingundfaker 4 ปีที่แล้ว +1

    Inheritance starts at 7:20

  • @idontwantmynameinhere
    @idontwantmynameinhere 5 ปีที่แล้ว

    Are you going to make videos on polymorphism and encapsulation? And if you already did, where can I find those videos?

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      Here's a video about the basic idea of OOP (encapsulation) - th-cam.com/video/T-HGdc8L-7w/w-d-xo.html - and the polymorphism video will come out later today or this weekend.

  • @russellge2372
    @russellge2372 4 ปีที่แล้ว

    Thank u so much, sir!

  • @bestformspielt
    @bestformspielt 5 ปีที่แล้ว

    Your hand drawn curly braces are outrageous! ;)

  • @liamrobertson2670
    @liamrobertson2670 5 ปีที่แล้ว

    You should go over getters and setters. Factory functions would be great too

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      Oh good idea! Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues

  • @frankkj1995
    @frankkj1995 3 ปีที่แล้ว

    Boint! Ha that made me chuckle :)

  • @grainfrizz
    @grainfrizz 5 ปีที่แล้ว

    C# does object oriented the best way possible (in my own opinion). Abstract, interface, struct...these are all super intuitive. But I understand that JS is interpreted lang and is not strongly typed. That's why it so short-handed.

    • @forktrader7870
      @forktrader7870 5 ปีที่แล้ว

      hello kababayan. 😂 JS is a gift and curse. they have simple class object capacity but it helps other professonals to create something that doesnt need to dig deeper the behind object-oriented programming and shoot their feet with diamond object problem etc. and no need VS download/setup on their system. anyways, thats your opinion. keep it up kababayan. ✌️

  • @xomayaaxo
    @xomayaaxo 5 ปีที่แล้ว

    dude you're awesome

  • @Thanveershah
    @Thanveershah 5 ปีที่แล้ว

    I challenge you to create an animated colorful smoke , You are amazing btw

  • @hussainsalih9736
    @hussainsalih9736 5 ปีที่แล้ว +1

    I want ask you how to read text file in javascript???

    • @0100-f1v
      @0100-f1v 5 ปีที่แล้ว

      use fs

  • @paraschavan014
    @paraschavan014 5 ปีที่แล้ว +1

    Wooo I am learning inheritance (Java)
    In my college

  • @ellpell6550
    @ellpell6550 ปีที่แล้ว

    Nice thanks

  • @tomgibbons2230
    @tomgibbons2230 5 ปีที่แล้ว

    Is Nodes implementation of JS different? This doesn't work for me - the super(x,y) is not a valid keyword. Regardless, great video. You're the man! :-)

  • @toxin0343
    @toxin0343 5 ปีที่แล้ว

    could you use the super keyword for the show function for example
    show(){
    super.show()
    fill(this.bright)
    square(this.x, this.y, this.r)
    }
    or would it cause errors or would it just draw it as a circle .
    edit: I will be trying this myself and will comment what happens but wanted to comment in-case I forget

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว +2

      Yes, you can do this! In the case above it'll draw both the circle and the square.

    • @toxin0343
      @toxin0343 5 ปีที่แล้ว

      @@TheCodingTrain and would they be at the same x and y position? Would the square be on top because it runs after the particle? Thanks for the quick response

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว +1

      @@toxin0343 Indeed they would be at the same x,y b/c each object only has that one x,y! It's the same as if you had called circle() directly in show().

    • @toxin0343
      @toxin0343 5 ปีที่แล้ว

      Thanks for the quick reply love the channel

  • @misdi_official
    @misdi_official 5 ปีที่แล้ว +2

    love it

  • @hailahong3021
    @hailahong3021 5 ปีที่แล้ว

    Man. That’s what I need

  • @alexblue8524
    @alexblue8524 5 ปีที่แล้ว +1

    I wanted the code from this video. does someone knows how can I get that ?

    • @eduardwille1711
      @eduardwille1711 5 ปีที่แล้ว

      Copy it by looking at what they typed ;)

  • @mertakbulut2541
    @mertakbulut2541 4 ปีที่แล้ว

    Thanks

  • @sydneyhill655
    @sydneyhill655 2 ปีที่แล้ว

    Thanks!

  • @OptimusPrimeagar
    @OptimusPrimeagar 4 ปีที่แล้ว +1

    Can you have more than one inheritance? For instance class Confetti extends particle extends circle ?

    • @kingundfaker
      @kingundfaker 4 ปีที่แล้ว

      He says this at the end. The answer: no , but you can have a child class of a child class.

  • @jochenpanjaer980
    @jochenpanjaer980 5 ปีที่แล้ว

    Where is the video about encapsulation in ES6?

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      I think I cover it in this one? th-cam.com/video/T-HGdc8L-7w/w-d-xo.html

  • @tntdogs6910
    @tntdogs6910 4 ปีที่แล้ว

    nice shirt man, where did u buy it?

  • @slyer7695
    @slyer7695 5 ปีที่แล้ว

    Love from Italy!!!! ❤️❤️❤️❤️ 🇮🇹 #LoveFromItaly8

  • @hussainsalih9736
    @hussainsalih9736 5 ปีที่แล้ว

    Thank you

  • @maheshkotal4214
    @maheshkotal4214 5 ปีที่แล้ว

    Hello sir, can you add index. Html page, I need to see the code

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      This workflow video series might help! where I go over all the pieces. th-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html

  • @palinejs
    @palinejs 5 ปีที่แล้ว

    Great!

  • @kikawet
    @kikawet 5 ปีที่แล้ว

    What IDE are you using?

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      VSCode, more here: th-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html

  • @jeranto24
    @jeranto24 5 ปีที่แล้ว

    SENSEIIII!!

  • @danushkaanurada6936
    @danushkaanurada6936 5 ปีที่แล้ว

    What is that editor name..

    • @TheCodingTrain
      @TheCodingTrain 5 ปีที่แล้ว

      VSCode! For more: th-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html

  • @horseoperamarker
    @horseoperamarker 3 ปีที่แล้ว

    yes

  • @adamnejm
    @adamnejm 5 ปีที่แล้ว

    If you need a nice example here you go. Change classes using SPACE, hold Mouse1 to draw:
    let interval = 0, id = 0, objects = [], classes = [];
    function setup()
    {
    createCanvas(500, 500);
    //frameRate(60);
    }
    function draw()
    {
    background(255);
    objects.forEach(p => {
    p.update();
    p.render();
    });
    if(mouseIsPressed)
    if(!(++interval % 5))
    objects.unshift(new classes[id%3](mouseX, mouseY, 20));
    }
    function keyPressed()
    {
    if(keyCode == 32) id++;
    }
    class Particle
    {
    constructor(x, y, r)
    {
    this.x = x;
    this.y = y;
    this.r = r;
    }
    update()
    {
    this.x += random(-2, 2);
    this.y += random(-2, 2);
    }
    render()
    {
    ellipse(this.x, this.y, this.r);
    }
    }
    classes[0] =
    class Square extends Particle
    {
    constructor(x, y, r)
    {
    super(x, y, r);
    this.t = millis();
    }
    render(){
    let s = sin((millis() - this.t)/100)*10
    rect(this.x, this.y, this.r + s, this.r + s);
    }
    }
    classes[1] =
    class Circle extends Particle
    {
    update()
    {
    super.update();
    this.r = sin(millis()/500) * 10
    }
    render(){
    ellipse(this.x, this.y, this.r);
    }
    }
    classes[2] =
    class Line extends Particle
    {
    update(){
    this.x += 1;
    }
    render(){
    line(this.x, this.y, this.x + this.r, this.y);
    }
    }

  • @bestformspielt
    @bestformspielt 5 ปีที่แล้ว +2

    composition over inheritance! just saying. :)

  • @mrlectus
    @mrlectus 5 ปีที่แล้ว

    i wish i could type fast like you do

  • @mvmo4744
    @mvmo4744 5 ปีที่แล้ว

    Somehow classes in JavaScript feel wrong to me :(

  • @lthoedt
    @lthoedt 5 ปีที่แล้ว +1

    i have to do it FIRST

  • @toastyPredicament
    @toastyPredicament 2 ปีที่แล้ว

    Pls be ok

  • @poornamith
    @poornamith 5 ปีที่แล้ว

    VS Code

  • @wanafnanhariz7650
    @wanafnanhariz7650 4 ปีที่แล้ว

    i really like your videos, i do, but the theme(rainbow, unicorn and stuff) ,is not that i dont like them, its just remind me of weed...and make me wonder why u use that theme... XD

  • @sifatmoonjerin2479
    @sifatmoonjerin2479 4 ปีที่แล้ว

    I miss my Bubble... :(

  • @toastyPredicament
    @toastyPredicament 2 ปีที่แล้ว

    Oh Dan

  • @toastyPredicament
    @toastyPredicament 2 ปีที่แล้ว

    Sleepy pill for dream please

  • @robotosailr2129
    @robotosailr2129 4 ปีที่แล้ว

    now understand es6 better

  • @lee_sung_studio
    @lee_sung_studio ปีที่แล้ว

    14:28

  • @ultimade9610
    @ultimade9610 5 ปีที่แล้ว

    Third

  • @hi-techlogics3831
    @hi-techlogics3831 3 ปีที่แล้ว

    Love from Pakistan

  • @brucelee7782
    @brucelee7782 4 ปีที่แล้ว

    javascript is copying so much from java, might as well use java and not use javascript anymore.

  • @toastyPredicament
    @toastyPredicament 2 ปีที่แล้ว

    Excuse me I'll smoke a cigarette