All I did was search for Javascript constructor, instead KZbin gave me the best coding teacher.
@CreapFreek4 жыл бұрын
No shit. This guy is amazing.
@zachjones73373 жыл бұрын
@Thiago Heath 15 minutes to hack someone's account? Those are rookie numbers. I'd report your comment for being an utter failure, but since that option doesn't exist, I'll just have to settle for spam. Also lol @ "I will try it out right now, seems to be working." If you haven't tried it out yet, then you don't know if it's working or not. Also pretty interesting how a comment that I made 2 years ago is getting 2 "different" people talking to each other within a 15 minute timespan. Also reported.
@rohannaam63293 жыл бұрын
yes man. best teacher
@mabehal-zuqyadeek85938 жыл бұрын
Wow, you are an amazing teacher. Very fun, high energy and mastery of the subject.
@TheCodingTrain8 жыл бұрын
thanks for watching!
@zayanwatchel87807 жыл бұрын
Mabeh Al-Zuq Yadeek and REALLY ADHD
@zayanwatchel87807 жыл бұрын
Mabeh Al-Zuq Yadeek sorry I know that was a mean joke :D
@AiTech0144 жыл бұрын
From Javascript constructor Google search to the best teacher you could ever get. This was fun. Thank you.
@maxcherkasskikh59604 жыл бұрын
Seriously... U did an amazing job at explaining this. It is an incredibly difficult concept to grasp if ur just searching around for the answer aimlessly and having to sort through a million different results. But u said something that set off a lightbulb in my mind and made it make more sense. They way I see it now is that a literal object is kind of like a "hard coded" object that gets used once. The way I see the constructor function is that it's a template that can be reused. One is a "use once" scenario. And the other one is a "multi use" scenario where u can plug stuff in. I could never understand why anyone would put a constructor function inside classes and now this clarified it a lot more than anyone was able to do for me before. So thank u!
@shawnsouthwell56328 жыл бұрын
You are an excellent teacher. Thanks for all of your videos!
@TheCodingTrain8 жыл бұрын
+Shawn Southwell Thanks for the nice feedback!
@marialilokyee29493 жыл бұрын
You are an amazing teacher! You have the magical power to make coding energetic, fun and easy to understand. I particularly love how you use concept diagram/ drawing to explain the javascript concept instead of just simply typing the code. Thank you so much!
@andideveloper83456 жыл бұрын
evey tutorial you make is full with energy and passion.its nice to see a person who are explain things with love.Nice Job!
@maybit90917 жыл бұрын
I decided to use the idea from the purple rain video to make a rain program with objects and arrays. Right now, it's a really basic program, but it works and I'm making it more complex and better organized the more I watch these videos. The videos help a ton, I hope I have a professor like this next year lol
@TheCodingTrain7 жыл бұрын
Glad to hear, thank you!
@williambillemeyling56478 жыл бұрын
Awesome so good!!! I watched all the tutorials for p5.js since I am working on a game and every time I needed something you had the answer in the next video! Thanks so much. Very inspiring and keep up! :)
@elementallobsterx7 жыл бұрын
Daniel Shiffman. You are a great teacher and a awesome programmer. I love this new coding train thing you are doing. It's teaching lots of people to achieve what they want with their coding. I've seen you come so far. Peace.✌️
@rajaaekant4 жыл бұрын
I am having so much trouble with concepts of this language and finally I'm seeing hope. Thank you so much for these amazing free lectures. You are doing a lot for everyone.
@kostyalucker21397 жыл бұрын
i am from Russia and my English not to strong, but that man teach better than more peoples. Thanks. I go to subscribe!
@CarlosAyalaTheJukeBoxHero9 жыл бұрын
Thanks man! really Thank you!! I was struggling to understand function and create new object part of javascript. Liked and subscribed, i needed it for something completely different but now i get it thanks to you! BIG HUG!!
@TheCodingTrain9 жыл бұрын
+Carlos Ayala so glad to hear it! Motivates me to make more videos.
@nerosy79833 жыл бұрын
2021 and it istill is the best video i've ever seen so far explaning coding this way .
@csrfoo8 жыл бұрын
This helped me FINALLY understand constructor functions. I used to dread that word so much and fub my way thru but I GEDDIT NOW. I CANT THANK U ENOUGH DANIEL! 🙏🏻👏🏻
@TheCodingTrain8 жыл бұрын
I'm so glad to hear this, thank you thank you!
@bsummer2 жыл бұрын
Many a times I do not understand a subject/concept at its first watch or glance but researching here and there, i come back to where i first sought that knowledge. This seems amazing but I'm a bit lost, however I will be back to comment again.
@josharpe7 жыл бұрын
I'm only 13 and want to program when i'm older and out of any tutorials this one is the best. Dan Shiffman is so awesome and can't wait to see more videos in the future!
@CameronChardukian6 жыл бұрын
Keep going. My biggest regret is I gave up programming at 13 and am only now learning it at age 21/22. If you keep at it, you'll be amazing at programming, making tons of $$$, and living a dream life by the time you're my age.
@diastrus12366 жыл бұрын
This was direct and to the point, easy to follow, and informative. Great job!
@tanish2204-p9o5 жыл бұрын
You really are an amazing teacher. If possible, please try making an in depth paid course on any online platform particularly on udemy on Node.js and MongoDB. Your teaching style will make us understand tricky stuff with ease. Thank you.
@NickCarboneDrum4 жыл бұрын
YOU ARE THE BEST INSTRUCTOR ON THE INTERNET!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@goldthumb2 жыл бұрын
"constructor" without mentioning a word about "class", that's new to me. I love it.
@geoffwagner4935 Жыл бұрын
constructors are in more than just a classes, constructors are in everything such as an ellipse(constructor, constructor, constructor, constructor). it's constructors are it's values. it would be silly to just state it as a class reference.
@EmilianoCarrillo7 жыл бұрын
AWESOME TEACHER, AWESOME "COURSE". I watch it in 2x and you look too funny, like a crazy code wizard haha. Keep it up!
@AdityaArya937 жыл бұрын
You are an amazing teacher. Your gestures and way teaching is very similar to one of my fav. teacher, Gaurang Sir, he is a physics teacher.
@the-web-scraping-guy7 жыл бұрын
Dude these videos are great. Anytime I need to look up something about js, I always go to your videos. Thanks for making these.
@stevenreinart97194 жыл бұрын
you're a great teacher! I always look for your videos first because of how well you explain everything! Thank you for the knowledge! you're amazing and keep up the videos!
@TimeTourst7 жыл бұрын
Great energy, very straight forward teaching style. I like how you move back and forth between the white board and the real code. Could use a bit of editing though. ThumbsUp!
@geoffwagner4935 Жыл бұрын
this is an amazing video, these are all absolutely amazing works of art each time, a second at a time. it's like 30min in 10 min xD BUT, lol i came here for what function.length was, and this got me where i needed. but i you redo it, may want to mention anything.length is to use "length" as is the maximum value of the string or number value of the function. i really hope i got that before i said that xD
@semacame8 жыл бұрын
Hello thanks. you are a very good teacher. I never get bored. with you. I learn and have fun.
@TheCodingTrain8 жыл бұрын
+sergio menegassi thank you so much!
@ousmaneyadely5 жыл бұрын
My Gosh! You're great teacher. That summary in min 10.10 was genius
@rohannaam63293 жыл бұрын
one of the best teacher i know
@s.k.78344 жыл бұрын
Amazing explanation thank you for making this area more comprehendible!
@edbrooks13148 жыл бұрын
Very clear, no need to redo this video. Extremely helpful!
@TheCodingTrain8 жыл бұрын
thank you!
@victorialeigh27264 жыл бұрын
You are amazing!! The best constructor instructor!!
@TheCodingTrain4 жыл бұрын
You’re a poet and you didn’t know it! Or did you?
@victorialeigh27264 жыл бұрын
@@TheCodingTrain You've got a very fine-tune sense to catch that! I think I am, but people seldom recognise it, and on top of that, amongst the handful only few have the soul to say it :D !!!
@victorialeigh27264 жыл бұрын
@@TheCodingTrain And you are a dancer and you didn't know it! Or did you? (referring to your dancing in the purple rain)
@marianaperez31247 жыл бұрын
You helped me understand constructors more! Thank you!!
@TheCodingTrain7 жыл бұрын
Glad to hear, thanks for watching!
@HeroesOfAesthetics4 жыл бұрын
Amazing video!! Just what I needed
@uhN0id8 жыл бұрын
Thank you for this video! I understood the constructor's purpose but didn't fully understand a constructor and its use. I appreciate it! Sub'd!
@Hydr3128 жыл бұрын
sorry Daniel Shiffman... but i must say... you teach damn good. love your videos!
@shubhamkothari27095 жыл бұрын
After going through do many sources finally found the best one. Thank you for your knowledge & time ♥ It was very helpful.
@LGLPBiH7 жыл бұрын
Thanks Dan a lot for this p5.js videos. You are Best teacher I ever seen. Im from your The Constructor Function made Star Wars ships flying; var ships = []; var timer = 0; var x = 0; function setup() { createCanvas(400, 400); for (var i = 0; i < 100; i++) { ships[i] = new Ship(); } } function draw() { background(0); timer += 1; if(timer > 200) { timer = 0; x += 5; }else{ for (var i = 0; i < 5 + x; i++) { ships[i].display(); ships[i].move(); } } } function Ship() { this.x = random(0, width); this.y = 450; this.s = random(0, 15); this.speed = random(0, 3); this.display = function() { rectMode(CENTER); strokeWeight(3); fill(170); rect(this.x, this.y, 50 + this.s, 25 - this.s); rect(this.x, this.y, 25 - this.s, 100 - this.s); rect(this.x - 30, this.y, 20 - this.s, 50 - this.s); rect(this.x + 30, this.y, 20 - this.s, 50 - this.s); } this.move = function() { this.y -= 1 + this.speed; } } btw. im 12 years old, sorry for grammar.
@sohail24x79 жыл бұрын
Great tut Daniel, thanks so much!, honestly one of the best Constructor function tut I've come across. LIKED AND SUBSCRIBED!
@TheCodingTrain9 жыл бұрын
+Sohail Momin Thanks for the nice feedback!
@amanyelseheily5 жыл бұрын
i really thank u r an amazing teacher, you make it so simple to me
@danielorlandopena75518 жыл бұрын
Cool videos!! I have been learning a lot, Greetings from Colombia
@limitless16924 жыл бұрын
Wow pretty good explication of Constructor Thanks :)
@niveshproag86608 жыл бұрын
Subscribed. Was struggling with this and you made it so simple I feel like an idiot for not getting it before.
@TheCodingTrain8 жыл бұрын
+Nivesh Proag so glad to hear, thank you!
@markstockdale7 жыл бұрын
Love your videos! You are a fantastic teacher! Thank you for all you do!
@TheCodingTrain7 жыл бұрын
Thanks for the nice feedback!
@sabrin39817 жыл бұрын
Your videos are so awesome, I learn so much and am entertained ...lol
@adlerpazhouhan7416 Жыл бұрын
Thank you soooooooooo much for all the content you are an amazing professor :)
@stevenreinart97194 жыл бұрын
p.s. if you could throw a previous video link in the description that would be awesome!
@maxtanie127 жыл бұрын
This guy is just amazing!!! an Amazing developper!
@waiyip44278 жыл бұрын
Big thanks ! You explained it so good , liked and subscribed! Btw, will you make videos about php programming in the future? Because it is so confusing to me XD
@TheCodingTrain8 жыл бұрын
I'm not planning on php but am planning on more node.js videos.
@truumann1998 жыл бұрын
you are doing a very okay job. Thank you.
@TheCodingTrain8 жыл бұрын
+Truu Mann appreciate it, thank you!
@user_163095 жыл бұрын
Thanks, Dan. This helped a bit.
@blockchaincesar76016 жыл бұрын
You're a great marketer.
@anujlahoty80226 жыл бұрын
It is the most amazing and super simplifies video i can ever get.
@TheInspirationNest954 жыл бұрын
Hello sir, I love your method of teaching and its clicking in mind easily.I want that you teach me javascript.
@scoop98874 жыл бұрын
awesome Teacher... What's the editor you use ?!
@pravinkolambkar35952 жыл бұрын
You are simply great
@josejuliopl21408 жыл бұрын
So a constructor function in P5 it's like a class in java, isn't it?
@oo0O088 жыл бұрын
Yeah its seems that its not just the constructor as it would be in Java or C++, its the whole object. Pretty confusing.
@hammer1588 жыл бұрын
It's just a syntactic sugar for hiding the "return this" line.
@ismaelcebrianmarco72887 жыл бұрын
Yes, the role of a constructor in javascript is similar to the rol of a class in java. This is a general javascript topic, not particular to P5.
@eboubaker37226 жыл бұрын
!java==javascript
@synthopia25 жыл бұрын
Great explanation, thank you very much!
@md.mohiulislam65162 жыл бұрын
best explanation.
@gregorydixon5698 жыл бұрын
Quick question do you have a video on object interactions?
When I create a function "move" in my object bubbles and then try to use it in draw it says move is not a function, any help?
@natarrlie8 жыл бұрын
did you use the bubble.move? I think that's the problem but i don't know because i'm new to this too.
@pauliussulcas7 жыл бұрын
Man you Rock! Superb tutorial... Keep up the good work :)
@TheCodingTrain7 жыл бұрын
Thank you!
@natarrlie8 жыл бұрын
when i use the "this.display": this.display = function(){ rect(this.x,this.y,10,10) }; nothing happens. I am very confused, help.
@cea_tide4176 жыл бұрын
If you want to call a function: this.display()
@abdussamad93996 жыл бұрын
Very very helpful. Thanks
@jefferybaggins27866 жыл бұрын
is this constructor function the same as the class function he went through in another vid?
@TheCodingTrain6 жыл бұрын
Ah, great question! It has the same result but classes are now the preferred (or at least my preferred) way of doing it with JavaScript ES6. This video is 1-2 years older than the classes one.
@jefferybaggins27866 жыл бұрын
@@TheCodingTrain Thank you for explaining that I was quite confused. I have been binge watching this during the weekend and after school so I wasn't very sure on the time frame.
@aarshshah4847 жыл бұрын
are you using brackets or p5 editor or processing
@TheCodingTrain7 жыл бұрын
This video is using the p5 editor, however, I would recommend brackets at the moment until the new p5 web editor is released.
@aarshshah4847 жыл бұрын
so how do you make a new tab in brackets.can I do this all in processing
@tasneemalam13592 жыл бұрын
thank you for making video ...
@deepafricalimited74696 жыл бұрын
THANK YOU SO MUCH.
@abhikan76544 жыл бұрын
Great Video!
@kikesitosk8xoxtla7 жыл бұрын
So, can we say that " var vm = {};" and "vm.Summary = function( ) { } " Summary is a function constructor? what I want to do is to create within a object more reusable objects (contrsuctors), I am not sure if I am right, what do you think?
@its_me_izy64364 жыл бұрын
do we need to download a specific constructor function to use it
@kocaksaid7 жыл бұрын
arguments and parameters should also work with this constructor, right ? like in the processing creating class?
@SamChaneyProductions6 жыл бұрын
This is a great video but I have a question. How do you know that the 'this' keyword at ''this.x, this.y' which are arguments in ellipse inside the this.display method in your constructor are going to use the context of the Bubble object constructor and and not some other context (like the global context)? I am having an issue in my javascript program (making it in Google Application Scripts) where when I use the 'this' keyword inside of a function that is inside one of my constructor's methods, it points to the wrong context (I expect 'this' to still be the object constructor but it is instead using the global context). How do I fix this issue? I've tried using call() and bind() but to no avail. Currently I just started defining properties in my constructor as IIFE functions where I pass this.property as arguments but this seems like a bad workaround. Thanks!
@emilymalecbrown75518 жыл бұрын
Did you mean to put semicolons after the key value pairs in the constructor function? Is that another syntactic difference?
@TheCodingTrain8 жыл бұрын
semi-colons in javascript can be optional, but i like to use them for clarity.
@emilymalecbrown75518 жыл бұрын
+Daniel Shiffman but if you use them in basic object construction they throw an error (unlike using ",")
@TheCodingTrain8 жыл бұрын
Oh yes you are right! Literal objects have a different syntax. It's all quite confusing: kzbin.info/www/bejne/Y5aYmWd_fLCNiLs
@bloom68746 жыл бұрын
which IDE you have used here in this video to run js code?
@TheCodingTrain6 жыл бұрын
I am using an old deprecated IDE, this is my current workflow: kzbin.info/www/bejne/fouXdWatebeUm8U
@bloom68746 жыл бұрын
Thanks. I got it. :)
@MuhammadTajammulZia4 жыл бұрын
What is the difference between a class with constructor function and this function you made?
@codingnoob59467 жыл бұрын
well shit, Subbed...going to have to add your videos to my studys. Currently use Sololearn and freeCodecamp...ill watch your vids while i workout or tired of my phone lol.. You are a very good teacher.
@sailorwinkelman81397 жыл бұрын
Hello! We found this because we are making an Angular2 application and want to use the p5js library. We need instance mode to be able to use the library inside our components. Thanks! 🎨
@amberweeks82624 жыл бұрын
Thank you so much!
@TheJordon1258 жыл бұрын
5:21-5:22
@TheJordon1258 жыл бұрын
5:22
@thisguymartin8 жыл бұрын
Great man!! Thank you!
@TheCodingTrain8 жыл бұрын
+Martin Patino thanks for watching!
@thisguymartin8 жыл бұрын
Serious your explanation was much clearer then pluaralsights course
@TheCodingTrain8 жыл бұрын
+Martin Patino so glad to hear!
@rbjassoc67 жыл бұрын
You should have mentioned the fact that when you go from an object syntax to a constructor syntax the ":" (colon) needs to be changed to an "=" sign and the "commas" ending all information in the object needs to be changed to a ";" semicolon
@S197Bryan3 жыл бұрын
can we use factory functions rather than constructor in p5.js?
@TheTomorrowMakers3 жыл бұрын
is p5.js the same as just javascript? i have been watching coding train for years but am just now getting into learning to code. would watching these videos be applicable? or only if i was focused on p5.js?
@zachjones73376 жыл бұрын
I just thought of something. Would it be better performance-wise to create a global function for the constructor's display property, and have the property's function pass its parameters through the global function, so you're not defining a new set of routines for each new object? (though I seem to remember in the past I'd pass certain parameters through another function within a loop, and they'd all get overwritten to the last one)
@SlahsVurdonski8 жыл бұрын
Did you upload the code for this video somewhere?
@ritual_guava59278 жыл бұрын
They are all here: github.com/CodingTrain/Rainbow-Code/tree/master/p5.js
@RC-bg3wy8 жыл бұрын
Thanks for this vid!!
@randmorf5 жыл бұрын
This appears to be a pre-"ES6" syntax for creating an object class & constructor, am I right?
@randmorf5 жыл бұрын
As an example of what I mean by "ES6" class/constructor syntax, look at my version of this program that uses the ES6 method of declaring constructors within classes along with member data and member functions (methods): Present: editor.p5js.org/randmor/present/MF9V4sJ25 View/Edit Source: editor.p5js.org/randmor/sketches/MF9V4sJ25
@reham84715 жыл бұрын
Thanks
@AHRienks6 жыл бұрын
I try to follow this series in sequence, but it is confusing, to say the least. A few lessons ago you introduced classes and es6. Now you back using somewhat older concepts. Okay; it might be good to see that there are multiple ways 'how to skin the cat' ;-)
@bantinggamer49626 жыл бұрын
ahhhhhhhhhhhhhhhhhhh. thanks for explaining it to me so well! now i get it.
@herrjose4 жыл бұрын
I've never understud coding, now i do, well sort of but thanks thought!
@Randreas_6 жыл бұрын
Can you show an object from the constructor function, without making an array? something like with classes, where if you just want one, you could just say var car; car = new Car(); the thing I'm doing right now, is making an array, of just one object, but it's pretty confusing, and I feel like it's more work than it needs to be. thanks
@adriadi49868 жыл бұрын
the program that i used to write the code? what is its name? can anyone tell me more about it?
@ulaptoptrekker8 жыл бұрын
adri adi javascript. with the p5js library. from p5js.org. it adds functions to javascript. sorta shortcuts
@fakefarm8 жыл бұрын
Great video! Thank you for making it. I found you by searching for techniques how to test Constructors using Jasmine. I haven't been able to find any posts/videos that effectively teach TDD dealing with DOM Manipulation or AJAX using Constructors. Anyone have a suggestion? Thanks!
@techtravel47564 жыл бұрын
LOve this channel
@VasuVanka8 жыл бұрын
nice video Daniel .. it helps well to understand JS. Why can't you show your twitter handler in the video.if anybody stuck they will just tweet.its easy to reach you.i think it will help many.
@eboubaker37226 жыл бұрын
7:10 so you can see now ... camera goes off lol
@obreaker89935 жыл бұрын
Am i the only one that literally was up from 2am - 7am watching these?