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/Grination Apr 11 '22
One of the advantages of interfaces is that they don't break your code if you decide to switch the implementation some day. For instance, in Java, there is a standardized persistence specification called JPA (java persistence api), and there are many vendor implementations of it such as hibernate and eclipseLink, in your code you don't directly depend on the implementation, you only depend on the interface, so if you decide to switch one day from an implementation to another, you'll only change a .properties configuration file specifying which class to use, without messing about with your java classes