+ 2

What are the benefits of using methods?

28th Jun 2018, 10:11 PM
SebGM2018
SebGM2018 - avatar
2 Answers
+ 8
imagin you create a code that uses a for loop to create & print numbers 246810 and then you write some more code and decide you want to use that previous for loop again with some editing but you cant becuase there no way to call it again, thats were methods come in handy as you can call and pass parameters to the method that holds that bit of code if you need it again without having to type the whole for loop part again 😊
29th Jun 2018, 12:11 AM
D_Stark
D_Stark - avatar
+ 5
SebGM2018 You can call a method by name instead of repeating it hundreds of times if you build a large program Methods save time and uses less lines of code which makes it easier to read and makes it run faster.
28th Jun 2018, 10:41 PM
Agent
Agent - avatar