How to Comment Your Code in p5.js (1.6)

  Рет қаралды 137,303

The Coding Train

The Coding Train

Күн бұрын

Пікірлер: 175
@NatetheAceOfficial
@NatetheAceOfficial 6 жыл бұрын
Thank you for dedicating a whole episode to comments. Some people think it's cool to obfuscate your convoluted code. It also shows understanding of the principals of the code. Very important not just for others, but when you come back to you code later, who knows what you were thinking back when it was written.
@cainthunan3370
@cainthunan3370 6 жыл бұрын
You can also use /* ... */ for multiple lines comment
@something269
@something269 6 жыл бұрын
You can also use /* ... */ for less than one line comments
@idealid1414
@idealid1414 4 жыл бұрын
So that you know that its multiple lines its helpful
@thelavagod
@thelavagod 4 жыл бұрын
@임성훈 so that you wont waste line of code
@angelcaru
@angelcaru 3 жыл бұрын
@@something269 stroke(255 /* This is the red value */, 0/* This is the blue value */, 200/* This is the green value */);
@shekhawat5917
@shekhawat5917 6 жыл бұрын
Just watched the last video , I am having fun learning p5 ☺☺☺
@angladephil
@angladephil 6 жыл бұрын
+T LOVE In fact you learn JavaScript with the P5 librairy...
@shekhawat5917
@shekhawat5917 6 жыл бұрын
@@angladephil true
@hartsgrace1205
@hartsgrace1205 3 жыл бұрын
thank you. thank you... thank you. I think you may have just set the course of me being able to change my life. I am truly grateful and will always remember these beginners tutorials, as being riddled with mental health issues, adhd, ect. learning was never something I was able to do and definitely not something I would choose to do nor ever even joy. I could go on and on but my point is although you may not even realize it you make a difference. even if its just for me I sincerely thank you. I'm on the train my friend next stop is to greatness
@ShaunDreclin
@ShaunDreclin 6 жыл бұрын
A note about using "// todo: blah blah blah" comments, some code editors will automatically generate a list of everywhere in your project that has a todo note on it, so it's easier to go back and find them later. Even if the code editor you're using doesn't have that feature, you can usually search the text of every file in a directory for "// todo:" and that will show you all the places you put it as well.
@KZ-ui5yo
@KZ-ui5yo 4 жыл бұрын
now this and the error messages i have learned when i was learning scripting in roblox
@reubencf
@reubencf 6 жыл бұрын
// nice
@65FM1Edits
@65FM1Edits 6 жыл бұрын
Hello from Japan!!!!!!!!!!!!!!! I LOVE your videos!!!! Make them for another 100000 years!!!
@chrisjustin4115
@chrisjustin4115 4 жыл бұрын
i feel like am in class, best learning videos ever
@clipsus_clips
@clipsus_clips 6 жыл бұрын
This tutorial is 2 years late for me :) But it doesnt matter since i learnt most of the things from your other videos ;) Keep it up Dan!
@EricJost
@EricJost 6 жыл бұрын
Dan it would probably be a good idea to tell people about how different file formats comment differently (ie. the index HTML, or the style.css, or even for JSON files). As always love your enthusiasm and humor in your videos.
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Great poiint!
@b_3_boys921
@b_3_boys921 5 жыл бұрын
I thought he said he wouldn't be reviewing HTML.
@sumbalkhan6816
@sumbalkhan6816 6 жыл бұрын
Your all videos are excellent!
@nixpix19
@nixpix19 2 жыл бұрын
For learning to code, I really like the view: you are writing code to explain the comments to the computer, not to explain the code to the programmer. You can get in to thinking in terms of coding instructions by writing explicit comments first and fill in the exact instructions and functions later.
@LogicalBeatss
@LogicalBeatss Жыл бұрын
I want to say a neat feature of the console that I use in almost every project. Sometimes, i need to see what pixel my mouse is positioned at when drawing. At the bottom of my draw loop, i love to put the line "console.log(mouseX + ", " + mouseY);" It just tells you the mouses location every frame in the console
@TheCodingTrain
@TheCodingTrain Жыл бұрын
Thank you for sharing!
@LogicalBeatss
@LogicalBeatss Жыл бұрын
@@TheCodingTrain do you mind making a tutorial on how to import p5.js into webstorm. I've been trying for weeks and I can't get it to work
@OonHan
@OonHan 6 жыл бұрын
Magnificent! Very useful information that is helping me a lot! Choo choo!
@icebird-v7j
@icebird-v7j Жыл бұрын
thank you for all of the coding lessons they are very helpful
@jesseanakku
@jesseanakku 4 жыл бұрын
Thanks for giving this easy to use with interactive presentation. Really appreciate it
@harshsrivastava9570
@harshsrivastava9570 6 жыл бұрын
I am only watching this to give you views
@gamingzone2114
@gamingzone2114 3 жыл бұрын
I have learnt a lot of from your videos.
@doksc
@doksc 5 жыл бұрын
alert("Thanks for the tutorial");
@neelakshbhatt2074
@neelakshbhatt2074 4 жыл бұрын
he discribes all thing better than my computer teacher
@eirikreiestad3682
@eirikreiestad3682 6 жыл бұрын
I have a problem with the Windows keyboard, because I don't know how to mark and put / in front of many lines at one time. 3:10 in the video. (Norwegian keyboard)
@nicob8782
@nicob8782 4 жыл бұрын
Sir you are best
@maryfiore5905
@maryfiore5905 3 жыл бұрын
Is there a way to make a grid so that it is easier to find the x and y coordinates desired?
@goldthumb
@goldthumb 2 жыл бұрын
My dad, nearly 90 and not living with me, plays with interesting math problems every day. I wish he could follow Daniel and play with p5js. He might feel like being 19 again.
@GabrielKakeKake
@GabrielKakeKake 4 жыл бұрын
In non-English keyboards, ctrl + / shortcut for Comment/Uncomment doesn't work... can you fix that???? Thank you
@hakanatas
@hakanatas Жыл бұрын
did you solve it?
@midnightrizer
@midnightrizer 5 жыл бұрын
Code by comment is a Good coding Practice It saves much time later should you wish to create a function.
@iainmacdonald7843
@iainmacdonald7843 4 жыл бұрын
where is the 1.7 tutorial? btw I'm really enjyoying the series keep it up :)
@II-lw3rs
@II-lw3rs 4 жыл бұрын
Looking for the next video after this one. The one shown in the playlist is an older video (from five years back). Wondering if I’m missing something? Can anyone please help?
@mer4801
@mer4801 5 жыл бұрын
--->command slash is done using ctrl followed with +/ edit: done using my basic keyboard :)
@mer4801
@mer4801 5 жыл бұрын
@CartoonKanal ctrl and + and /
@6stringcuber683
@6stringcuber683 5 жыл бұрын
This is really cool
@wenlo6573
@wenlo6573 6 жыл бұрын
Thank you. You are a teacher I appreciate. :) One question. When the comments are too long, how can I change the line automatically?
@tobias5696
@tobias5696 4 жыл бұрын
Love these tutorials! One question: how to "command - slash" after marking multiple lines? Is that an apple thing or just possible on an american keyboard (layout)?
@TheCodingTrain
@TheCodingTrain 4 жыл бұрын
Is it perhaps CNTRL-SLASH on windows?
@tobias5696
@tobias5696 4 жыл бұрын
@@TheCodingTrain Unfortunately not, Slash itself is written by pressing two keys . Thanks anyway :)
@umayoq
@umayoq 3 жыл бұрын
@@TheCodingTrain STRG+NumpadSlash (Windows)
@Uttarayan
@Uttarayan 2 жыл бұрын
I guess you got a french or czech keyboard, or any other langage using diacritics. As a french i got the same problem on azerty (you need shift for the slash and if you do shift+cmd+/ it triggers a finder shortcut :/ ) I have not tried yet but i bet the only solution is to switch your keyboard to qwerty
@Driver_12T
@Driver_12T 4 жыл бұрын
// It is very fun for me to learn p5!
@badhairballer23
@badhairballer23 5 жыл бұрын
Hey maybe someone can help me. The high lighting and than pushing "comment slash" doesn't work for me. If I do that the whole high lighted code gets deleted and I end up with one "/" . Am I doing something wrong? Thanks
@angladephil
@angladephil 6 жыл бұрын
I'm far away ahead of this (thx to you !), but d'u mean u recommend us to use the P5 editor ? (From France, poor English, excuse me).
@rodrigocid8742
@rodrigocid8742 3 жыл бұрын
How can we amplify all the parts of the image? I tried resizeCanvas, but it didn't work.
@followthetrawler
@followthetrawler 6 жыл бұрын
enjoying these Daniel - but are we now meant to be looking at 2.1 from a few years back? Or are you redoing some of these older videos using the web editor?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
I may redo the 2.x videos and beyond as well, but I am not able to get to it now. For my students at NYU I'm having them continue onto the videos I made previously. If you notice anything very out of date, please let me know!
@trowpaw
@trowpaw 6 жыл бұрын
How would I go about hiding a word, then showing an animation? I have tried every "hide" / "show" function that p5 offers. I know how to do it on normal html, but it keeps giving me an undefined problem. It definitely is defined.
@luckywinner2517
@luckywinner2517 Жыл бұрын
Where are 1.7,1.8,1.9,2.0
@RonaldColeman990
@RonaldColeman990 6 жыл бұрын
Hey, im pretty new to programming. I already started learning some java script, and then I came across your videos. Would I just confuse myself if I learned p5.js and java script at the same time? Should I finish that java script course doin on code academy first?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
I think it's ok to do both!
@YuvanshVarshney-i8k
@YuvanshVarshney-i8k 6 ай бұрын
function setup() { createCanvas(400, 400); } function draw() { background(200,60,0); rect(50,60,100,100,) rect(250,60,100,100,) fill(200,0,0) rect(125,300,150,10,) fill(200,200,0)} this is it a geometry dash block
@herrjose
@herrjose 5 жыл бұрын
thank you!!!
@mralcina8726
@mralcina8726 5 жыл бұрын
How do you comment out multiple lines at once on Windows like Dan did at 3:08
@ahmadyogi1340
@ahmadyogi1340 5 жыл бұрын
if your text editor is support to do this, just block all the code you want it to comment and type //, it will automatically do to all lines of code you've just blocked(sorry for bad english)
@ryanrachic5150
@ryanrachic5150 6 жыл бұрын
Aye bro question. Trying to get into basic coding, doing a class on it in highschool but want to take it home and work on my own projects. How do I download JavaScript? Is it a simple download and use, do I need a driver, is it an online tool? Have absolutely no idea, but I’ve seen some vids of yours and prob will keep watching them so I figured I would ask
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
This workflow video might help (although it's a ton of extra stuff): kzbin.info/www/bejne/fouXdWatebeUm8U I have some new ones coming out next week too. And you can use the p5 web editor at home by just going to a web browser!
@turbles454
@turbles454 3 жыл бұрын
wheres the 1.7 tutoreal? i realy want to animate and all the other tutorials a re way more confusing than yours
@calituz
@calituz 6 жыл бұрын
The next video in this serie is 3 years old. Are you going to re-do it?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
I am not sure yet. At the moment I don't think I have the time to re-do all of the videos and the concept still apply. Would love feedback for how the transition is from this video to the older ones.
@mav7677
@mav7677 6 жыл бұрын
could you make a video where you explain why i should start learning coding with p5.js and not for example java/python etc.
@dannynomadic
@dannynomadic 5 жыл бұрын
What video comes after this one??
@brunogarromontenegro6064
@brunogarromontenegro6064 6 жыл бұрын
How can you add a textbox so that anyone can input a numeric value and with the pressing of a button perform an equation?
@lmyers26
@lmyers26 4 жыл бұрын
You might check out Java for that use case...
@wonderinho
@wonderinho 5 жыл бұрын
did the series just end?? is there no more parts?
@TheCodingTrain
@TheCodingTrain 4 жыл бұрын
Full playlist: kzbin.info/aero/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
@mikeystir3333
@mikeystir3333 10 ай бұрын
//Code project for learning //by Mikeystir //Taught to me by TheCodingTrain function setup() { createCanvas(400, 300); } function draw() { //this is the whole picture on the canvas background(0, 155, 255); rectMode(CENTER); rect(200, 150, 100, 100, 90, 100, 10, 90); fill(255, 125, 50); }
@mikeystir3333
@mikeystir3333 10 ай бұрын
//I couldnt add the rotate funtion rotateY(frameCount * .1); //becuase would need to go in and add WEBGL to the Canvas function setup() { createCanvas(400, 300, WEBGL); //because it would cause the rectangle on the canvas to not be center regardless of using rectMode(CENTER); //Code project for learning (error) //by Mikeystir //Taught to me by TheCodingTrain function setup() { createCanvas(400, 300, WEBGL); } function draw() { //this is the whole picture on the canvas background(0, 155, 255); rectMode(CENTER); rotateY(frameCount * 0.01); rect(200, 150, 100, 100, 90, 100, 10, 90); fill(255, 125, 50); }
@jantheil9239
@jantheil9239 6 жыл бұрын
Where can we get this wallpaper?
@Likeaboss-md8vk
@Likeaboss-md8vk 4 жыл бұрын
Bro how to make a triangle??
@alexap1635
@alexap1635 6 жыл бұрын
I know I probably sound stupid, but how do you select a line so quick? I think you are using a short cut.
@wenlo6573
@wenlo6573 6 жыл бұрын
shift + arrows (mac os)
@Mkoxc
@Mkoxc 2 жыл бұрын
SLASH COMMAND IS CTRL+/(numpad slash)
@aungmyatmin7939
@aungmyatmin7939 4 жыл бұрын
I think the next usage of the comment is /* * * */ You can write many sentences beside "*".
@duni7584
@duni7584 5 жыл бұрын
I will pay u to be my teacher please xD
@EthanJbleethan
@EthanJbleethan 4 жыл бұрын
What command slash?
@luckywinner2517
@luckywinner2517 Жыл бұрын
Add again these parts bro😊
@Unlock-o7w
@Unlock-o7w 10 ай бұрын
Hello, where is 1.7?
@shresthagarwal5103
@shresthagarwal5103 3 жыл бұрын
How you are zooming
@6754bettkitty
@6754bettkitty 5 жыл бұрын
There was a time where i did not write comments. I quickly realized how helpful comments were. For example, there is a boolean that is named as a weird acronym in one of my school projects. i wished i would have commented what the acronym meant because i do not remember what it was supposed to mean (exactly). Big OOPS!
@knowledge_4203
@knowledge_4203 4 жыл бұрын
rect(100,100,100,100,10); ellipse(100,100,100,100,100,); noStroke(); just practicing
@d_sanu
@d_sanu 2 жыл бұрын
Anything enclosed within /* ...*/ also works in p5!
@JacopoVoltolina
@JacopoVoltolina 6 жыл бұрын
hey bro when is the new second unit!! not the old...
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
I don't have time right now to redo part 2 (and it almost all still applies) so I wouldn't wait and just move onto the older videos.
@JacopoVoltolina
@JacopoVoltolina 6 жыл бұрын
@@TheCodingTrain k broo
@eirikreiestad3682
@eirikreiestad3682 6 жыл бұрын
How to do command slash on pc?
@luluc1493
@luluc1493 5 жыл бұрын
you can't
@mer4801
@mer4801 5 жыл бұрын
@@luluc1493 you can ctrl followed with +/
@ritvikgarg7440
@ritvikgarg7440 4 жыл бұрын
Ctrl + /
@barbarap.t.2381
@barbarap.t.2381 3 жыл бұрын
function setup() { createCanvas(400, 400); } function draw() { background(100); stroke(100,1,2); strokeWeight(10); square(121, 14, 12, 121); line(30, 20, 85, 20); stroke(126); line(85, 20, 85, 75); stroke(255); line(85, 75, 30, 75); arc(50, 55, 50, 50, 0, HALF_PI); noFill(); arc(100, 55, 60, 60, HALF_PI, PI); arc(1, 55, 70, 70, PI, PI + QUARTER_PI); arc(200, 55, 80, 80, PI + QUARTER_PI, TWO_PI); line(1221, 21, 12, 121); } try all of that
@weld3o3
@weld3o3 Жыл бұрын
What's it supposed to be 🤔
@Unlock-o7w
@Unlock-o7w 10 ай бұрын
Okay...i tryed..🤨
@yamantarakji
@yamantarakji 6 жыл бұрын
did you get a new macbook?
@Flor12344
@Flor12344 6 жыл бұрын
yes he did
@artefakt101
@artefakt101 6 жыл бұрын
What about keyboard shortcuts for non-american keyboards? For example, on my Swedish keyboard the keys for "/", "[", and "]" do not have separate keys. To get "/" you need to press "Shift"+"7". For "[", or "]" you need to press "Alt Gr"+"8" or "Alt Gr"+"9". But then the shortcuts don't work. E.g. "Ctrl"+"Shift"+"7" does not "comment" the selected program lines, though this is the equivalent of pressing "Ctrl"+"/" on an american keyboard. It had been better to have shortcuts that use keys that are available on most western keyboards.
@theodor5098
@theodor5098 6 жыл бұрын
I have a norwegian keyboard but to fix it u should just turn ur keyboard language to english. Sorry for bad spelling, im not so good at speaking english.
@dafreedomfita
@dafreedomfita 4 жыл бұрын
What comes after tutorial 1.6?
@TheCodingTrain
@TheCodingTrain 4 жыл бұрын
here's the full playlist! kzbin.info/aero/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA&app=desktop
@dafreedomfita
@dafreedomfita 4 жыл бұрын
Thanks so much, I have been using your tutorials to achieve one of my lifelong goals, and it was never done before. Thanks champ!
@maxkrause7678
@maxkrause7678 6 жыл бұрын
Your videos are brain candy.
@razametaza
@razametaza 6 жыл бұрын
It's documentation :)
@awalvie1060
@awalvie1060 6 жыл бұрын
I need them rainbows in my life. Come'on
@黎阳-g5m
@黎阳-g5m 6 жыл бұрын
Hello,shiffman. Now i'm watching the video 2.1 of p5.js serie. However i found all the coding environment has changed, Instead of using the web editor,it seems that you use another tools to run the code. whats that? and how can i get and use the same tools on windows10 platform? thanks a lot.
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Unfortunately I haven't had time to redo all of the beginner videos. The concepts should all still apply, however. I suggest using the web editor throughout al the videos. If you want to find out about other tools I am using now: kzbin.info/www/bejne/nXvEZ6qonp2MhLM (Full playlist: kzbin.info/aero/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X)
@angelcaru
@angelcaru 5 жыл бұрын
/* Code Comment */ let val=3; //function(x){return x*x}
@timduggan4464
@timduggan4464 4 жыл бұрын
the game is not working
@gemapamungkas7296
@gemapamungkas7296 2 жыл бұрын
// i don't know what i am doing. please send help god.
@foisalahmed07
@foisalahmed07 5 жыл бұрын
Anyone noticed his typing speed???
@ricoq2008
@ricoq2008 2 жыл бұрын
command+slash on mac keyboard = ctrl+slash but slash on numbers keyboard....
@angladephil
@angladephil 6 жыл бұрын
If I don't mistake : function setup() { createCanvas(400, 400); // it's where I draw } This comment at the end of the line is valid too, right ? (from France ... etc ...)
@ShaunDreclin
@ShaunDreclin 6 жыл бұрын
Yep, you can put a comment at the end of a line and everything after the // will be commented out. You can also put a comment anywhere in the middle of a line by doing something like let x /* comment here */ = 5; or doTheThing(/* comment */ 42);
@shekhawat5917
@shekhawat5917 6 жыл бұрын
Make the RANDOM function video fast
@sarthakk.c7928
@sarthakk.c7928 4 жыл бұрын
2020
@uushk6631
@uushk6631 3 жыл бұрын
you so cute!
@Flor12344
@Flor12344 6 жыл бұрын
.
@mika34512
@mika34512 3 жыл бұрын
Mag ich nicht
@fabianmarker355
@fabianmarker355 3 жыл бұрын
Ich mag dich nicht
2.1: Variables in p5.js (mouseX, mouseY) - p5.js Tutorial
10:41
The Coding Train
Рет қаралды 111 М.
Drawing Shapes in p5.js for Beginners (1.3)
25:47
The Coding Train
Рет қаралды 467 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 337 М.
RGB Color in p5.js for Beginners (1.4)
17:26
The Coding Train
Рет қаралды 272 М.
25 VS Code Productivity Tips and Speed Hacks
11:35
Fireship
Рет қаралды 2,4 МЛН
Wave Function Collapse: Overlapping Model
1:32:09
The Coding Train
Рет қаралды 48 М.
Clean Code is SLOW But REQUIRED? | Prime Reacts
28:22
ThePrimeTime
Рет қаралды 341 М.
How to Get Started with Contributing to Open Source
14:40
AssemblyAI
Рет қаралды 42 М.
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 976 М.
6.2: Classes in JavaScript with ES6 - p5.js Tutorial
20:09
The Coding Train
Рет қаралды 409 М.
Coding Challenge 185: Unfolding Fractals
31:04
The Coding Train
Рет қаралды 47 М.
2.2: Variables in p5.js (Make your own) - p5.js Tutorial
12:24
The Coding Train
Рет қаралды 182 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН