Skip to content

Instantly share code, notes, and snippets.

@Chadtech
Last active August 29, 2015 14:26
Show Gist options
  • Save Chadtech/7de2291c7a76596e5c0a to your computer and use it in GitHub Desktop.
Save Chadtech/7de2291c7a76596e5c0a to your computer and use it in GitHub Desktop.

I have been revisiting some of my old code, and naturally, I wonder if I have written good and readable code. I have settled on my own style, that is original. It being original, makes me especially doubtful of it. So I am asking you, is this style any good? And if not, why not?

My style has these two properties:

0 Variable names are as descriptive as possible, making them very long, and often complete sentences of camel case words.

1 Areas of code are seperated by large sections of comments that describe how the code works.

Here is an example: code style example

Here are some propositions I believe regarding good code:

0 Optimizing code, and making it readable, often come at the cost of each other.

1 Making a variables name simple, and making it fitting, often come at the cost of each other.

2 It is important that code functions, and it is important that code is understood. Making the code understood can be obtained by explaining it. By providing a proper explaination in the form of english language comments, no sacrifice is made to the mechanics of the code itself.

What do you think?

@pogden
Copy link

pogden commented Jul 28, 2015

First thing, try to use Markdown's code blocks to show example code rather than embedding an image. The image is inaccessible to readers using text only browsers, screen readers, very high or low resolution displays, high contrast displays, offline devices or devices on work or school networks that block Imgur.

See my for a example of how to do this.

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