You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raise your hand if you have ever gotten stuck in a project, then solved your problem with code you found online? ✋
I know I have! Whether you’re new to coding or a seasoned developer, integrating existing code into your projects can help you save time, explore new techniques, and build on the work of others.
Check out our new GitHub Docs Learn to code series, where today we’re exploring Reusing other people's code in your projects to help new developers learn the ropes for code reuse. We'll learn by working through an example: reusing Python code that calculates the factorial of a number. 🐍
Need a taster? Below are our favourite takeaways 🥡 But don’t forget to check out the full article as we’ll be asking you to answer questions in the comments 👇
Copying and pasting code snippets is a great way to jumpstart your projects and understand new coding styles. Always start by finding a snippet that matches your needs, then study how it works before integrating it into your project.
❓Did you ask Copilot to explain the program?
5️⃣ points if you did 👍 Pic or we don’t believe you, post in the comments 😉
Before using any code, check its license (like the MIT license in our example) to know your rights and responsibilities. This not only keeps your project legally sound but also supports ethical coding practices.
❓Using the “Choose a license” tool in the article, what are the “conditions” differences between GNU LGPLv3 and MIT License?
1️⃣ point for each correct condition.
Transform copied code into something uniquely yours! Convert snippets into functions tailored to your project. In our example we adapt a simple factorial calculator into a dynamic tool for multiple calculations. 👨🔬
❓Can you customize our factorial calculator into a different calculator?
5️⃣0️⃣ points if you share it in the comments 🎉
Instead of reinventing the wheel, import libraries to access well-tested, secure functions. This approach not only streamlines your development process but also enhances your project’s reliability. Let’s see how we can use Copilot to search for usable libraries.
❓What Python libraries does Copilot Chat suggest for machine learning?
🔟 points if you share the top two in the comments 🏅
Using popular libraries and enabling tools like Dependabot alerts help safeguard your projects from vulnerabilities. Regularly check for updates and security advisories to maintain robust code.
❓Dependabot is available to what type of projects on GitHub?
5️⃣ points + 1️⃣5️⃣ points if you also share Dependabot PR from your own project
Wow, that was certainly a feast. We hope y’all followed along with the example in the article!
Share your completed factorial calculator project in the comments and tally up your points 🔢🥇 We can’t wait to see what modifications you came up with! 💖
Tip
Remember to follow new2code! Sam, a student learning to code, shares interesting projects like a factorial calculator, debugging with Copilot, and a hiking pace calculator. Join their journey and learn together!
📣 ANNOUNCEMENTAnnouncements from the GitHub Community teamGitHub EducationAll things GitHub Education including website, documentation and events.Best PracticesBest practices, tips & tricks, and articles from GitHub and its users
2 participants
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Raise your hand if you have ever gotten stuck in a project, then solved your problem with code you found online? ✋
I know I have! Whether you’re new to coding or a seasoned developer, integrating existing code into your projects can help you save time, explore new techniques, and build on the work of others.
Check out our new GitHub Docs Learn to code series, where today we’re exploring Reusing other people's code in your projects to help new developers learn the ropes for code reuse. We'll learn by working through an example: reusing Python code that calculates the factorial of a number. 🐍
Need a taster? Below are our favourite takeaways 🥡
But don’t forget to check out the full article as we’ll be asking you to answer questions in the comments 👇
🏃♂️ Accelerate Your Learning:
Copying and pasting code snippets is a great way to jumpstart your projects and understand new coding styles. Always start by finding a snippet that matches your needs, then study how it works before integrating it into your project.
❓Did you ask Copilot to explain the program?
5️⃣ points if you did 👍 Pic or we don’t believe you, post in the comments 😉
🔖 Respect Licensing:
Before using any code, check its license (like the MIT license in our example) to know your rights and responsibilities. This not only keeps your project legally sound but also supports ethical coding practices.
❓Using the “Choose a license” tool in the article, what are the “conditions” differences between GNU LGPLv3 and MIT License?
1️⃣ point for each correct condition.
✨ Customize and Grow:
Transform copied code into something uniquely yours! Convert snippets into functions tailored to your project. In our example we adapt a simple factorial calculator into a dynamic tool for multiple calculations. 👨🔬
❓Can you customize our factorial calculator into a different calculator?
5️⃣0️⃣ points if you share it in the comments 🎉
🛞 Leverage Libraries for Efficiency:
Instead of reinventing the wheel, import libraries to access well-tested, secure functions. This approach not only streamlines your development process but also enhances your project’s reliability. Let’s see how we can use Copilot to search for usable libraries.
❓What Python libraries does Copilot Chat suggest for machine learning?
🔟 points if you share the top two in the comments 🏅
🔒 Embrace Security Practices:
Using popular libraries and enabling tools like Dependabot alerts help safeguard your projects from vulnerabilities. Regularly check for updates and security advisories to maintain robust code.
❓Dependabot is available to what type of projects on GitHub?
5️⃣ points + 1️⃣5️⃣ points if you also share Dependabot PR from your own project
Wow, that was certainly a feast. We hope y’all followed along with the example in the article!
Share your completed factorial calculator project in the comments and tally up your points 🔢🥇 We can’t wait to see what modifications you came up with! 💖
Tip
Remember to follow new2code! Sam, a student learning to code, shares interesting projects like a factorial calculator, debugging with Copilot, and a hiking pace calculator. Join their journey and learn together!
Beta Was this translation helpful? Give feedback.
All reactions