This is my note to level up my programming capabilities.
-
Coding that should be (Taken from https://qr.ae/TUfSEN)
- If code isnot tested, it won't work.
- Don't reinvent the wheel, library code is there to help.
- Code is not self documenting. Help others by adding comments to guide them. You may understand it now but what about in 5 years time?
- There is no such thing as a 5 minute job. It'll always take at least half a day.
- A code review is not a criticism.
- Code rots over time.
- Code that's hard to understand is hard to maintain
-
Solid Class Design Principle(derived from wiki)[https://en.wikipedia.org/wiki/SOLID]
- Single responsibility principle
- A class should have only a single responsibility, that is, only changes to one part of the software's specification should be able to affect the specification of the class.
- Open–closed principle
- "Software entities ... should be open for extension, but closed for modification."
- Liskov substitution principle
- "Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program." See also design by contract.
- Interface segregation principle
- "Many client-specific interfaces are better than one general-purpose interface."[4]
- Dependency inversion principle
- One should "depend upon abstractions, [not] concretions."
- Single responsibility principle
-
Open-Closed Principle
- Defination : software entities (classes, modules, functions, etc.) should be open for extension, but closed for
modification - Strategies : make class opened for extension, and add new functionality to it without changing its source code
- Defination : software entities (classes, modules, functions, etc.) should be open for extension, but closed for
-
Programming terms
- Stateless widgets are immutable, meaning that their properties can’t change—all values are final.
- latency (how long does it take to get a reply from a server)
- polymorphism: same name, different logic
- All public methods of a Class are implicit interface and to change implicit interface to explicit interface, it will better to use interface-segregation principle (ISP).It states that no client should be forced to depend on methods it does not use.