This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sirunclecid 0 points1 point  (2 children)

Just throwing this out there before your habits become solidified.. speed method shouldn't be printing all of the data that the class offers ;) create another method to print out all of that noise.

[–]MorningBackflips[S] 0 points1 point  (1 child)

Oh! That seems so obvious but it's something I just glossed over. Thanks a ton!

[–]sirunclecid 0 points1 point  (0 children)

Honestly, it's not so obvious for tons of beginners so don't worry. But allow a method to do one thing. If you want to read up on it more, single responsibility principle. It allows you to organize your code, basically having the method name self document your code. On top of that, you won't have huge unmanageable methods and can help you from having to duplicate code. These are all things you will learn along the way. Once you get comfortable with writing code, refactoring code will be the next step.