r/learnprogramming • u/Temporary-Warthog250 • Apr 05 '22
Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them
Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.
Someone else who reads yours and does understand it, try to explain it to them to help them learn
1.6k
Upvotes
1
u/[deleted] Apr 05 '22 edited Apr 05 '22
So question about static objects/methods. I read that you should try not to use them if you don’t need to. I have been struggling on whether or not to implement them.
For example, I have a FileHandler class that deals with reading and writing to text files to deal with saved data. Is it better practice to always create a new object whenever these tasks are needed and set up the object in it’s constructor, or just make the object or methods static so they can always be called upon elsewhere in the program?