From 1f7a99686f216a71df553286395c1f947881c825 Mon Sep 17 00:00:00 2001 From: Morgan Date: Mon, 6 Nov 2017 11:37:24 +0100 Subject: [PATCH] more clean code tips, mostly about functions --- PRINCIPLES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PRINCIPLES.md b/PRINCIPLES.md index 5fc8096..261922a 100644 --- a/PRINCIPLES.md +++ b/PRINCIPLES.md @@ -76,6 +76,9 @@ * Names : Names should be at least pronounceable. Don't abbreviate ! Unless it's a basic business concept, like VAT * Names : should be consistent and unique (synonyms confuse). * Names should have meaningful context. eg: order.customerFirstName. But don't repeat yourself (DRY) : Order.~~order~~CreationDate + * Functions should be small : 5-10 lines, ... or at least should be understandable in 5 sec no more. + * Functions do one thing + * Functions have max 2-3 parameters ## personal thoughts * [MorganGeek](https://twitter.com/MorganGeek/statuses/420907517934178304) - Problem solving / Productivity : Good programmers write code after they found the solution. Un bon programmeur ne commence à coder qu'après avoir trouvé une solution.