Cristal clear explanation! I will definitely be watching your other videos on ES6 classes. Once I saw your video I suddenly felt the concept of ES6 OOP is simple and I could clearly see how it mimics the way things work in languages like C++ and Java also in polymorphism. Still, there are very few tutorials mentioning how it works as explicitly and in detail, and I always had doubts. Thank you so much! I can really feel that you care about us understanding, and that makes the whole difference! By the way, your code is super clean! I really like your style of coding, and I will make a point of learning from it.
1:35 That was a great way to correct your mistake haha, I was wondering how you would fix that mistake during the livestream. Btw this video was interesting to watch!!! I like the way you teach, and explain things. I wish I was your student hehe.
Dan, you are such a wonderful teacher. I love watching coding train videos and learning so much from you. Keep up your fantastic work and your nice spirit. The coding train is by far the best channel on youtube! :)
*Type Systems* In languages such as Java, a variable must be *explicitly* given a type, e.g. _int num = 42;_ in other languages, such as Python, the type is *implicitly* determined using type inference, e.g. _num = 42_ ( _num_ has type _int_ ). With *static* typing, the type of a variable is already known at compile time. In the Java example above, the compiler already knows that num has the type _int_ . In a *dynamically* typed language, on the other hand, type checks only happen at runtime. If a language treats types strictly it is *strongly* typed as opposed to *weakly* typed. A relevant characteristic is whether data types are implicitly converted. In JavaScript, for example, the comparison _2=="2"_ gives _true_ ( *weak* ), while _2==="2"_ gives _false_ ( *strong* ). In the first case, the types are converted accordingly. EDIT: *See also GetrundeltHD's comment*
no one cares about type casting. he runs loose. if you prefer the C++ environment, declare yourself. it's a common comment, and super annoying, strict, ridiculous, etc. the whole thing he built avoids this banality of this classist syntax, some things to consider when you make your own speech. you can build you own programs bro!
also. use python since you like it so much pretty simple syntax huh? i use python to control rasp pi. sort of a crap language to processing but hey, get strict.
Compilers C: Compiled to machine code beforehand, and then run. Python / JavaScript: Interpreted as it's run, and executed that way. Java: Very confusing. It's compiled down beforehand, but not to machine code. But to an intermediate language called ByteScript. Then, that ByteScript code is interpreted and executed.
I think you've made a mistake with your explanation of strongly typed. Strongly typed does not mean that the type of a variable has to stay the same during the programs execution. This behaviour refers to statically typed and in fact Java is statically typed so you can't change a variables type but in Python you can so Python isn't statically typed. Strongly typed means you can't treat the same location in memory as the same type. In Python you can't do that you have to convert variables so that you can treat them as a different type because you have no direct memory access via pointers. Same holds for Java. In C you have pointers and you can cast e.g. a string pointer to an int pointer. That means you can treat the same location in memory as 2 different types and therefore C is weakly typed.
Ah, thank you for this. Excellent clarification and explanation! I wish I could pin two comments! If you'd like to write this up somewhere I could link to it from the description? Or perhaps I should make a follow-up video to go through all these terms: * strongly vs weakly * static vs dynamic * explicit vs implicit
Just wanted to mention that polymorphism can also refer to polymorphic functions/methods which is something implemented in javascript as far as i know.
Question: on Java, if wanted to use polymorphism, would I need to declare two methods with the Override statement? I noticed that on JavaScript you haven't to implement two methods, you used exactly the same.
Hi! i'm making a litlle game in processing...But i got a problem that is i dont know how to set the coordinates to be the same on every monitor type using fullscreen...like in a 1920x1080 the coordinates are different from a 1600 x 900. Can anyone help?
If you're doing UI, think of the UI elements as being "attached" to a side of the screen. For example, if you want an ammo indicator in the bottom right, draw it at {x: screen.width - ammo.width, y: screen.height - ammo.height} so instead of being relative to the top left(0,0) it's now relative to the bottom right(width,height) You can also treat your screen coordinates as being between 0 and 1 and then multiplying them by width and height but then you have to deal with scaling and it's honestly a huge hastle.
Hi i was watching your p5 series on 3:3 you show how to do key pressed and I was wondering how I get that to to work on a specific key. Help from anyone would appreciated 😃
if (key == 'a') is for the a key. For more, would you mind asking at discourse.processing.org/! It's a better platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
Is that a double upload? I need to start learning to keep up Well, really I still haven't really learned to make a simple game, just some moving shapes, but still...
@@TheCodingTrain Yeah that's true. I also have a question. Which would you recommend for a beginner, p5js or processing 3? I have learned a little in p5js but it's not a problem to instead learn java and use processing 3. I've heard sometimes that java is a great beginner language, especially if you want to learn something like C# and the fact that processing 3 has it's own program rather than needing one for writing code. Javascript has been pretty simple for me and easy to learn especially with your channel and the p5js reference library. Edit: Too late I've switched you can't stop me now
polymorphism in javascript seems kinda useless oO ? i mean you could jsut push any object into the array that has a show and update function and it would still work its not like javascripthas such a thing as typed arrays
I wish you had a podcast. I'd listen to it all day :))
Yes please!
Cristal clear explanation! I will definitely be watching your other videos on ES6 classes. Once I saw your video I suddenly felt the concept of ES6 OOP is simple and I could clearly see how it mimics the way things work in languages like C++ and Java also in polymorphism. Still, there are very few tutorials mentioning how it works as explicitly and in detail, and I always had doubts. Thank you so much!
I can really feel that you care about us understanding, and that makes the whole difference! By the way, your code is super clean! I really like your style of coding, and I will make a point of learning from it.
Never seen anyone more excited about OOP. I feel excited now.
Use TypeScript if you want to be more excited :)
😂
1:35 That was a great way to correct your mistake haha, I was wondering how you would fix that mistake during the livestream. Btw this video was interesting to watch!!! I like the way you teach, and explain things. I wish I was your student hehe.
you are
Dan, you are such a wonderful teacher. I love watching coding train videos and learning so much from you. Keep up your fantastic work and your nice spirit. The coding train is by far the best channel on youtube! :)
*Type Systems*
In languages such as Java, a variable must be *explicitly* given a type, e.g. _int num = 42;_ in other languages, such as Python, the type is *implicitly* determined using type inference, e.g. _num = 42_ ( _num_ has type _int_ ).
With *static* typing, the type of a variable is already known at compile time. In the Java example above, the compiler already knows that num has the type _int_ . In a *dynamically* typed language, on the other hand, type checks only happen at runtime.
If a language treats types strictly it is *strongly* typed as opposed to *weakly* typed. A relevant characteristic is whether data types are implicitly converted. In JavaScript, for example, the comparison _2=="2"_ gives _true_ ( *weak* ), while _2==="2"_ gives _false_ ( *strong* ). In the first case, the types are converted accordingly.
EDIT: *See also GetrundeltHD's comment*
no one cares about type casting. he runs loose. if you prefer the C++ environment, declare yourself. it's a common comment, and super annoying, strict, ridiculous, etc. the whole thing he built avoids this banality of this classist syntax, some things to consider when you make your own speech. you can build you own programs bro!
also. use python since you like it so much pretty simple syntax huh? i use python to control rasp pi. sort of a crap language to processing but hey, get strict.
leave it to Daniel to simple explain concepts like this that have evaded my grasp for years
excellent work. I come from a Java background and your explanation cleared me from many misconceptions. Thank you So MUCH
mind = blown! What a cool idea to inherit the vector class this way!
Thank you man now with all your tutorials I can code
You are making my day very creative
Thanks alot
Compilers
C: Compiled to machine code beforehand, and then run.
Python / JavaScript: Interpreted as it's run, and executed that way.
Java: Very confusing. It's compiled down beforehand, but not to machine code. But to an intermediate language called ByteScript. Then, that ByteScript code is interpreted and executed.
Just amazing how you explain things...You're great ;-)
I love your es6 videos
The way thatt you corected yourself with that clip was pretty wow i mean WOW :)
I think you've made a mistake with your explanation of strongly typed. Strongly typed does not mean that the type of a variable has to stay the same during the programs execution. This behaviour refers to statically typed and in fact Java is statically typed so you can't change a variables type but in Python you can so Python isn't statically typed. Strongly typed means you can't treat the same location in memory as the same type. In Python you can't do that you have to convert variables so that you can treat them as a different type because you have no direct memory access via pointers. Same holds for Java. In C you have pointers and you can cast e.g. a string pointer to an int pointer. That means you can treat the same location in memory as 2 different types and therefore C is weakly typed.
+1 underrated comment
Ah, thank you for this. Excellent clarification and explanation! I wish I could pin two comments! If you'd like to write this up somewhere I could link to it from the description? Or perhaps I should make a follow-up video to go through all these terms:
* strongly vs weakly
* static vs dynamic
* explicit vs implicit
Awesome video. Thanks Daniel!
Thank you shiffman your the best
Super understandable. Thank you a lot!
This is gold!
Please make in depth course on JavaScript
crystal clear ! give that to my stud
Why you dont explaining about your last video codes. You are showing them but i dont know what do some methods of your code of last video.
i can't seem to find a way to make encapsulation in ES6 using the class keyword !
More JS OOP Stuff please Sensei
I love you, thank you for explaining this
wow, if you thought these videos were incredible the first time. try a second time some time later.
Great video Dan!!
Just wanted to mention that polymorphism can also refer to polymorphic functions/methods which is something implemented in javascript as far as i know.
Oh, thank you!
@@TheCodingTrain oh just realized after seeing you reply that i have a typo there.. Should be "... something NOT implemented..."
Everything extends Object. #life
Yes, you can also say:
class blahblahblah extends null {}
doing so, clears the object's prototype
except death
Question: on Java, if wanted to use polymorphism, would I need to declare two methods with the Override statement? I noticed that on JavaScript you haven't to implement two methods, you used exactly the same.
Watch the processing videos on polymorphism
Love from Italy!!!! ❤️❤️❤️❤️ 🇮🇹 #LoveFromItaly9
🔥
Very useful video
The guy is amazing! =)
i can feel my brain got bigger 👌👌
i can feel your brain getting bigger too (?)
Hi!
i'm making a litlle game in processing...But i got a problem that is i dont know how to set the coordinates to be the same on every monitor type using fullscreen...like in a 1920x1080 the coordinates are different from a 1600 x 900.
Can anyone help?
If you're doing UI, think of the UI elements as being "attached" to a side of the screen. For example, if you want an ammo indicator in the bottom right, draw it at {x: screen.width - ammo.width, y: screen.height - ammo.height} so instead of being relative to the top left(0,0) it's now relative to the bottom right(width,height)
You can also treat your screen coordinates as being between 0 and 1 and then multiplying them by width and height but then you have to deal with scaling and it's honestly a huge hastle.
Not sure why, but him jumping into the screen w him in the background kinda freaked me out.
At around 7:00 when you wrote
this.vel = p5.Vector.random2D();
Couldn’t you have said
this.vel = super.random2D();
instead?
Great question! random2D() is actually a "static" function so is called by the class name itself.
Hey, could you make a new Vector tutorial for p5?
Thanks!
Watch the processing videos theyre just about the same just the syntax is a bit different
Function isAppreciated(you,byme) { return true; }
Hi i was watching your p5 series on 3:3 you show how to do key pressed and I was wondering how I get that to to work on a specific key. Help from anyone would appreciated 😃
if (key == 'a') is for the a key. For more, would you mind asking at discourse.processing.org/! It's a better platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
The Coding Train ok thank you
Ya I made an qbit thing but it's not stable because I'm at room temperature but it's a physical qbit
AMAZING VIDEOES
Is that a double upload? I need to start learning to keep up
Well, really I still haven't really learned to make a simple game, just some moving shapes, but still...
Save this for later, you don't need it now if you are just starting out!
@@TheCodingTrain Yeah that's true. I also have a question. Which would you recommend for a beginner, p5js or processing 3?
I have learned a little in p5js but it's not a problem to instead learn java and use processing 3.
I've heard sometimes that java is a great beginner language, especially if you want to learn something like C# and the fact that processing 3 has it's own program rather than needing one for writing code. Javascript has been pretty simple for me and easy to learn especially with your channel and the p5js reference library.
Edit: Too late I've switched you can't stop me now
I'd also like to say that your tutorials are great for beginners and being able to talk with you, ask you questions makes your channel a lot better.
Accidentally liked, but it's ok xD
i enjoy your videos more than the stupid dumb videos i watched before i discovered your channel, that is impressive
polymorphism in javascript seems kinda useless oO ? i mean you could jsut push any object into the array that has a show and update function and it would still work its not like javascripthas such a thing as typed arrays
Publish in 2:1 please?
Pls be ok
I noticed that you had a longer neck and rounder face in the other video -- both cute, don't get me wrong. That's right, I got side-tracked.
first
Nice, I hope you enjoy it.
can u adopt me ?
I want to be a good girl