Digital Recipe Book

Hello! I’m currently learning CS fundamentals through the CS Careerpath and I thought I’d share my first portfolio project! A detailed blog post on the program and how it works can be found here. At the bottom of the post, you’ll find a link to the github repository with all the code for the project. If you get a chance to pop in and look at it, please let me know what you think!

Hey!

Some tips:

  1. Don’t use time.sleep unless absolutely necessary. With sleeps, it looks like your program is running slowly.
  2. Validate user input before using it. For example, in the “menu” function, the user can enter “8” or “b” and Python will throw an exception. You can find more information about user interaction in the course https://www.codecademy.com/learn/paths/build-chatbots-with-python.
  3. Create Available_recipes.txt at application startup if it doesn’t exist. Otherwise you can get a FileNotFoundError.
  4. I don’t think using a GUI like filedialog in a console application is a good idea. If you are writing a console application, allow any operations to be performed from the console.
  5. If you want to use commands from the OS, check the OS name first. What if your application runs on Linux, for example. See sys — System-specific parameters and functions — Python 3.10.2 documentation.
  6. If you are asking a question to the user like input('continue?') in the wait function, process the response. For example, I don’t want to continue, I type n, but the program doesn’t exit. It’s confusing.
  7. Use a shorter representation for objects in the __repr__ method. The “This recipe contains information on how to make” part does not contain much information about the object. Especially when debugging an application.

Well done!

1 Like