Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Using Databases in Python Gettin' CRUD-y With It Add An Entry

Talha Rashid
PLUS
Talha Rashid
Courses Plus Student 4,645 Points

Why Kenneth does not write add_entry() in Initialize

Why Kenneth not write add_entry() in Initialize

1 Answer

If Kenneth were to write 'add_entry()' into initialize(), it would create a new entry everytime you opened your diary. This would be fine in some uses, but what if you're trying to simply read your diary? You'd end up creating empty diary entries simply by opening it.

I'll amend this some since it won't actually save the entry until you choose to. You will be entering into a new entry everytime you open the diary, though. It's possible that, for your use, it makes more sense to initialize it into a new entry, but I think for a general audience the preference would still be to open the diary and then choose where you'd like to go, rather than opening it into a new entry and then having to back out to what you'd like to choose.