“Good code is written so that is readable, understandable, covered by automated tests, not over complicated and does well what is intended to do.”
https://engineering.intenthq.com/2015/03/what-is-good-code-a-scientific-definition/SmartDB is an Oracle-centric methodology for applications that use the Oracle Database. Many of the concepts can be generalised across all database technologies. PinkDB is a similar cross database methodology.
Design is everything. #SMARTDB philosophy these days (when everyone is forcing you to use cloud) is more important than ever before.
If your application is chatty and is using a lot of packets to solve the same problem – you are not cloud-ready.
Comments explain the code’s purpose
Comments explain the code
Comments highlight the potential gotchas
Comments provide landmarks for future work
"FUNCTIONS SHOULD DO ONE THING. THEY SHOULD DO IT WELL. THEY SHOULD DO IT ONLY."
Robert C. Martin"Functions should either do something or answer something, but not both."
Robert C. Martin“Test input for plausibility and validity"
Brian Kernighan and P.J. Plauger"Never trust user input"
Ian Darwin"The purpose of software engineering is to reduce complexity, not to create it."
Pamela ZaveThe goal of DRY is to reduce repetition of code. If you need to call it more than once, make it a Function. If you need to call it more than once and in multiple programs, consider a "microservice" rather than repeating the code in each program.
Don't bloat your code with code you don't need yet. Don't put in a function that nothing calls yet. Add that function if/when that functionality becomes a concrete requirement.
"SRP says to keep together things that change for the same reason, and seperate things that change for different reasons. Divergent change occurs when you group together things that change for different reasons. Shotgun surgery happens when you keep apart those things that change for the same reaon."
Robert C. Martinhttps://sites.google.com/site/unclebobconsultingllc/getting-a-solid-start"One of the good examples of SoC is the MVC pattern where data (“model”), the logic (“controller”), and what the end-user sees (“view”) divided into three different sections and each part is handled independently. Saving of data to a database has nothing to do with rendering the data on the web." (3)
Each unit should have only limited knowledge about other units: only units “closely” related to the current unit.
Each unit should only talk to its friends; don’t talk to strangers.
Only talk to your immediate friends.
"The fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else (including its subcomponents), in accordance with the principle of "information hiding". It may be viewed as a corollary to the principle of least privilege, which dictates that a module possess only the information and resources necessary for its legitimate purpose." (4)
"a component of a system should behave in a way that most users will expect it to behave, and therefore not astonish or surprise users. The following is a corollary of the principle: If a necessary feature has a high astonishment factor, it may be necessary to redesign the feature." (5)
"a facade is an object that serves as a front-facing interface masking more complex underlying or structural code." (6)
Sorting
Recursion
Searching
Graph Algorithms
Tree Algorithms
Dynamic Programming
"Refactoring consists of improving the internal structure of an existing program’s source code, while preserving its external behavior." (1)
"Refactoring does “not” mean: rewriting code, fixing bugs, improving observable aspects of software such as its interface" (1)
Factoring is "organizing code into useful fragments" (2)
Premature optimization is the root of all evil in programming.
Donald Knuth