Creative Programming
Creative Programming
Creative Programming
net/2008/07/programmer-creativity-boost/
The common stereotype for programmers is this: nerdy, pocket-protector wielding, and
very, very boring. One doesnt typically link a programmer as a creative individual.
However, this couldnt be farther from the truth.Working with code is one of the most
creative jobs one can have.Programmers have to balance two very different worlds: a
world of structure and a world of imagination. They create abstract concepts using very
structured programming languages (like PHP or Java). Its not an easy task.
I only know this because Ive recently been brushing up on a bit of my PHP skills
building some interesting Web sites (Ill keep you all posted, dont worry). Ive found that
programming is actually a great exercise in creativity. Here are a couple reasons why:
Programming gives ultimate control. Creating something from nothing is possibly the best
example of creativity. The ultimate control over software or web site that a programmer has is
perfect for taking the application to any direction that they wish.
Many ways to do one thing. Programmers have to essentially build a framework for the web
site. Theyre laying the foundation for something that, up until that point, is just an idea. The
programmer uses a wide palate of tools and methods to find
Sometimes creativity is limited by assumptions. New solutions arrive when we tear down
assumptions and start with fresh perspectives.
4. Do it for fun
If you know any programmers, theyre constantly building something. Even when theyre
done for the day on work-related projects, theyll spend hours of time working on fun
projects for themselves. Their work is also their hobby.
Continually mulling over new ideas and solutions is something that shouldnt be a chore.
It should be something that you find yourself doing constantly, like a reflex. And it should
excite you.
5. Never stop testing ideas
Programmers are constantly benchmarking code to make sure that its as efficient as
possible. Even the smallest change can bring a program or Web site to its knees, so
constant testing and improvement is important to any bit of software.
Ideas should be tested rigorously and refined on a consistent basis. Your ideas will
change over time, it just depends how much. Constantly evaluating them and just plain
thinking them through is a great way to benchmark your idea.
6. Find a passion
youve ever spent more than two minutes talking with a programmer
about his work, youll find out very quickly that programmers have a passion for what
they do. They eat, sleep and breathe programming.
Do you have a passion for your ideas and projects?
7. Master your tools
Programmers constantly improve their knowledge and usage of their tools. A great
coder keeps tabs on software and is constantly finding ways to improve his usage of
them. Youll seldom find a programmer who doesnt tweak his toolbox regularly.
No matter what your skill set, youre limited to your skill with the tools you use to create.
The more of an expert you are with your tools, the more youll be able to create.
8. Start making abstract associations
Would people care about what other people are doing right now?
The people behind projects like Skype, Google Docs and Twitter all have one thing in
common: They fused seemingly abstract concepts together.Taking what-ifs and
testing them is a great way to start thinking of things in a different, more creative
light.
9. Think of structure as a tool, not a limitation
People associate creativity with taking a giant, blank canvas and letting our ideas flow
without any sort of limiting structures. However, theres a huge problem with this type of
thinking: Its a great big creativity myth.
See, limitations are everywhere. We cant avoid them, we can only hope to work with
them. A programmer embraces the limitations of his programming language or tools and
works around them. These limitations help him as they make a foundation to work
from. Sometimes discovering a new workaround will lead to an even bigger idea.
Necessity is the mother of invention.
10. Dont rule anything out until you try it.
Your kindergarten teacher was right: There is no such thing as a stupid question. If
youre adhering to #3 and dismissing all assumptions, you cant be certain its not going
to work until youve tested it. How do you know it wont work unless you try it? You might
be surprised. Even if the proposed solution doesnt work, it may help you find a solution.
Sometimes its just best to start with a prototype and try it out. If your prototype doesnt
work, then trash it. If it does, youll have stumbled upon something that just might work.
11. Always look for a simpler and more elegant solution.
A good programmer is one that understands that finding the simplest solution is always
going to be better. Complicated solutions lead to complications. A practical approach
to programming always works best in the long run.
Our ideas sometimes become too complicated. We get caught up in the novelty of the
idea that we ignore how practical it really is. The simplest way to solve a problem is
often the best way to solve a problem.
12. Dont be afraid to build off the code of others.
The beauty of the Internet is that the solution your looking for has probably already been
done by someone else. When building a new site I almostalways use pre-existing open
source code. Why recreate the wheel?
Putting a great idea into motion doesnt mean you have to start from scratch to create it.
Use existing ideas and turn them in to something better.Sometimes a great idea is
only modifying something thats already been done. Gmail is a great example. They
reinvented email by adding useful features to traditional email.
13. Dont be afraid to collaborate.
Some of the best coding or any creative projects for that matter are done not just
by one coder but by many excellent people inspired to work toward the same goal.
Assemble a great team, use the most brilliant ideas no matter who they come from, and
let everyone contribute.
14. From the very basic, create the beautiful.
Programmers often use some very basic code over and over, and while those small bits
of programming language arent necessarily beautiful in and of themselves, they can
come together to create a final product that is amazing. No matter what creative project
youre working on, pay attention to the details, but most especially pay attention to the
effect those details have on the overall picture.
Apparently Im not the only one who thinks context is vital. While most of my thoughts
have to do with capturing ideas and organization, there are other areas where context is
crucial. Lets take programming for an example.
I know only enough about programming to be dangerous. (And I dont mean dangerous
in a James Bond way. Im more like a danger to anyone who has to use the code after
me. Its not pretty.) But I do know this: to be a productive programmer of any kind, you
have to have visual reference points you can quickly add and access when working
through the code. Otherwise you spend most of your time trying to figure out where you
are and what the heck youre trying to do.
One way of adding more context to code is by comments. Commenting code is a great
way to reference sections of code for yourself and anyone else who is going to look at it.
The Rampant Coyote has a unique approach to writing code: he actually adds the
comments first. Or a broader view of it could be that he adds the context of what hes
working on before he begins writing the actual code. Why?
The technique is simple: When I create a function / method / whatever, I create a stub, and I
write the details of the function implementation in plain English inside the stub. (I suppose if
English isn't your primary language, another language of choice would suffice. I dunno, I
haven't tried.) I format the description as comments, and I try to break them into steps with
whitespace between them (blame my learning procedural programming back in the early
80's).
This is sort of like writing pseudocode, which is one of those almost-perfectly-useless things
they taught me in college. I never really understood the purpose of using pseudocode
outside the language-agnostic classroom. Unlike pseudocode, what I'm talking about is not
writing anything that resembles machine-readable instructions. This is purely humanoriented instructions to yourself on how you are implementing the function.
For example, here's a simple function I was working on tonight. This is nothing more
exciting than implementing queue behavior in TorqueScript:
function WBQueue::Pop(%this)
{
// Is the list empty? If so, quit.
// Grab the top element in the queue.
// Does the first element have a successor? If so, point the Qeue to this second element.
// Otherwise, set the Queue it to NULL (0).
The first benefit I gain from doing it this way is that it forces me to analyze the problem from
a higher level before I start coding. For example, this code (with some expansion to
functionality) was being used in tonight's project to keep track of a scrolling, ordered
selection of graphics objects. I was going to implement it with an array. As I thought through
it, I realized that it was simple queue behavior. As soon as I think queues, I think "linked
list." I'd never implemented a linked list in TorqueScript before, but as I thought about I
imagined it would be very easy. And much cleaner than the array approach.
Once the instructions are written out this way, writing the code itself is almost trivial. At this
point, I can put my brain on auto-pilot and code away. A side benefit is that if I'm interrupted,
it's easier to eyeball what I was doing when I left off, and to pick it back up again.
Another advantage is that, when I am done, those little instructions to myself remain as
comments for my code. When I come back to it six months and try to figure out what the
heck I was thinking when I wrote the code, I'll take a look at the comments and realize I
wasn't such an idiot after all. That does wonders for my self-esteem.
So there you go. Nothing rocket-science-y about it, but I thought I'd offer it here as a
suggestion to any other code monkeys reading this.
The first benefit I gain from doing it this way is that it forces me to analyze the problem
from a higher level before I start coding.
Many times we tear into our projects head first without really taking the time to assess
what were trying to do in the first place. Often the hardest part of starting a project is
figuring out what steps need to come next (or Next Actions for GTDers.) By clearly
defining what were needing to do, figuring out the how comes much easier. After that
its just making widgets.
Once the instructions are written out this way, writing the code itself is almost trivial. At
this point, I can put my brain on auto-pilot and code away. A side benefit is that if Im
interrupted, its easier to eyeball what I was doing when I left off, and to pick it back up
again.
How true. Adding a pinch of context instantly jogs your memory and gives you that
reference point in your mind as to what you were thinking about last. But wait, theres
more.
Another advantage is that, when I am done, those little instructions to myself remain as
comments for my code. When I come back to it six months and try to figure out what the
heck I was thinking when I wrote the code, Ill take a look at the comments and realize I
wasnt such an idiot after all. That does wonders for my self-esteem.
There you have it, ladies and gentlemen. Context helps you define your goals, provide a
way to remember what you were working on, and boost self-esteem. But you dont have
to take my word for it. Take it from a realprogrammer.
Photo by quartermane.
Want to become a better creative problem solver? One of the most productive tools you
can use to solve problems and generate great ideas is mind mapping software. Simply
put, this type of software enables you to capture your ideas in a unique, highly visual
way: Your current project or challenge is located at the center of your map. Attached to it
are primary topics that radiate out in all directions. These main branches can have subbranches, each containing a key word, phase or concept.
Tony Buzan, the renowned developer of the concept of mind mapping, calls it a Swiss
Army Knife for the brain. Thats because it works the way your brain does by
association and it can help you to leverage more of your latent creativity. Heres how:
them, it tries to fill in the blanks the information or ideas that appear to be missing.
When Im using mind mapping software to capture my thoughts, I find that my thoughts
just flow naturally from my brain, through my fingertips and onto the screen. When I
create a new topic, my brain immediately starts thinking about concepts and ideas that
are related to that. Some mind mapping software programs enable you to capture them
quickly in a brainstorming mode, using only the keyboard, helping you to keep the flow
of ideas coming.
Heres an incredible video for people struggling with the tension between being creative and
playing. Tim Brown does a wonderful job explaining why play time is mission critical to any
creative persons workflow. Hint: We have a lot to learn from children.
http://lifedev.net/2009/02/the-powerful-link-between-creativity-and-play/
Photo by leedsyorkshire.
on is no longer an option. It doesnt matter why its not an option. It just isnt. Its
pointless to get angry. Its a waste of time and energy to complain. It serves no purpose
to be negative. Its time to reject any negative thoughts that are filling your head and
figure out a new approach.
Over the years, Ive come up with some steps for getting around roadblocks so I can get
back on the path to success.
One of the best resources available to you is the advice of others. Consult with your
colleagues and peers, read blogs and online forums, read books and trade magazines,
listen to podcasts, talk to your parents (seriously they often have some of the best
advice even when they dont understand the specifics of the situation).
Find out what others who have faced similar situations have done. Talking to a variety of
people provides you with a variety of viewpoints. If you limit your conversations to
people who think like you think, you probably wont get the fresh ideas you need. Get
gutsy. Talk to people who will shoot straight with you. Remember, dont reject any ideas
initially.
The new path might be right in front of you but, for one reason or another, you cant see
it. You just need someone else to point it out and then you can get on your way.
4. Be willing to negotiate.
When the roadblock is another person, the process may take a bit longer and it may be
more challenging. Youve not only got to arrive at a solution that is workable for you, but
one that is also workable for the other person as well. Youve got to negotiate.
Find out what the other person is thinking. What are his goals? How does he hope to
accomplish them? Why has he chosen this particular course of action? Try to unearth
his reason for blocking your progress. Listen for his motivation. What is driving his
decision?
Listen particularly for any areas of commonality between you two. Its possible that you
both want the same things but have chosen to go about reaching the goal in two
different ways. Once you recognize that you both agree on the goal, it will be easier to
discuss how you can work together to accomplish it. You will most likely need to change
your approach, but as long as you are reaching your goal, that shouldnt be a problem.
If, after listening carefully, you discover that the other persons goal is different from
yours, the negotiation process may take longer. Its important for you to have done your
homework and know your bottom line.
Under what conditions would you be willing to rethink your goal? Being willing to alter
this goal may allow you to reach a more important goal.
Is there any specific area in which you arent willing to compromise? For example, if
getting around this particular obstacle requires you to compromise your integrity, you
may decide that price is too great.
The more flexible you are willing to be, the more likely you will be able to find a workable
solution.