The Ultimate Code Kata

@HB

I know how you feel. Since I graduated college and started my full-time job, I’ve been burned out most of the time as well. I really wish I had another summer break so I’d have the time to explore another cool idea or learn a new technology.

Why does it always have to be about programming and writing code? Learning a new programming language isn’t a good idea because it expands your skill set, its a good idea because learning a new language (“new”, as in, different than what you’re used to) changes the way you look at problems. It makes you a better thinker and problem solver, which indirectly makes you a better programmer.

Because of that, the activity you use as practice doesn’t have to be related to programming or writing code at all. Find something that is both fun and mentally challenging and do that. Some people use programming as practice because they’re interested in it. If you feel burnt out, pick something else.

It almost seems silly to use programming for practice. If you’ve done exercise #7 from the first list (review a stack of resumes), you’ll realize that programmers tend to have unrealistic views of their own abilities. Trying to pick a programming project that is “just beyond one’s competence” is a tough skill itself. Its easy for a cocky programmer to say “Oh I know how to do that”, and miss out on a lot of learning opportunities. If you pick another activity (musical instrument, board game, kite flying, etc.) its a lot harder to be cocky and a lot easier to analyze your knowledge and success.

Seconded HB.

As for those who don’t think that you can get good doing your 9-5 coding, I think that a lot of it has to do with what you do during that 9-5. That’s 8 hours a day of coding. Certainly more time than many althletes spend working out. If you don’t do anything challenging at your job, then you probably won’t get any better. However, if your job is challenging, and if you spend even as little as 4 hours a day doing challenging stuff, then you will be able to increase your abilities, without spending time outside of work.

Nice Article, many of us don’t take intention in these type of activities. we can do these activities in a fun way and improving our skills continuously.

@Anvar

My comments weren’t to Jeff, whose ideas about practice were all perfectly legit (and which, as Kibbee points out, can be reasonably accomplished during business hours in most cases). I was really addressing those who, like ak47, make statements like “a guy who codes 9-to-5, then goes home and doesn’t wanna hear/think about coding at all until 9am tomorrow does not get any better.”

That’s a load of horse-hooey.

To the extent that Kenneth may have the “factory worker” attitude, then that’s clearly not beneficial to Kenneth’s well-being or growth or happiness in ANY way. I didn’t read his comments that way (maybe I just didn’t want to). What I did read were responses that equated his lack of desire (to focus his non-work hours around programming) with certain and unavoidable technological mediocrity. And that assertion just isn’t borne out in the real world.

As far as my comments about human psychology, an understanding thereof is fundamental to software design. I don’t know if you know the book “Why Software Sucks…” by David Platt, but he discusses at length why the Jolt-Cola crazed Geeks just can NOT write non-sucky software unless they have a great understanding of how NORMAL people think about and use that software.

Alan Cooper (the epitome of User Interface and Interaction Gurus) constantly makes the same points.

The idea that some pimple-faced geek sitting in front of her computer 24/7 has even the VAGUEST clue about what a normal user needs, wants, or will use is patently absurd. And that geek will never be a top-notch developer without that insight.

That’s all I’m sayin’, yo.

Excellent Post Jeff.Most of us get stuck in our comfort zone and never realise the way to go higher.

@ Ivan

You must have misunderstood my post. Writing code and writing a story have an important similarity: they both have to work, each in its own way. Code may get something done, but story also has to get something done: tell a story and create an imaginary world in the mind of the reader hopefully with some meaning. For code to get anything done, it has to have meaning, it cannot be a crafted jumble of statements which poke around memory and call it “done!.”

For many, writing code is a job and rightfully so. Now that you invoked Tolstoy, think about differences of such classics and Schund produced by, say, Harlequin books which are measured in length, have mechanical plot, no story, bunch of cowboys and hot gals, all wrapped up before page 150 (or whatever page they always end at). Incidentally, a lot of programmers think of programming as something mechanical, patternable, code-reviewable. Post. Submit. Catch. Very good. Until you start writing full-blown applications, the real Tolstoy if you will.

@BugFree

Granted, a story must get things done and that is to tell itself effectively [ purposefully using recursive language at the risk of loosing clarity ]. And, of course, a set of statements to be useful ,or at least of the correct form, must build out to a meaningful parse tree . I agree with you.

What threw me off was :
“Jeff, writing code is about writing code. Just as writing a story is about writing a story, not about people who are going to buy it (or even read it).” I applied the second clause of the second sentence to writing code not writing a story. And so, I disagreed. Writing code has much to do with who reads it and unless, you code for the fun of it [ like me ], then it has a good bit to do with who buys it. Would you not say the same?

This is probably the most useful part:

  1. Learn different programming languages. Pick languages that have alternate worldviews and programming models unlike what you’re used to.

I do ActionScript. People rip on ActionScript because they don’t know anything about it and assume it’s a silly little scripting language. It has it’s problems, but no one knows them better than me, because I use it all day. I’m learning C# to get exposure to some different styles, which helps me a lot when I come back to my day job.

I tend to study in areas related to programming which would only be outside my job description in a large organization. For example, web application security, database design, web graphics design, accounting, networking, etc. A narrow focus on programming seems foolish given the broad range of skills business expects you to have in the real world. A small business will even have their programmers do marketing if it involves SEO.

good programmer is probably defined by knowledge and ability to use this knowledge in a creative way. “good programmer” does not take a book on programming patterns as a dogmatic icon and does not bend every problem to fit into one of described patterns. he merely sees it as an inspiration which teaches him how to be able to express his own patterns that exactly tits the situation.

he doesn’t take a set of pre-made lego bricks and build a crude building out of them, he long aglo learned how to shape his own blocks that fit together effortlessly.

his code then does not look as a shapeless blob of text, he learned to express his intent in a clear way, so that reading his code is probably easy worthwhile (ie. you learn new ways of doing stuff while grokking through his code).

but it probably boils down to one thing : he bends his code to the occasion, not the occasion to any pre-existing code/knowledge/whatever.

of course, we are talking ideals and probably the more you travel on the way from mediocre towards brilliant, the more you realize you are only uncovering new areas yet unexplored. you cannot go too far in trying to learn something new, there is no point when you become total uber-programmer. only when someone thinks he is the “good programmer”, it shows he hadn’t learned enough to realize what he doesn’t know.

there can be many ways one can walk towards the ultimate goal, and one size does not fit all, so IMO good programmer cannot be defined by whether he does kata, learned 10 languages before ending puberty *1), etc. he is defined by neverending drive towards improvement and his ability to analyze new problems/problem domains and provide fitting solutions. good programmer is always evolving, never statically repeating himself. his right definition is as elusive as the perfection he strives for.

*1) No, not even getting laid for the first time on your 26th birthday qualifies you ;-)))

Jeff, writing code is about writing code. Just as writing a story is about writing a story, not about people who are going to buy it (or even read it). The only skill that will be relevant in 100 years from my resume is, erm, writing code.

Interestingly, this was yesterday from my Zen Calendar:

An American seeker: "If you follow any way, you will never get there; and if you do not follow any way, you will never get there. So one faces a dilemma."
Hisamatsu: “Let the dilemma be your way!”

ZEN MONDO

Now that’s a solid codinghorror entry :smiley: And every post should have a random, seemingly unrelated (when not in context) image!

HB)

I think that it is infact true that a “good programmer” has to understand the underlying mechanics of the building blocks they are using. In the banking example… using the pieces that are available in the framework are all well and good, but they have to understand what are the ramifications for using X.

It doesn’t mean that if you don’t know how things work under the hood that you are a horrible programmer. I myself entered programming from asp/php. So I had no idea how things really worked under the surface. Since then I have delved down to C++ and assembly. I can say they knowledge of how things really work under the CLR (I program mostly in C#) has saved me countless hours of troubleshooting. For example I was having problems with a encryption routine that someone had built to pass data in a url from an asp.net server to another classic asp server where the string was being truncated. I saw that it created ‘x0h’ on certain values. So knowing under the surface that a string in memory is null terminated, I realized the IIS server was reading it as the end of the string even though it was not and was truncating it before it got passed to either asp or the .Net runtime.

So I know this is actually a simple example, had I not known how strings worked in memory, I likely would have spent much more time trying to pinpoint this intermittent problem.

@chris lively

According to the dictionary, the first definition of practice is:
“1. Frequently repeated or customary action; habitual performance; a succession of acts of a similar kind;” which perfectly fit the idea of kata. Though, I understand that one performs a kata (a pattern of movements) over and over to become better at performing that particular kata, but there are implicit new skills, fluidity of movements and so forth that could be gained.

@kenneth

I can understand your point of view as a code-producing-factory-worker with dreams of one day having some sort of a managerial job (unless you already do). After a hard day’s work of churning meaningless symbols to working code, one does need to rest. And, there are other things than coding to tend to. I understand. However, as a programmer (professional or not), who sees programming as his/her craft, I see why you have attracted so many people’s attention.

And, I must add that chess is a great idea.

So, who wants to start the coding horror chess club?

Jeff,
I would be interested. To say what everyone says, “I am not the a very good player,” but I enjoy the hell out of the game.

@BugFree

Why is everyone so confused about this. Writing code is NOT about writing code only as writing a story is about writing a story. CODING IS NOT ART, BUT A CRAFT ( well, as a programmer I have seen pieces of code that have emotionally moved me and inspired me, but still would not compare coding to art ). One writes code to accomplish something. The lines of code printed on the screen are not inherently valuable a novel written by Tolstoy is inherently valuable. All that it is and does is contained in/referenced by the printed symbols on the pages.

@Jeff, idea for future blog:

Should computer science students be forced to take a philosophy of art class?