DEV Community

Abdelrahman Ali
Abdelrahman Ali

Posted on • Edited on

1 1

Short Technical Tips / Highlights for Better Design and Coding

Pay high attention to choosing the right name for every thing [variable, method, class, test, package, .. ]

  • Apply SRP principle in all levels
  • Favor Composition over Inheritance
  • The OPP and Reflection don't mix
  • Avoid using Static class
  • Follow "Tell, Don't Ask" principle
  • Abstract the commonality and eliminate redundancy
  • IF-Else is potentially anti-pattern
  • The better, The code-base evolve diagonally (More details: https://abdo-emad.medium.com/tall-and-thin-or-wide-and-short-software-fce3ad2e1826 , https://www.linkedin.com/pulse/design-maintainability-insight-beauty-abdulrahman-gaber)
  • We will not hit the functionality from one shot, develop it in rounds "in Agile" [Happy path scenario, enhancement, fault scenario, boundaries, ..]
  • Study the anatomy of the problem carefully. The analysis should not only from technical perspective, do the analysis semantically.
  • Diagram the design then document the achieved implementation and learnt lessons
  • The refactoring gives a new live to the solution
  • Always align
  • Avoid hard coding and strings, develop over configurable business rules and meta-data.
  • Design for Testability
  • At the end, It depends!

open question: We should ask ourselves when writing a code, to what extent will this code live or survive? Have we taken into account the possible changes? How will the code absorb a thrown stumbling-block and afford the growth?

"The first principle of software engineering isn't DRY or YAGNI or one of the SOLID principles; it's common sense."
-Tim VanFosson

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay