Why do I write?

I was once given some excellent advice on staying motivated during anything you want to commit yourself to; this wasn’t restricted to writing and can invariably be applied to most other things.

You need to decide within yourself, then put onto paper, the reason why you do it. Answer the question within your heart and keep the answer close. Read it when you lose focus or need a boost. It acts as a safety net, and keeps your reasonings in the fore of your mind.

So that’s what I set out to do here. Decide why I want to write. It’s easier said than done, though. How do I eloquently describe my reasonings for something that I hold so close to me?

That is the question I mulled over whilst writing this post. It seems too frivolous to simply answer it with “I enjoy it.” I need to dig deeper. It’s this level of self-reflection that really puts you in a position to increase the passion you have for the activity tenfold.

My Self reflection

I guess I really enjoy stories, and that is the baseline for why I write. Don’t worry, I’m going to elaborate…

I’ve always been a creative person and I love creating something new, something that doesn’t yet exist. I’m a web programmer by trade, so this urge to create is mostly satisfied in a large part by my job, but I can’t simply turn this urge off at 5:00pm when I leave to office. So, to that, I do quite a lot at home that will also satisfy me. A little home-coding, some gaming, I even (infrequently) create recipes whilst I cook. It’s the creation of things that I enjoy; I don’t usually have a preference what that thing is, provided it’s new and fresh.

With regards to my other interests, such as gaming, reading, coding etc, and in mirrorring House M.D’s sentiments, whom in the show ‘House’, only takes on medical cases that interest him – I usually only read stories or play games that really interest me. It’s the ‘getting lost’ part that really thrills me. Being lost in a world that dismisses my pre-conceptions excites me; which is why my predominant genres for reading material are Fantasy, Sci-fi and Horror. Couple this with my passion for creating and I have a tremendous force within me to make stories of my own; to craft and develop worlds I feel would actually interest me as a reader/player.

Had I developed the skills to build games from scratch, I may have veered my interests toward game development instead, however, I had an innate understanding for the written word so it was the natural choice to hone my skills.

I remember writing stories back when I first had a computer, back when I was a child; Creative Writer 2 the program was called. Not only was it a word processor, but you could add all manner of crazy backgrounds onto your pages, and the clip-art was second-to-none. I can’t tell you how much money I wasted on ink for my parents. They silently cursed me, but still supported me, I like to believe.

Back then, I had tried Judo, Karate, Tae Kwon Do, learning Guitar, Piano, Violin (briefly), playing Rugby, Basketball and a number of other endeavours, but now that I think about it, my writing pre-dated those activities, and still exists today. My father used to say “You never stick with anything.” Though I had, and do; he just hadn’t seen it.

Flipping this concept, I thought I’d see if there’s a way I could articulate why I don’t write, with the goal of getting me to engage with writing more frequently; but everything I could come up with felt like a brush-off excuse. I don’t have the time, or I’m tired when I get home from work, or my life gets in the way. None of them feel like ‘real’ reasons, ergo, I am to assume that I have no reason for not writing, and a multitude of reasons for writing.

I write because I can, and I write because it is very much part of who I am.

Why do I write?

Get Rid of That Mary Sue Character

Something that I see often discussed on writing forums, particularly on r/writing is this concept of a Mary Sue. Mary Sue characters can literally force your readers to put the book down, completely; akin to Deus Ex Machina, they present your ideas in a way that ‘feels like’ a weakness as a writer.

WHAT IS A MARY SUE?

In short, a Mary Sue is a ‘perfect’ character. As we all know, there is no such thing as perfection. They feel like, but aren’t always, representations of the author themselves; you’ll see this concept appear most frequently within fan fiction but can, unfortunately extend to more mainstream fiction.

It boils down to a single character being ‘too perfect’. They always have the answer, are loved by everyone, are able to overcome huge obstacles and remain in favour of everyone they meet. They are beautiful, without ever a blemish, even in cases of a catastrophic storyline. They can win any conflict with their unbeatable storyline tools or character traits.

A very notable example of a Mary Sue is Bella Swan from the Twilight franchise. This character is a perfect example of an Author Surrogate. Where the character was written to represent the author.

All this being said, the definition of a Mary Sue is contentious. It often differs with who you ask. Some circles insist that they should feel like an Author Surrogate, others feel like a Mary Sue should be a God-Mode character (has unbeatable powers). Some restrict Mary Sues to Female Characters, some use the term to represent both genders. That being said, regardless of your definition, they are all badly written characters.

AVOIDING MARY SUES

Since the concept can have a fluid definition, I’m going to discuss some techniques that are not strictly for avoiding them, but rather for making your characters feel more real. Obviously, you don’t need to use all of these on every character to make this work, since that would be overkill, but fitting some of these in here and there will make your story far more well rounded.

GIVE HER FLAWS

Nobody is perfect. A general rule is that if you’re giving your character a positive trait, then also give them a negative one. It’s totally okay if your super-human hero is also a real bastard when it comes to retaining friendships. It’s fine if your sneaky thief is also unjustly paranoid. It’s even better if your perfect wife is having an emotional crisis, but is hiding it from her loved ones.

Look at all the best-known literary characters, and you’ll find they have negative and positive traits. When you think of Mr Darcy from Pride and Prejudice, it’s easy to imagine this perfect man who all the women swoon over. However, the reality is that Pride and Prejudice is very well written, and as a result, you’ll find that even Mr Darcy has his vices. See the below quick character summary from Shmoop.

Mr Darcy Character Analysis
Strengths: Wealthy, intelligent, sexy, generous, kind, overcomes pride.
Weaknesses: Proud, quick to judge, elitist, holds grudges, condescending

It’s these negative traits that make him memorable. They make his character real. A character without flaws is not memorable.

ALLOW HER TO MAKE BAD DECISIONS

Bad decisions present an easy way to add conflict, but also allows you to present your character in a well rounded way. In the first instance, it allows your readers to understand that your character isn’t perfect, after that, you can play with the consequences of this bad decision, to either add even more depth, or perhaps to add an additional conflict to your storyline.

In ‘The Lies of Locke Lamora’ by Scott Lynch, Locke, the protagonist, when he’s a child, manages to figure out a way to punish a bully. The bully and his friend as a result are slaughtered – strictly not the intended course of action. Lamora only wanted to see him reprimanded, but now has to come to terms with the fact that he was instrumental in the deaths of two ‘innocent’ lives. It’s this event that shapes his development, and his ability to overcome his faults are very much part of what makes him a lovable character.

OTHER PROTAGONISTS DISLIKE HER

Not everyone is likeable. Picture an FBI agent working with a local Police Department. Your two main characters have different ways of working and so, they frequently butt heads on methodologies. This relationship degrades and they begin to really dislike each other. They are on the same side, yet they dislike each other. This is okay, and actually a pretty good sign of great writing.

It’s a ridiculous notion that your character is loved by everyone. In a world where everyone’s personalities, methodologies and thought processes are different, it stands to reason that not everyone will look favourably on your character.

The important thing here is that disliking your character doesn’t mean that they are required to be an antagonist. They are able to share the aims and the main story arc may still be in pursuit of the main goal, but conflict is what makes these relationships real. Give them this type of conflict.

GIVE HER A DISCERNIBLE WEAKNESS

I’m not talking Kryptonite here, not the single thing that can bring her down. I mean something that the character cannot do. Your character is not superhuman, and even if they are superhuman, limiting them is what makes them relatable.

Having a character that can achieve anything, or do anything is going to be the opposite of what your story needs. Overcoming extreme obstacles is what makes your story interesting, don’t ruin it by giving your character all the abilities at the beginning. If she simply must have the ability; let her earn it.

A flaw, is concerned with their actual character traits, whereas a weakness is more of an ability impairment. Give your character an infirmity, or make them weak, or make them dim-witted. A character with weaknesses is relatable because we all have weaknesses and these weaknesses are what make us who we are.

To summarise

Perfection is overrated, make your characters weak, abrasive, and condescending, one who makes bad decisions, who alienates those around them, but has to overcome these issues in order to complete your story arc. This makes your characters real.

Get Rid of That Mary Sue Character

How Not To Be A Development Dick

Having worked with PHP, and within the web development industry for >10 years now, I’ve got a fair idea about what I like to do and what I like to see. However, I can understand and respect different standards and development methods. What I struggle with, however, is others being Development Dicks.

What is a Development Dick?

A development dick is someone who has a tunnel-vision of the project goal. They don’t see the bigger picture. They go in, do their development and they leave. For some, an admirable trait, but you can have this kind of dogged determination and drive without being a dick. This concerns directly how their development affects others, and expands to development standards.

Warning: What you see below is a hugely trivial example, just used to illustrate my meaning.

See the below class method:

protected function getValue($x, $y, $z)
{
    return number_format(($x + $y) * $z, 2);
}

This is being a development dick.

Y’know why? Well, perhaps you’d like to answer a few questions about this method; pretend you’re not the developer and answer them only with the information you have above:

  1. What the fuck is $x?
  2. What the fuck is $y?
  3. What the fuck is $z?
  4. What data type is returned? (without looking at PHP.net)
  5. Why is the calculation structured in that way?
  6. What’s the purpose of the method?
  7. Who wrote it? Who can I ask for help with it?
  8. How do I modify it safely?

By now, you should see my point. If you see this in a code review, you need to stomp on it and stop it from happening. In truth, the method above works and all tests pass; but this isn’t about having bad technical skill. I believe being a good developer doesn’t just stop at your ability to get the job done. It extends beyond this and accounts for all the other stuff around completion of a task.

I’ve emboldened question 8, because this is pertinent one. Without being able to modify it safely, other developers are impaired in their ability to do their job; all because you wanted to shave a few seconds off your development time.

In a previous position, a colleague would say, “Why have you written a method for that, one already exists. Why didn’t you just use that?” Then when I’d ask him to point it out to me, it would look like the above. There is no way I could possibly know that the above is what I’d need.

Let’s list the steps below that I would need to go through in order to answer some of the questions:

  • Questions 1-3: Grep for instances where the method is actually used and inspect the input variables to it.
  • Question 4: Visit PHP.net to find out the return data type of number_format
  • Question 5: No idea …
  • Questions 6: Grep for instances of the method’s use, to learn more
  • Question 7: Visit the repository and look at the ‘blame’ for the method
  • Question 8: Rely on author

Huge amount of work! Keep in mind that this is a tiny, trivial example. Imagine if the method is more complex. Gives me the shivers.

Not being a dick

It’s not hard, nor is it an art-form. Let’s see a near-perfect example of the same method a above:

/**
 * Calculates a Price using the Unit Price, Tax and 
 * Quantity of Product
 *
 * @author Dan Hanly <danhanly@gmail.com>
 *
 * @param float $unitPrice
 * @param float $tax
 * @param int $quantity
 * @return string Formatted Price
 */
protected function calculatePrice($unitPrice, $tax, $quantity)
{
    $productPrice = $unitPrice + $tax;
    $totalPrice = $productPrice * $quantity;

    return number_format($totalPrice, 2);
}

Functionally identical. Dick index: 0.

Maybe this is overkill, however you immediately know the answer to every single question that I posed above.

  1. $unitPrice is a float
  2. $tax is a float
  3. $quantity is an integer
  4. return type is a string
  5. The calculation is structured to determine the overall product price before multiplying against the quantity
  6. The purpose of the method is to calculate a price
  7. I wrote it, you have my email if you need clarification
  8. You are now able to modify it safely because you have all you need to proceed

It’s important that this information is available to other developers. In fact, it’s important that this information is available to yourself as well. Nobody is good enough to remember a tiny method like this 6 months after it’s been developed. Being a development dick harms yourself as well as other developers.

How Not To Be A Development Dick

Signalert: Customisable & Extensible Notifications – Alerts Exactly Where You Need Them

Some time ago, I wrote that it was difficult to get into the Open Source community. Well, today, I’m officially announcing the release of my first open source project.

Signalert

In my day-job, we required a solution to easily store and utilise alert notifications. The present method only allowed us to trigger alerts from the immediate view stack, but sometimes, we may be working on a deep-dark part of the process, not related to the current view, and we may wish to trigger one.

Thus, I built an in-house solution that allowed me to easily post notifications from anywhere in the backend, and render them on the front end. This was called, simply, ‘Notifications’ – because I’m an inventive guy.

However, this didn’t sate my appetite for developing a full notifications system. I looked at areas in the current architecture that could do with a re-work, and areas where I could expand to give new functionality, and I conceived Signalert.

What does it do?

It allows you to quickly, and simply, post messages to a notification stack, and retrieve them at any point within your view.

What’s the Unique selling point (USP)?

Customisation.

By default, it uses the standard PHP Sessions to store the data, but this can quickly and easily be expanded to fit within your architecture if, for example, you use Memcache, Redis, or even Database storage, instead of the PHP Sessions. I’ve provided architecture for you to add your own Storage Drivers, which dictate how alerts are stored, and how they are arranged for rendering.

Also, as well as the Storage medium, I’ve allowed customisation of the Renderer, which prints it to the screen. Do you use Bootstrap, Foundation or any number of other layout frameworks? I’ve provided architecture for you add your own Renderers which dictate how alerts are printed out to the screen.

Learn more about Signalert

Signalert: Customisable & Extensible Notifications – Alerts Exactly Where You Need Them

This love does not compute

I don’t ever lie when I tell you,
“I love you with all my heart”
I say it with all possible truth,
but now it comes with a caveat.

You see, with what we’ve done,
with what we’ve created,
I’m forced to split with another one,
but you, my dear have not been downgraded.

To me, as a logic man,
the maths does not compute.
Loving you so completely,
loving another so supremely…
I have only one heart to give.

This is not a poem of adultery
Or an admission of wrongdoing,
Because for the love of this ‘other’
I know we both compete.

Since she came into our lives
I’ve been trying to articulate
how I can possibly arrive
At a conclusion I can calculate.

100% implies totality
but now, it is a duality.
Our daughter is my everything.
You are my everything.

This love does not compute

Daunting Open Source Contributions: How to Take the Plunge

I’ve always wanted to contribute to Open Source projects; wanting to be ‘that guy’ whose GitHub profile is spotted with stars and sports a healthy looking contributions graph.

Healthy Contributions Graph
Healthy Contributions Graph (@taylorotwell)
My Contributions Graph
My Contributions Graph (including private repository contributions)

However, I like to think that there are a couple of key areas which prevent me from contributing. Perhaps prevent is a bit of a strong statement; I would like to use a fairly arduous metaphor here. On the other side of the river, is some lovely, green grass and a perfect place to build a house, raise a family, and all of that jazz (representative of building my open source contributions career); however, the only way across the river is via a shaky, possibly rotten bridge, that is suspended over a 200ft gorge (representative of my reasons for not contributing just yet). I’m not ‘prevented’ from contributing, but there are some reasons why I haven’t just yet. You have my thanks for bearing with me over the course of that analogy.

Intimidation

I’ve read the guides (GitHub and jQuery) to help ‘onboard’ myself to Open Source, and each of them describe the mechanism for contributing, but both seem to skirt around the most important piece of advice. How do I deal with people?

I’m perfectly familiar with how to interact with people online and in person, I’m not particularly socially anxious, however, contributing to someone’s project is still something that deeply intimidates me. It’s an area of life that makes me question myself constantly, like no other.

Seth Ross (Author of Unix System Security Tools) devised a list of rules pertaining to security in Unix. Rule 6, I felt, perfectly encapsulated my feelings on contributing to Open Source projects:

There’s Always Someone Out There Smarter, More Knowledgeable, or Better-Equipped Than You

How does this pertain to Open Source, I hear you ask. Well, the concept that there are always people better than me, is one I often keep close to myself as a way to stay humble, and enforce my always-learning mental attitude. Though in this case, it does present me with a slight case of anxiety. What if the Project Owner, is this person who is better than me, and this bug I’ve identified, isn’t simply a bug, but a feature, and I’ve simply misunderstood. I’m not going to spend time fixing and raising a PR for this bug because I have an inbuilt fear that I’m actually fairly stupid, and my code, nor my assumptions aren’t up to scratch.

In all other areas of life, I like to think I’m fairly confident. Though in my profession, I try to keep myself learning, so that I can always improve. This, in some instances, breeds a case of “I’m not good enough”, and this is the main cause behind my intimidation with working in Open Source projects.

Controversy

All I hear about these days is about toxic open source communities, unwelcoming or downright abrasive collaborators, sexism, minority exclusion and all sorts of other nasty behaviour. Open Source contributor Lennart Poettering has recently said the below:

If you are a newcomer to Linux, either grow a really thick skin. Or run away, it’s not a friendly place to be in. It is sad that it is that way, but it certainly is.

Now, Linux isn’t my area, but I’ve heard that other Open Source communities are the same; and with the prevalence of the #phpdrama hashtag on Twitter, I’m sure my chosen area of expertise suffers from similar issues. Even community leaders are guilty of breaking into full-blown, epic, public argument, I’d hesitate to figure out what some of the slightly-more private discussions would have been like within GitHub Pull Requests/Issues.

Despite the obvious benefits to contributing, I can’t help but feel averse to joining such a community, for fear of being grouped with these people. I am, after all, also a western, white, straight, male – I’m the demographic that, straight up, causes all of this nonsense.

I have to add, just so we’re clear, I’ve not experienced any mistreatment in my (very) limited experience of contributing so far. The issue is that I know this stuff is happening, and I need to do my best to stay out of it; that to me, is a fairly daunting prospect.

Just do it

Hopefully, I can avoid litigation from Nike for this section’s title. When I was six years old, there was a fairly steep drop on a small mountain bike track near my house. I remember sitting atop my bike and agonising over the drop; running through all the possible scenarios of injury, or death. The longer I stayed at the top, the worse these anxieties became. Then what happened, was I became anxious for what people would think if I couldn’t do it. If I backed out, what would my friends say? This catch-22 situation is similar (though less emotionally driven) to my struggles with contributing to Open Source.

You want to know the outcome?

I sucked it up, and just did it. I flew down that drop, completely injury free. You know what, I ended up riding to the top and dropping it again, and again and again; I thoroughly enjoyed every moment.

I now need to apply this technique to open source contributions and just get in there and start contributing. Some things will go wrong, it’s inevitable, but I need to overcome those and drown them in a sea of successes.

Daunting Open Source Contributions: How to Take the Plunge

The Great Dictator

I’m sorry, but I don’t want to be an emperor. That’s not my business. I don’t want to rule or conquer anyone. I should like to help everyone if possible- Jew, Gentile, black men, white…

We all want to help one another. Human beings are like that. We want to live by each others’ happiness, not by each other’s misery. We don’t want to hate and despise one another. In this world there is room for everyone. And the good earth is rich and can provide for everyone. The way of life can be free and beautiful, but we have lost the way.

Greed has poisoned men’s souls; has barricaded the world with hate; has goose-stepped us into misery and bloodshed. We have developed speed, but we have shut ourselves in. Machinery that gives abundance has left us in want. Our knowledge has made us cynical; our cleverness, hard and unkind.

We think too much and feel too little. More than machinery ,we need humanity. More than cleverness, we need kindness and gentleness. Without these qualities, life will be violent and all will be lost. The aeroplane and the radio have brought us closer together. The very nature of these inventions cries out for the goodness in man; cries out for universal brotherhood; for the unity of us all.

Even now my voice is reaching millions throughout the world, millions of despairing men, women, and little children, victims of a system that makes men torture and imprison innocent people.

To those who can hear me, I say “Do not despair.”

The misery that is now upon us is but the passing of greed, the bitterness of men who fear the way of human progress. The hate of men will pass, and dictators die, and the power they took from the people will return to the people. And so long as men die, liberty will never perish.

Soldiers! Don’t give yourselves to brutes, men who despise you and enslave you; who regiment your lives, tell you what to do, what to think and what to feel! Who drill you, diet you, treat you like cattle, use you as cannon fodder!

Don’t give yourselves to these unnatural men—machine men with machine minds and machine hearts! You are not machines! You are not cattle! You are men! You have the love of humanity in your hearts! You don’t hate!

Only the unloved hate; the unloved and the unnatural.

Soldiers! Don’t fight for slavery! Fight for liberty!

In the seventeenth chapter of St. Luke, it’s written “the kingdom of God is within man”, not one man nor a group of men, but in all men! In you! You, the people, have the power, the power to create machines, the power to create happiness! You, the people, have the power to make this life free and beautiful, to make this life a wonderful adventure. Then in the name of democracy, let us use that power.

Let us all unite.

Let us fight for a new world, a decent world that will give men a chance to work, that will give youth a future and old age a security. By the promise of these things, brutes have risen to power. But they lie! They do not fulfill their promise. They never will!

Dictators free themselves but they enslave the people!

Now let us fight to fulfill that promise! Let us fight to free the world! To do away with national barriers! To do away with greed, with hate and intolerance!

Let us fight for a world of reason, a world where science and progress will lead to all men’s happiness.

Soldiers, in the name of democracy, let us all unite!

The Great Dictator