andreisilviudragnea / clean-code Goto Github PK
View Code? Open in Web Editor NEWClean code
Clean code
It should be taken as early as possible
It can block multiple readers when cache is empty.
Two consecutive .map().map() calls on a Monad can be merged into one
This is the fastest way to a bug
Use a correlation id in each log statement.
Add description about status of correlation id support in different frameworks and languages.
Newer JDK can result in faster compilation times on Scala 2.13.8
In languages without modules, it is sometimes better to keep some implementation details as inner classes.
Tests inside the unit test class of a tested class should cover the whole tested class by themselves. This way, tests are decoupled too and the tested component can be easier moved.
Prefer to parse test input from human-friendly format to make tests easier to write and understand
pub fn num_trees_diff(n: i32) -> i32 {
fn num_trees(n: i32) -> i32 {
if n == 0 {
return 1;
}
let mut sum = 0;
for i in 1..(n + 1) {
sum += num_trees(i - 1) * num_trees(n - i);
}
sum
}
num_trees(n)
}
Jenkins:
Go to extremes with it. It will make your code better.
If only the difference between two function parameters is needed, use the difference directly as a single parameter.
Also add metrics to important logging places, because metrics are easier to track.
Tests can easily introduce a lot of duplication if not written carefully
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.