Should You Comment Code?
🎨 Welcome to our "Programming for Artists" series! In this engaging tutorial, we dive into the essentials of using code comments effectively. Whether you're a beginner or an experienced coder, understanding code comments is crucial for enhancing your programming skills. 👨💻 What You'll Learn: - Basics of Code Comments: Discover how to insert text into your program without execution. - Single Line vs. Multi-Line Comments: Understand the difference and when to use each type. - Practical Tips: Learn how to use comments for testing without deleting code. - Advanced Techniques: Explore the use of comments for documentation and attribution. 🔍 Key Highlights: - Step-by-Step Guidance: Follow our easy-to-understand examples to master commenting techniques. - Real-Time Examples: Watch as we demonstrate how changing background colors in code can be easily managed through comments. - Insights on Documentation: Learn the importance of adding comments for program descriptions, licensing information, and documentation references. - Best Practices: Gain insights into the ethical use of borrowed code snippets and the importance of acknowledging sources. 🔗 Additional Resources: - Visit our website for more tutorials and resources: https://whatmakeart.com/ 🌟 Why Watch This Tutorial? - Artist-Friendly Approach: Tailored specifically for artists venturing into programming. - Enhance Code Clarity: Improve the readability and maintainability of your code. - Ethical Coding Practices: Understand the significance of proper code attribution. 👉 Don't forget to LIKE, SHARE, and SUBSCRIBE for more artist-focused programming tutorials! Drop your questions and feedback in the comments section below. Happy programming! #ProgrammingForArtists #CodeComments #CodingTutorial #ArtistCoder #ProgrammingBasics #LearnCoding #ArtAndTech #CreativeCoding #CodeDocumentation Video Transcript In this programming for artists tutorial, I'm going to show you how you can make code comments. Code comments are great ways that you can put actual text inside your program and then not have the computer execute that code. Remember the computer goes through each step and then executes that code. o for example if I run this sketch and it says background 220 and then I type background( 23, 56, 147) it makes it blue. I could comment out one of these lines by putting two slashes in front of it. Then it only makes the background the 220 gray scale. I can also give myself comments to remember what it is so I can put a comment at the end of this line, "This is a dark blue color." I may not remember that until I run the sketch so if I comment out this line then it becomes a dark blue color. This is a really convenient way to test things without having to delete things in your code. Another thing that you can use it for is putting messages at the top. So here I have some comments up at the top, a lot of times you'll put in what your program is about, how it works, what the licensing is, maybe a website for a documentation page. So far we've done single line comments. We can also make multi-line comments by putting a slash then a star. Then I can put lots of comments in and the entire line is commented out so no matter what I type here it's not run. This is very convenient for commenting out large sections. For example I could comment out this entire section and then the entire draw function doesn't work anymore, there's just nothing happening. So there are multiple ways I could comment out each individual line or use a multi-line comment. Comments are really super important. Always try to document clearly what your code is doing. They're also a great way to show where you've gotten other code snippets. So if you've borrowed code, even it's if it's an open source repository you really should let others know where that code is from and so that way you can clearly delineate how different functions and operations work. So hopefully you can now use code comments in your programming projects. Happy programming.
Download
0 formatsNo download links available.