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

Simplicity matters #4

Open
veggiemonk opened this issue Dec 27, 2016 · 8 comments
Open

Simplicity matters #4

veggiemonk opened this issue Dec 27, 2016 · 8 comments

Comments

@veggiemonk
Copy link

Could we add something about the fact that a programmer should thrive towards simplicity?

It is implied when we say that we code for people, not machine.
It would be nice to make it explicit.

To emphasizes simplicity’s virtues over easiness’, showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path.

Source:
youtube 30 min: https://www.youtube.com/watch?v=rI8tNMsozo0
InfoQ 1h: https://www.infoq.com/presentations/Simple-Made-Easy
Slides (PDF): https://github.com/richhickey/slides/blob/master/simplicitymatters.pdf

I don't want to build a statue of Rich Hickey but what he says rings so true!

What do you think?

@Widdershin
Copy link
Owner

I still need to watch that talk, it's been on my list for a while. I'll watch it and then get back to you so that we're on the same page. 😄

@mo-g
Copy link
Collaborator

mo-g commented Feb 26, 2018

I would argue that simplicity is secondary to elegance.

The first often implies the second, but they are not mutually inclusive and the second takes precedence.

@veggiemonk
Copy link
Author

@mo-g
Definition of elegance:

n.   Refinement, grace, and beauty in movement, appearance, or manners.
n.   Tasteful opulence in form, decoration, or presentation.
n.   Restraint and grace of style.

Definition of simplicity:

n.    The property, condition, or quality of being simple or uncombined.
n.    Absence of luxury or showiness; plainness.
n.    Absence of affectation or pretense.

I don't understand how elegance takes precedence over simplicity. Could elaborate a bit more please ?

@mo-g
Copy link
Collaborator

mo-g commented Feb 28, 2018

@veggiemonk
And simple:

adj. easily understood or done; presenting no difficulty.

adj. plain, basic, or uncomplicated in form, nature, or design; without much decoration or ornamentation.

A piece of code can be simple, in that it is easy to understand and done, but be ugly and inefficient.

The first meaning of elegance in your definition is the most apt of the three - and code should express this in movement. A better definition is Wikipedia's definition of mathematical elegance:

The proof of a mathematical theorem exhibits mathematical elegance if it is surprisingly simple yet effective and constructive; similarly, a computer program or algorithm is elegant if it uses a small amount of code to great effect.

Note that simplicity is implied by elegance, but also requires effectiveness and constructiveness; so efficiency and productiveness. To reference 2., code is both art and mathematics (not to sound pretentious, but I see code as the application of poetry to mathematics) - the best code is a joy to read, displaying movement and rhythm.

@veggiemonk
Copy link
Author

Hi @mo-g,

Thank you very much for clarifying that the pursuit is not about elegance alone but mathematical (or algorithmic ?) elegance which seems less subjective.

mathematical (or algorithmic ?) elegance = surprisingly simple yet effective and constructive

It seems to reach the same idea from the talk that something is simple if it is not braided

Good luck on promoting this project. It's a good start 👍

@vassudanagunta
Copy link
Contributor

vassudanagunta commented Mar 5, 2018

I totally believe in KISS, but this Oath is about ethics, responsibility and humanity, not about how to code or code quality, except indirectly as ethics, responsibility and humanity demand.

@mo-g
Copy link
Collaborator

mo-g commented Mar 8, 2018

That's a fair point, @vassudanagunta. I still would not be opposed to an element of this being incorporated as part of 8. which is the only tenet that is more about standards of coding than standards of moral conduct. One could argue that striving for simplicity and/or elegance in code is a responsibility, as code that does not meet these goals is often harder to debug, more resource demanding (and consequently environmentally harmful) and likelier to lead to negative outcomes - but at the same time, much of this is generally implied by 2., 3., 4., 6., 7., 8. already and does not need explicit mention.

@vassudanagunta
Copy link
Contributor

vassudanagunta commented Mar 8, 2018

@mo-g But simplicity is not always better. This Oath is not the place for that debate. The Oath should respect people's judgment, and not become overly prescriptive.

#8 is in my opinion the weakest one, and it may make sense to remove it altogether. See #59.

If we keep it, "take ownership of my work's flaws" is the kind of thing that belongs in the Oath, not specific technical advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants