5.2: Function Parameters and Arguments - p5.js Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

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

  • @lisset2012
    @lisset2012 6 ปีที่แล้ว +21

    You are the most incredible, fun and beautiful person that I ever ever had met. Thank you so much for share all this knowledge. I just don't see your videos because the tutorials. Sometimes my day is going bad and I just open one of your videos and my world around begins to shine. I think this feelings are because im learning at the same time I'm having fun visualizing rainbows and flowers. Thank so much!

    • @captainbube1217
      @captainbube1217 3 หลายเดือนก่อน

      i swear to god this dude is the reverse joker xD

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

    just stopping in again to say how thankful I am for these videos. So well done. More than half way! I can't wait to do ML next

  • @zufi422
    @zufi422 2 ปีที่แล้ว +9

    im reading the Head First JavaScript book. that book, combined with your videos, really makes things "click" for me. if every teacher had your energy and enthusiasm then people would be more eager to learn. keep it up!

  • @Andrea-lf3jq
    @Andrea-lf3jq 4 ปีที่แล้ว +4

    Was having the hardest time understanding parameters and why one might use them. Thanks sooo much for this! You're a joy to watch and listen to

  • @deepankverma
    @deepankverma 9 ปีที่แล้ว +63

    Beautifully explained, no questions.

  • @Muffin--Man
    @Muffin--Man ปีที่แล้ว

    Your motivation is really inspiring😄. I tried this with the flower,here is the code:
    function setup() {
    createCanvas(400, 400);
    angleMode(DEGREES);
    }
    function draw() {
    background(220);
    flower(200, 50, 10, 50, 20, 1);
    flower(200, 200, 20, 200, 50, 6);
    flower(70, 120, 20, 200, 50, 10);
    flower(320, 120, 20, 200, 50, 14);
    }
    function flower(x, y, w, h, r, n) {
    fill("rgb(4,255,0)");
    rect(x - w / 2, y, w, h);
    if (n

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

    Man! This is the only channel where I get answers to all my questions. thank you thank you thank you thank you thank you thank you thank you thank you thank you

  • @JAMES18005
    @JAMES18005 8 ปีที่แล้ว +23

    You're a great teacher, Daniel

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

    The lollipop example was very didactic! Thank you for your great service teaching us.

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

    you explained this beautifully, with real world, simplified scenarios that make way more sense than a bunch of gibberish code. Thank you!

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

    This is the best video explaining function parameters on YT

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

    Argument & parameters well defined-redefined-beautifully defined, this video great piece of work helping me to understand same time cleared the confusion.

  • @Yummeosbada
    @Yummeosbada 6 ปีที่แล้ว +11

    Thank you!! Been having a tough time understanding how to define parameters lol. Making it clear that arguments are sent and define the parameters when you call it was like a eureka moment for me.

  • @vladimirzizic6874
    @vladimirzizic6874 4 ปีที่แล้ว +22

    Finally I understood the terms "parameters" and "arguments". Thank you !!!

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

      I've literally spent 4 days trying to find a video that would break it down like this. These other youtubers gotta stop naming their videos "Javascript for Beginners" if they aren't going to break down the language...

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

      Vladimir putin how r u

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

    Watch: wildly talented and engaging teacher makes self deprecating comments about not being creative while creatively unblocking 200k weary students. Dude you are so talented, stop. (and thank you 🙏 )

  • @PaxRufrax
    @PaxRufrax 6 ปีที่แล้ว +1

    My god! Why was this never explained to me like this? I've paid for two other online courses that skipped over this vital piece of information. Thank you.

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

    Another great vid from the goat. So many people have tried to explain parameters and arguments to me over the years and I could never grasp those concepts. Until today :')

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

    The best explanation, this topic was unclear to me for several months, until now... Thank you!!!

  • @analynaclag-quintos2053
    @analynaclag-quintos2053 3 ปีที่แล้ว +2

    You're an awesome teacher! I enjoy watching your videos, really inspiring to learn!

  • @acat3113
    @acat3113 6 ปีที่แล้ว +2

    Even if i'm trying to learn C++ .this helped me a lot to understand how functions work ,thanks for that tutorial !

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

    finally a video where i get to understand the differances, in such simlpe terms and effective way!

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

    After some good time used on Js function arguments,i got it now , thank you really!

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

    And here I thought Clever Programmer was better. Great video Daniel

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

    I laughed more then any teaching video then this ... not saying i dint learn anything it was a superb tutorial

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

    10:27 I'd love to see you Daniel, you're an inspiration to all of us

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

    Cool! Really straightforward explanation. Now I've got it.

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

    that is a fantastic video, best explanation I have received after hours of you tube , googling, courses . OMG wow

  • @kimcorpataux1358
    @kimcorpataux1358 7 ปีที่แล้ว +4

    wow! Finally, you did it in almost 10 minutes :) haha goal reached! No but seriously... those videos are so helpful! Makes me studies even better :)

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

    Thank you so much, I was stuck here. Just understood.

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

    Woahhhh I was so confused and honestly this sorted me out in 10 minutes, thanks soo much!!!!!

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

    When the Coding Train passes by, run after the Train! The conductor is handing out lollies today!

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

    respect to you author 🥰
    many people need to learn form your, this is 'How to good teaching'🙂

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

    omg i love ur flower, "what am I doing here" hahahahah lol

  • @AryehAmitz
    @AryehAmitz 8 ปีที่แล้ว +4

    Thanks for the explanation. I kinda get how libraries of code work, i think.
    P5 is the set of pre-defined functions saved as a ".js" file. What where doing is supplying the arguments when we use short code like "ellipse();".
    What happens if you have two javascript libraries that have functions with the same names? Is there ever any issue of overlapping libraries?
    It would be cool to hear more about contributing to the library.
    what book would you recommend after the Lauren McCarthy text?

    • @sadhlife
      @sadhlife 7 ปีที่แล้ว +1

      yes, functions in libraries can overlap. that is a very painful problem when importing external libraries into your codes: they weren't designed to work together! they can have same variable/function names!

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

    Very well explained; thank you!

  • @rbotdance
    @rbotdance 7 ปีที่แล้ว

    that´s the first time you cut a video, by the way, your tutorials are amazing, they are helping me a lot. Thank you so much. U da best

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

    Awesome explanation, thank you!

  • @trobert132
    @trobert132 7 ปีที่แล้ว +1

    Thanks for sharing your knowledge, the way you explain it is also very easy to understand.

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

    How would you make it so that a shape i.e. a circle appears when the mousePressed function is called. I have a function for a circle defined and put the parameters as mouseX, mouseY, and diameter but I can't get the circle to appear when i click on the background.

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

    Thanks for the clarity! I'm going to watch some more videos now. Subscribed and SMASHING the like button.

  • @mastermill79
    @mastermill79 7 ปีที่แล้ว

    Great explanation, thank you for clearing up the difference between arguments and parameters.

    • @kandysman86
      @kandysman86 6 ปีที่แล้ว

      Yeah, ive heard them used interchangeably all the time since i started learning, but his explination makes the most sence why there are two names. Because they are different, not the same as ive been told.

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

    Good video, I went through (parameter) other videos without getting it.

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

    Best video on TH-cam on this topic!! Pleaseplzz make a video on function expression vs function declaration!plzzz

  • @moric4677
    @moric4677 6 ปีที่แล้ว

    Interesting teaching style.

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

    what is "let" ot "float" because i saw you use it to make a var with it?

  • @BILLKUBA
    @BILLKUBA 6 ปีที่แล้ว +2

    Awesome mate love your teaching :)

  • @olehhalushko5886
    @olehhalushko5886 7 ปีที่แล้ว

    Man, you are the best , keep going.

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

    I finally get it!!! Thank youuuuu

  • @Nooneis0
    @Nooneis0 7 ปีที่แล้ว

    Thanks , i always understand things with examples , you do that when explaining.

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

    arguments and parameters confused me a lot :D
    But later i just decided to remember "robot" which controls his movements with parameters.. So it should be parameters in function :X

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

    Great video! I'm still new to JS, so not sure if I quite got this. So let's say I want to make a field of flowers with random amounts of petals all over the screen/field. When I call the flower function, would I write (random, random, random)?

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

      Make another function that creat random numbers and pass these numbers as arguments to your function.

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

    I am watching this whole playlist after 5 years

  • @pavelarseyev452
    @pavelarseyev452 6 ปีที่แล้ว +1

    It is pretty sad that i cant like all videos in this playlist by one click. I started to watch the playlist in the morning, but only now i've realized that i didn't liked any of video :( Anyway, thanks a lot for this tutorial. So much interesting and useful!

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

    CEB is teaching Javascipt now? what a chad.

  • @fabianvasquez3585
    @fabianvasquez3585 7 ปีที่แล้ว

    Absolutely brilliant!

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

    But you are talented!! You are so talented at teaching and your simple examples help the n00bs understand

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

    This is excellent! Thanks!

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

    does this work with processing, too?

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

    well explained, thanks

  • @anonofDeath
    @anonofDeath 6 ปีที่แล้ว

    This was a very good explanation.
    Thank you

  • @Beyond.anime.23
    @Beyond.anime.23 หลายเดือนก่อน

    function setup() {
    createCanvas(400, 400);
    }
    function draw() {
    background(220);
    robotface(10, 0, 20, 20);
    robotface(300, 300, 20, 20);
    robotface(300, 0, 20, 20);
    robotface(150, 150, 20, 20);
    robotface(10, 300, 20, 20);
    }
    function robotface(a, b, d, c) {
    strokeWeight(2);
    rect(a + 10, b + 10, d, d);
    rect(a + 70, b + 10, d, d);
    rect(a + 40, b + 40, d, d);
    rect(a + 10, b + 70, d * 4, d);
    }

  • @nasrallahal-shaer8397
    @nasrallahal-shaer8397 6 ปีที่แล้ว

    Thanks sir for these tutorials, I hope you make Node js examples :D

  • @samhenden
    @samhenden 6 ปีที่แล้ว +1

    in the process of drawing my beautiful double decker bus with variable wheelsize height length position and windowcount and the page crashes -_-

    • @thewarlord6529
      @thewarlord6529 6 ปีที่แล้ว +1

      I feel sorry for your loss.

    • @samhenden
      @samhenden 6 ปีที่แล้ว

      @@thewarlord6529 I'd just about gotten over it and it's all flooding back now that your comment notification reminded me 😪

  • @lociusrealsh6930
    @lociusrealsh6930 7 ปีที่แล้ว

    Can a function within an object take parameters? I've created a recursive image out of triangles and have put inside its own function. Now trying to have this as a function of an object but cant get the recursion to work...
    Thanks

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

    hii! nice video! very informative!! can u please solve this doubt of mine.... in a function I have seen people put like function trial(obj){}. here, obj has some definite meaning or is like just some word.. pls reply asap

  • @SR-nl2cz
    @SR-nl2cz 4 ปีที่แล้ว

    best explanation

  • @eboubaker3722
    @eboubaker3722 6 ปีที่แล้ว +3

    10:03 *Pathertic lollipop* :D

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

    huge fan! thank you so much

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

    hello, I've been looking at some functons in general to try & figure them out & watching some of your videos. Alot of the parameters I see are "Orange" e, t, f, & a few other letters..
    I was asuming these were built in shorthand for event, time, & something else... Am I wrong about this or can these letters be anything I declare them to be... Ie.. On an event handler function I see function SumName (e) {
    //DoSumthing } Does e stand for the event that is to be triggered.
    Still not fully getting this and am still new... Why they orange but some other thing you put in are not orange???

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

      xd

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

      Watch his videos from the very beginning (1.1), then watch them in order. Then by the time you get back to this one, it will all make sense.

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

    He likes teaching...cool!

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

    Why is Fill before Rect? You would think it needs to build the rectangle and then fill it not the otherway around

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

      Think of it as picking the marker before you draw the rectangle?

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

      @@TheCodingTrain ahhh interesting! OK thank you for answering 🙂

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

    good explained

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

    Thank you as this one was hard to get it on Codecademy.com

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

    Flowers
    editor.p5js.org/kubiak200/present/KCFCK7UUb
    editor.p5js.org/kubiak200/sketches/KCFCK7UUb

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

    is anyone able to tell me how to detach my preview like he does in the video on windows?

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

      This video uses an older editor that no longer exists, here are some other way to develop code like I do on this channel th-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html

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

      @@TheCodingTrain awesome! And thank you for your reply. Your videos are amazing and I LOVE them! I have been just going through them and learning so much. Hands down, just amazing bud :).

  • @Alex-rt7de
    @Alex-rt7de 4 ปีที่แล้ว

    Parametres for functions and arguments for methods?

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

    the source for the video is not available when I go to look. I guess the only way to understand is to follow along, pause often, and take notes. But boy would it be nice if the source was actually available, that way when I make a mistake in my code as I follow along, I can go and see where I went wrong, without having to watch the entire video. The video is good quality and entertaining but the information is not very dense like it is in source code.

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

    Is my own , is my own function!!!

  • @eboubaker3722
    @eboubaker3722 6 ปีที่แล้ว +1

    10:27 he though that stopping the program will stop the camera :p

  • @CarlosHernandez-lb3wq
    @CarlosHernandez-lb3wq 5 ปีที่แล้ว

    This guy is gangster af

  • @kenoldkhalika2699
    @kenoldkhalika2699 6 ปีที่แล้ว

    I think this tutorial is helpful

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

    I don't get it.
    How does parameter know what to do. For example
    How does diameter know how to change the side of a lollipop if one is not defined as variables in the code, it's only a number it seems.
    plz halp :v

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

      rect and ellipse functions are defined in the p5 library, the original code is there and explains which of the parameters control the x & y values or the size of the shapes. All we have to do is just call the functions and use them!

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

      @@kimeg7294 Owww right. Jeeez thank you sir. Gotta get you a beer someday

  • @emeline894
    @emeline894 6 ปีที่แล้ว +2

    Ah finally I get it! :D

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

    thank you very much.

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

    small mistake in there :) you called the function "flower" and then used the function "flowers", lover your tutorials by the way :P

  • @biliew
    @biliew 6 ปีที่แล้ว

    What language are you using?

    • @zahidahmed586
      @zahidahmed586 6 ปีที่แล้ว

      A language

    • @biliew
      @biliew 6 ปีที่แล้ว

      Programming language

    • @biliew
      @biliew 6 ปีที่แล้ว +1

      JavaScript

  • @mecheey4497
    @mecheey4497 7 ปีที่แล้ว

    such a happy man! :D

  • @Jimmy-lu6pr
    @Jimmy-lu6pr 5 ปีที่แล้ว

    Thank you!

  • @mahaburrahman6127
    @mahaburrahman6127 8 ปีที่แล้ว

    What is ibase_add_user in PHP ? Are you tell me,Sir? Please.

    • @danbo967
      @danbo967 7 ปีที่แล้ว

      Google I found the answer in 2 seconds.

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

      "Are you tell me"

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

    3:00

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

    nice bro

  • @alanpeterson4173
    @alanpeterson4173 6 ปีที่แล้ว

    mind boggled

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

    Your laugh seems so innocent........

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

    thank you !!!

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

    you should make a lollicon function

  • @Andrea-lf3jq
    @Andrea-lf3jq 4 ปีที่แล้ว

    Sad times when your lollipop doesn't show though :(

  • @TheJordon125
    @TheJordon125 8 ปีที่แล้ว

    thanks bro

  • @GerardoBecerra597
    @GerardoBecerra597 6 ปีที่แล้ว

    I would also like to see you, Dan.

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

    bro ur fucking amazing

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

    Ceeeeeeeeeeeb