Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queues - Danielle Birbal - SolarSystem.rb #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

birbalds
Copy link

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? It establishes a hash to store the planet data/values. As well as displaying the names of the planets on terminal.
Describe an instance variable you used and what you used it for. I used an instance variable to pull data from the hash to use(display on terminal/conditionals) in a method
Describe what the difference would be if your SolarSystem used an Array vs a Hash. Using a Hash to store the Planet would require keys/symbols to access the data but an Array allows access via the index number.
Do you feel like you used consistent indentation throughout your code? Yes

@droberts-sea
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. yes
Used an Array to store a list of planets in the SolarSystem class. yes
Readable code with consistent indentation. Needs work - see below.
Created a pull request with your name & a meaningful message. yes

In general, this looks quite good! I just have a couple nitpicks about style.

First, why is your file called BabyDragon.rb? Seems like solar_system.rb might be more appropriate.

Second, Your indentation could use work. Atom can do this automatically, so there's really no excuse to not have it beautiful!

Third, on future projects I'd like you to pay close attention to your variable and method names. In general, you should use complete english nouns or noun-phrases for variables, and complete verbs or verb-phrases for methods. Things like msyss or plusplanetar sound cool and computery, but are actually just hard to read. Consider names like my_solar_system or add_planet_list instead. That way your coworkers (or you in 6 months) will be able to instantly understand what a piece of code is for.

Other than that, your program logic looks solid. Good work!

class Planet
attr_accessor :planetname, :moons, :mass, :rings, :atmosphere, :planetinfo

def initialize(planetinfo)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job re-working Planet#initialize to take a hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants