Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples of maths laws being useful in software development #27

Open
JimmyHoffa opened this issue Apr 16, 2016 · 0 comments
Open

Examples of maths laws being useful in software development #27

JimmyHoffa opened this issue Apr 16, 2016 · 0 comments
Assignees

Comments

@JimmyHoffa
Copy link
Contributor

JimmyHoffa commented Apr 16, 2016

Small explanation of the law in a math (function|operator), and a small code example of when such a law can be useful to have a code function meet

for instance: Small explanation of the law of associativity, and a snippet showing how having the null coalesce function associative gives you reliable chaining functionality; in JavaScript for instance:

var getPerson = function(personId) {
    return personRepo.get(personId, this.companyId) ||
           personRepo.get(personId) ||
           personRepo.getNewPersonTemplate();
}

repeat for laws of commutativity, reflexivity, transitivity, and any other maths laws that come to mind with perhaps a paragraph explaining why this law comes in handy for certain scenarios/what scenarios it comes in handy for

@Ixrec Ixrec self-assigned this Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants