My Coding Code of Ethics

Quick and Dirty

I loathe licensing. All the code I write and share on my blog (unless otherwise noted) is public domain (wiki). In short, that means there is no license whatsoever, no limitations, and you do not need to ask permission. My writings, ideas, theories, opinions, observations, creations, projects, experiments, etc., however, are of course copyrighted to me (which is an entirely different thing altogether, respectively).

You owe me nothing, are not obligated to link to my site, give me credit, have messy looking licensing comments in your files, or worry about how and if you can implement code I’ve written into any project. You can use the code I share for whatever project you want, personal or commercial. Also, you can edit it, improve it, or completely butcher it however you see fit. Stop stressing and enjoy, be free. :)

Not convinced…

Way More Than You Want to Read

I had a discussion recently with a fellow blogger that opened my eyes to how different my standards and ethics for coding are from others, and actually managed to reaffirm what I believe. Now, this isn’t to say that others are wrong and that I’m right, I simply have a different methodology and idealism than most.

Clean and Valid Code

I’m a minimalist, in life and in profession. I simply don’t like giant hierarchies of formatted code.

Here’s a common example of the way CSS is written:

body {
  color: #333333;
  font-family: arial;
  font-size: 14px;

Why not just minified, I say:


Simple, clean, and entirely valid CSS.

Is it really that difficult to read? We could even go a step further and use CSS shorthand, but I’m just demonstrating the point about needless indentations, spaces, and breaks. This is also for speed, keeping file sizes as small as possible and the overall project as simple as possible is important to me. When you open it up in your favorite advanced text editor, you’ll have syntax highlighting and other tools on-the-fly to manage the code however you see fit if you’d like to format.

I do also value W3C Validation for HTML and CSS.

Although, I don’t live or die my the validation reports of W3C. If I know my code doesn’t actually contain errors that break anything, I’m not concerned if W3C throws a few warnings. Especially with WordPress (where there’s a lot of third-party stuff going on), it’s a lost cause. But, it doesn’t hurt to check your work.

Programmer Comments in Code

This is probably my most radical belief that most will disagree with. I hate programmer comments scattered throughout files. I refuse to add them to code I write and share. I want the very cleanest, minified code I can write and the smallest filesize and load-time possible.

Some comments take up half the filesize in other projects. I think notes, instructions, and other documentation should be handled on the author’s website. So, if anything, one simple comment at the very top with a link or maybe a simple readme file that can just be deleted after being read.

Licensing and Credit

Again, I hate licensing. Not any particular license, just the litigious nature of it. In rare circumstances, I’ll use licensing (GPL for example) where I’m required to or where there is really no other better option. If you had to peg me as anything, you might say I’m an open source guy, but I feel even that is too restrictive. Being a minimalist, I’m more interested in public domain. Beauty in its simplicity.

When I write and share code on my blog, I’m sharing it with others for them to do with as they like. They don’t have to keep copyright or license information onsite, they don’t have to link to me, they have absolutely no obligations or restrictions. When I share something, it’s usually because I couldn’t find the solution myself and had to write my own solution. I think, why waste the four hours it took me to figure this out for my one project when I can share the solution with the world so the next time someone else is looking for the same thing, it’s already done for them.

I don’t know if I would call it karma exactly, but I’ve found solutions so many times from other bloggers, that it’s just what you do. I don’t feel entitled to being credited either. I’m pretty sure there is no code on this entire blog that I’ve shared in an article, where I put a credit in the code. For any project that I have placed a credit in the past, WordPress themes for example, they’re not required, I even encourage people to remove credit links. My ethics come from using real-life analogies to find the truth of a situation.

For example, if there was a person in front of me at the grocery store paying in cash and they were a dollar short and I give them a dollar, are they now obligated to pass out a few of my business cards and mention me to a few people: “Hey, this candy bar I’m eating was made possible by Bryan Hadaway.” No! That’s ridiculous. I had the opportunity to be helpful and was, because I could.

I still give hitchhikers rides (yes, in this day and age). Does that thrill me to no end and make me feel that I’ve done my good deed for the day? Not really. My thoughts are: “Eh, I’m going this way anyway… (and probably remembering all the times I got a ride back in the day)” and I barely even continue thinking about it after I’ve dropped them off.

To be clear, I should say, to all the amazing programmers, developers, and designers out there, by all means, credit and license your hard work however you see fit. I have no argument with you and no intention of trying to push my methods on others. In fact, I’m a strong believer in there being no right way or wrong way to do anything. I simply have my own standards for ethics of coding and licensing.