Skip to content

Instantly share code, notes, and snippets.

@santosrai
Last active March 18, 2020 00:51
Show Gist options
  • Save santosrai/14a43e1eb181bdde64b96cd619d88287 to your computer and use it in GitHub Desktop.
Save santosrai/14a43e1eb181bdde64b96cd619d88287 to your computer and use it in GitHub Desktop.
EveryProgrammerShouldKnow

EveryProgrammerShouldKnow

This is my note to level up my programming capabilities.

2019

  • 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."
  • 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
  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment