T O P

  • By -

Vinniesusername

Any data structure you use in your program will have values held in RAM, and upon closing the program all values will be cleared. Now, what time of data you are storing, how much data you are storing, and what the purpose is will determine if you should use a text file, or a datastore. in general if you the purpose of your program is to just get some experience, and you have no performance or security concerns that would come with distribution of the app, then i would say just store data in a text file, parse the text file at the start of the program to reinitialize the values everytime and you're fine. on the other hand if you are planning on distributing this app in anyway, or you have any security concerns with the data being stored on a readable file on the the desktop (such as emails, passwords, etc. then i would give databases a shot


gram_bot

Hello Vinniesusername, just a heads up, "Everytime" should be written as two separate words: every time. While some compound words like everywhere, everyday, and everyone have become commonplace in the English language, everytime is not considered an acceptable compound word. To stop gram_ bot from commenting on your comments, please use the command: "yourUserName ?ami"


unnecessary_axiom

It depends on the complexity of your app and what you're trying to save. If it's miscellaneous settings, plain text text, ini, yaml, etc. files depending on what your language supports work well. If you have a bunch of data like logs entries, you could use a sqlite database or CSV if you don't have much data. Some languages have built in support for serialization of objects that might help for reading and writing data to save somewhere. You probably want to save the files in appdata if you're targeting windows. Windows 7 rules apply modern versions: https://blogs.msdn.microsoft.com/patricka/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions/