Guidelines for programming languages, git workflows, etc.
hammerlab / style-guides Goto Github PK
View Code? Open in Web Editor NEWGuidelines of the Hammer Lab
Guidelines of the Hammer Lab
I find
match force_reload with
| false -> Target_cache.get explorer.target_cache ~id
| true -> return None
more confusing than
if force_reload then
return None
else
Target_cache.get explorer.target_cache ~id
or
if force_reload
then return None
else Target_cache.get explorer.target_cache ~id
which is my preferred version.
I've become a big fan of vertically aligning data-structure definitions and let bindings. So I strong prefer:
type exploration_state = {
build_process_details : bool;
target_filter : (Target.t -> bool) * Log.t;
current_target : Target.id option;
condition_details : bool;
}
let create_state () = {
build_process_details = false;
condition_details = false;
target_filter = (fun _ -> true), Log.(s "No-filter, see them all");
current_target = None
}
to
type exploration_state = {
build_process_details: bool;
target_filter: (Target.t -> bool) * Log.t;
current_target: Target.id option;
condition_details: bool;
}
let create_state () =
{build_process_details = false;
condition_details = false;
target_filter = (fun _ -> true), Log.(s "No-filter, see them all");
current_target = None}
similarly, I like
let foo a b c =
let x = a () in
let xx = b x in
let y = c xx in
...
as opposed to
let foo a b c =
let x = a () in
let xx = b x in
let y = c xx in
I find it easier to read code as performing a function this way. I know that I resisted this style for quiet some time in my own code, but now find it very helpful. Let me know what you guys think!
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.