DEV Community

Discussion on: Terminal game that generates golf drills

 
wmansfieldgolf profile image
wmansfieldgolf • Edited

This looks like great stuff! I will review later today or tomorrow and circle back with any questions. Thanks for the feedback!

Edit:

Ok, I love the feedback. Thanks so much. Just some thoughts on what you gave me below:

Future Improvements

I really liked what you mentioned in this section but as of now, I have no idea how to do anything like that.

  • Adding web based UI. This sounds super cool. Is there a direction you can point me so I can start learning more about this? Is this like learning CSS and HTML and learning how to incorporate them with Python?
  • Storing user data and running analytics... showing skills for database communications. This (I think) is the next thing on my plate over at Codecademy. Starting to dig into "CS102: Data Structures and Algorithms." So perhaps I will learn more in the coming weeks.

Code Review

Quick hits

I figured the Skill class was kind of pointless but the project suggested I try to look for something I could make into a class for the practice.

Absolutely right on the double vs single quote. I need to make up my mind. Do you think there is a certain advantage to one vs the other?

Logical reordering - I think this is something that will come with more time and experience? Having a better sense of the basics and knowing I can use this method or that method for whatever the situation is...

Remove Eval

So it is interesting you mention this. I was a bit stuck on this part for a while because I am using the user input to call the instance of class Skill. Maybe this is just bad practice? I cleaned the user input (e.g. "Putting " to "putting") and set it equal to the variable 'formatted_improvement'. To my knowledge (or at least my IDE wouldn't let me) I could not call the method using 'formatted_improvement.determine_drill_dict' so I did some searching and discovered I could use eval. Perhaps this goes to your point that the class would be easier to instantiate at runtime. Will mess with code and see what happens.

Change drills data... JSON + multi level dict

I totally agree with you here, those just are skills I don't have yet. Haven't learned about JSON or multi level dictionaries.

Loop control

Another area I was a little stuck and turned to the internet for a solution. I see what you are saying though. It felt a little clunky to me when I found the solution. What do you mean by an anti-pattern?

Naming

Yes! I have started to notice coming up with appropriate names for things can be tricky, especially as code gets more complex. I will check out the code and think about a way to make some of the names better and pay more attention in future projects.

This was extremely helpful to me. Thank you for taking the time to review it.