What Does It Take To Become A Programmer?

So these are my thoughts on this article (hint, it’s utter tripe): Programming Doesn’t Require Talent or Even Passion.

On the one hand, this article espouses a good sentiment (you don’t have to be gifted to learn programming). On the other, it completely disregards the important idea that being able to do something is not the same as being able to do it well.

I can draw, but anyone who has seen me draw would agree that I’m pretty bad at it. I can draw just well enough to get my concepts across to other people. However, if I intended on becoming an artist for a living, I should probably learn about proportions, shading, composition, perspective, color theory, and be able to work with a range of mediums. Of course, there isn’t some big secret to learning these things. You just practice every day and study good artistic work, analyzing how it was made. Maybe you take some courses, or read some books that formally teach certain techniques. After thousands of invested hours, you will find that your drawing has radically improved, as shown again and again by progress comparison pictures (that one is after 2 years of practice).

The same holds true for programming. Anyone can learn programming. It requires nothing except a little dedication and time. But the article starts out by promising to ‘debunk’ the following quote (I’m not sure if it’s actually a real quote – they don’t attribute it to anybody):

You not only need to have talent, you also need to be passionate to be able to become a good programmer.

The article immediately ignores the fact that the ‘quote’ is talking about good programmers. Just like becoming a good artist requires artistic talent and a passion for learning and improving every day, good programmers are driven by the need to learn and improve their skills. Perhaps an argument can be made for “talent” being something you acquire as a result of practice, and thus you don’t need talent to start becoming good; you become good as you acquire more and more talent. This is a debate for the ages, but I would say that almost invariably a passion for a skill will result in an early baseline proficiency, which is often called “talent”. Innate talent may or may not exist, and it may or may not influence learning ability.

It doesn’t really matter though, because the article then goes on to equate “talent” and “passion” with being a genius. It constructs a strawman who has always known how to program and has never been ignorant about a single thing. This strawman, allegedly, causes severe anxiety to every other programmer, forcing them to study programming at the exclusion of all else. It quotes the creator of Django (after affirming that, yes, programmers also suffer from imposter syndrome):

Programming is just a bunch of skills that can be learned, it doesn’t require that much talent, and it’s not shameful to be a mediocre programmer.

Honestly, though, the fact of the matter is that being a good programmer is incredibly valuable. If your job is to write code, you should be able to do it well. You should write code that doesn’t waste other people’s time, that doesn’t break, that is maintainable and performant. You need to be proud of your craft. Of course, not every writer or musician or carpenter takes pride in their craft. We call these people hacks and they churn out deplorable fiction that only shallow people read, or uninteresting music, or houses that fall down in an earthquake and kill dozens of people.

So, unless you want to be responsible for incredibly costly and embarrassing software failures, you better be interested in becoming a good programmer if you plan on doing it for a career. But nobody starts out as a good programmer. People learn to be good programmers by having a passion for the craft, and by wanting to improve. If I look at older programmers and feel inferior by comparison, I know it’s not because they are a genius while I am only a humble human being. Their skill is a result of decades of self-improvement and experience creating software both good and bad.

I think it’s telling that the article only quotes programmers from web development. Web development is notorious for herds of code monkeys jumping from buzzword to buzzword, churning out code with barely-acceptable performance and immense technical debt. Each developer quote is followed by a paragraph that tears down the strawman that was erected earlier. At this point, the author has you cheering against the supposedly omnipresent and overpowering myth of the genius programmer — which, I might remind you, is much like the myth of the genius painter or genius writer; perhaps accepted by those with a fixed mindset, but dismissed by anybody with knowledge of how the craft functions. This sort of skill smokescreen is probably just a natural product of human behavior. In any case, it isn’t any stronger for programming than for art, writing, dance, or stunt-car driving.

The article really takes a turn for the worse in the second half, however. First, it effectively counters itself by quoting jokes from famous developers that prove the “genius programmer” myth doesn’t exist:

* One man’s crappy software is another man’s full time job. (Jessica Gaston)

* Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

* Software and cathedrals are much the same — first we build them, then we pray. (Sam Redwine)

The author LITERALLY ASKS: “If programmers all really had so much talent and passion, then why are these jokes so popular amongst programmers?”, as if to prove that he was being intellectually dishonest when he said back in the beginning “It’s as if people who write code had already decided that they were going to write code in the future by the time they were kids.”

But the absolute worst transgression the article makes is quoting Rasmus Lerdorf, creator of PHP. PHP is a server-side language. It is also one of the worst affronts to good software design in recent history. The reason it was the de facto server-side language before the recent Javascript explosion is that it can be readily picked up by people who don’t know what they are doing. Like you would expect from a language designed by someone who “hates programming” and used by people who don’t what they are doing, PHP is responsible for thousands of insecure, slow, buggy websites.

PHP’s shortcoming are amusingly enumerated in this famous post: PHP – a fractal of bad design. In the post, the following analogy is used to illustrate how PHP is bad:

I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.

You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.

You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.

You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.

And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.

Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.

That’s what’s wrong with PHP.

And according to Rasmus Lerdorf, the creator of this language:

I’m not a real programmer. I throw together things until it works then I move on. The real programmers will say “Yeah it works but you’re leaking memory everywhere. Perhaps we should fix that.” I’ll just restart Apache every 10 requests.

It’s like the article is admitting that if you don’t take the time to learn good programming principles, you are going to be responsible for horrible systems that cause headaches five years down the line for the people maintaining them and that regularly allow hackers to access confidential personal information like patient information and social security numbers for millions of people.

So yes, if you aren’t planning on programming for a career, learning to program is fairly straightforward. It’s as easy as learning carpentry or glass-blowing. It might seem daunting, but invest a half dozen hours and you can have your foot solidly in the door.

But if you plan on building systems other people will rely on, you sure are hell better pick up some solid programming fundamentals. If you aren’t motivated to improve your skillset and become a better programmer, don’t bother learning at all. Don’t be the reason that the mobile web sucks, and don’t be the reason that 28 American soldiers died. Learn to be a good programmer.

Escaping UI Idioms

Personally I find that whenever my engineer brain switches on, my designer brain switches off. I have to step away from coding for a while in order to objectively make the best decisions about what to implement and how. When I let my engineer brain do the designing, I end up falling into age-old preconceptions about how things should be. This is especially true when it comes to UI design.

But is it the best idea to blindly follow UI conventions, either new or old? On the one hand, a familiar UI layout and universal UI idioms will make it easier for users to jump straight into your program. However, if those idioms aren’t well suited to your application, the user can quickly find themselves confused, frustrated, and lost. If the UI was unfamiliar but uniquely designed around your application, the users will be less confused because they have no expectations which can be unwittingly subverted.

Some bad features:

  • Confirmation emails which require you to click a link before you can do anything with your account. Confirmation emails that require a link to be clicked in 24 hours but which do not impede progress are much better.
  • The “re-enter your email” fields on signup forms. Every modern browser automatically enters your password.
  • Separating the “Find” and “Replace” functions, putting them in the “View” and “Edit” menus respectively.
  • Speaking of “View” and “Edit” menus, the standard “File”, “View”, “Edit” menu tabs often don’t suit applications. Choose menu item labels that suit your application.

An example of a good feature is the use of universal symbols for universal functions. Using a crazy new “save” icon is not a good subversion of conventional UI idioms. Another is exit confirmation; in a lot of cases, confirming whether you want to save before exiting is a great feature.

Here are two features which are not standard for applications with text-editing capability but which should be (I’ve only seen it in a handful of programs, of which Notepad++ is most prominent):

  • A “Rename” option under the File menu, which saves the file with a new name and removes the file with the old name. This saves the tiresome task of doing “Save As” and then deleting the file in the save window, or (God forbid) having to navigate to the file in your OS’s file browser and renaming the file there.
  • Special character (\t, \n) and Regex support in “Find and Replace” modes.

New Coding Paradigms

So I’ve recently been thinking that the whole idea of editing text files filled with code is outmoded. When I’m thinking about code, I certainly don’t think of it as a set of classes and functions laid out in a particular order. I think of it as a cloud of entities with properties and interactions flowing between them. Shouldn’t our experience of writing code reflect this?

We need to start rethinking our code-editing tools. A lot. Here is a simple example:
XML heatmaps

What else could we do? How about the ability to arbitrarily break off chunks of code and view them in parallel, even nesting this behavior to break long blocks of code into a string of chunks:
Nesting chunks

What if we let the flow of the documentation decide how a reader is introduced to the code base, instead of letting the flow of compiler-friendly source files decide it? Chunks of code are embedded within wiki-style documentation, and while you can follow the code back to its source, reading the documentation will eventually introduce you to the whole codebase in a human-friendly fashion.

The same code could even appear in multiple places (obviously updated when the source changes), and you could see all the places in the documentation where a particular chunk of code appears. This could bridge the gap between documentation and code; documentation will never grow stale, as updating code necessitates interaction with it. Similarly, updating documentation is the same process as writing code. When a standard changes or an SLA (service level agreement) is modified, the code changes too.

But why restrict ourselves to semi-linear, text-based documentation a la wikis? We tend to find UML diagrams extremely helpful for visualizing complex systems in code. What if we could build powerful, adaptable tools to translate between raw code, text-based documentation, and visual diagrams? Strictly binding them together might restrict you in the lowest levels of coding (much like, for example, using a high-level language restricts your ability to control memory allocation), but it opens up the new ability to make changes to a diagram and have most of the code rearrange and resolve itself before you. Then you step in to give a guiding hand, and adjust the text documentation, and voila! Best of all, this is more than a diagram-to-code tool; the diagram is a living thing. In fact, the diagrams, the documentation, and the codebase are synonymous. A change in one is a change in the others.

We’re getting to the point where it is much more useful to be able to dance across a codebase quickly than to be able to tweak and tune the minutiae of your code. Some allowances must be made for processing-intensive applications. Perhaps this system wouldn’t even be useful in those cases. But when you find yourself favoring adaptability and iteration speed over efficiency during development, and when you find yourself being hampered by the need to go between files, scroll through large swathes of code, or referring back and forth between code and documentation, maybe it’s time to rethink your coding paradigms.

Trapped between Eye Candy and Motivation

There’s this really big problem when it comes to working on games (or really any sort of project that lies at the intersection of engineering and design). It has nothing to do with programming or design or testing or art or sound or anything else like that.

The problem is staying motivated. This is especially bad when you are working alone, but it can even happen in groups of 2 or 3 people. Beyond that, you can always find motivation in the stuff that other people are doing, because it comes from outside of your personal drive and creativity. But in small groups or solo projects, the game becomes your baby, and then you get tired of your baby.

Sometimes this happens when you work so long on one subset of features that they sort of blur together and become the totality of the project to you. You quickly get tired of this smaller sub-problem (especially tweaking and tweaking and tweaking), then get tired of the game without realizing there is other interesting work to be done.

Or maybe you realize that there is a lot of stuff to do on the project, but you’ve been working on it so long without much visible or marked improvement that you begin to despair. Maybe the project will never flower, you think. Maybe your efforts will never be used to the full extent they were designed for.

Wherever this loss of motivation comes from, there is one piece of advice I heard that really helps me. It boils down to this: if you keep wishing your game was awesome, make it awesome. Add in that feature you keep thinking about, but keep putting off because there is more important framework-laying to do. Or take some time off and mess around with that one technical gimmick (shader, hardware stuff, multi-threading, proc-gen, or what have you). When you feel yourself losing motivation, give yourself permission to go off and get it back. Don’t soldier on, because your project will inevitably end up on the dump heap with all the other projects you abandoned.

The only problem is, everyone always says that adding eye-candy and little trinkets to your project prematurely is a Bad Idea. If you make your game cool by adding eye-candy, the wisdom goes, then your game is no longer cool because of the gameplay (you know, the point of a game). Arguments about whether gameplay is important not-withstanding, if adding a few bits of visual indulgence saves your game from succumbing to ennui, then by all means, add the cool things!

Introduction to Programming

Taking an introductory programming course this semester has been an interesting experience. Since I grasp the course material well, I’ve spent some time helping others with their work. As anyone who has taught math can attest, teaching even basic concepts requires you to understand the material far better than the student must. When it comes to programming, helping people is even more difficult because you can’t just tell them how to do it. You need to let them to figure it out on their own, otherwise they won’t have learned anything.

But leading someone along without explicitly telling them anything is really, REALLY difficult. Our professor is a master at this, and I respect him deeply because of it. A student will ask a question, and the professor will reply with an oblique statement that doesn’t seem to address the student’s question at all. Yet soon enough the student says “Oh! I get it!” and goes on their merry way. I try as hard as possible to emulate this method when I help those who are struggling, but it is nigh impossible to strike the correct balance. Help them too much, and they don’t learn. Help them too little, and they despair or begin to resent programming. And as much as I don’t like seeing it happen, many of the people in the class have come to resent programming.

This is as sad as a student resenting literature because of a bad English class experience, or resenting math because of a bad math teacher. Yet I don’t fully understand how to prevent it. If there was a good, standardized methodology for teaching difficult concepts without causing students to resent the field, I feel a lot of the problems in society today could be solved. Maybe that is just wishful thinking, though.

The second interesting observation from taking this class has come from observing a peer. The first language she learned was Python, and learning C++ this semester has caused some distress. There were many lamentations along the lines of “why is the computer so dumb?!” Of course, I found this hilarious because it mirrors a situation in the novel A Fire Upon the Deep. As the protagonists head towards the bottom of the Beyond, much of their advanced computer technology stops working, and they are forced to adopt more primitive methods. Needless to say, the characters who grew up with the advanced technology are indignant that they are forced to use such primitive technologies as a keyboard. Meanwhile, the character who grew up using primitive technology merely smiles.

In my mind, this helps clear up the argument of whether new students to the art of programming should be started on a high-level language, or a low-level language. Until such time as low-level programming is never needed except in rare circumstances, students should be started at a medium-to-low level. For example, it is easier to step up to Python from Java than it is to step down. I was originally of the mind that new students should start at a high-level as to learn common computing concepts without getting bogged down in obtuse technicalities and syntax, but getting a first-hand view of the results of such an approach has changed my mind.

Using Games to Educate

In the last few years we’ve seen the Internet playing a larger and larger role in education. Everyone seems to expect a revolution in education within 20 years. It’s possible, although I don’t think it will come from the direction that everyone thinks it will (see my post on online education). I want to give my two cents about an ancillary approach: videogames. Games don’t have to teach the students anything. In fact, I think they are much more useful as vehicles for the education. Games provide a background, a context, for new knowledge. For example, playing Deus Ex: Human Revolution (play chapters of a game as homework instead of reading chapters of a book?) could help spark discussion about the current situation of computers, implants, artificial intelligence, politics, etc. The experiences within the game outside of the lesson help students stay interested and apply the knowledge, even if subconsciously, beyond the classroom.

I’m going to focus on two games: Kerbal Space Program and Minecraft. Prmrytchr has a whole blog on using Minecraft (as well as other games) in the classroom, so I’m going to focus on the technical aspects.

the KSP splash

Kerbal Space Program (KSP) is an indie game currently under development with an open alpha available for purchase. In the game, you run the space agency of a particularly derpy alien race in their Sol-like system. In sandbox mode, you can throw together rockets, probes, rovers, space stations, planes, and planetary bases from a wide assortment of parts. Then you launch your constructions and control them to the best of your abilities.

KSP Screenshot KSP Screenshot 2

While hard to grasp at first, the game is incredibly fun. You do need a rudimentary understanding of kinematics to play well. This is the first step in its ability to act as an educational tool. While you can strap an engine onto a fuel tank and try to fly it, you quickly realize that doing anything impressive — such as putting an object in orbit — requires a bit of education. While you could watch tutorials, you could also get a lesson about basic kinematics and orbital mechanics from a present teacher. There’s an opportunity for lessons on engineering, as well.

As students become more proficient, more complex opportunities open up to them. Orbital rendezvous and gravitational slingshots get more involved physically. Spacecraft design, between mass conservation, fuel-mass ratio, reaction thruster placement, and properties of engines, is a great opportunity for springboarding into other physics. Other elements of spacecraft design that aren’t simulated in KSP, such as heat management, enter the realm of thermodynamics. Ancillary topics that arise when discussing space exploration can involve relativity and electromagnetic waves.

Minecraft, on the other hand, is about as physically unrealistic as you can get. However, it provides an awesome way to teach logic and economics. Even vanilla Minecraft has a growing arsenal of parts which allow rudimentary (or not so rudimentary) automation. Redstone is a powerful tool for doing any sort of logical manipulation — or teaching it. Watching your toolbox of gates and mechanisms grow out of a few basic ground rules is amazing. Creative minds are pushed to imagining new ways of using redstone, pistons, minecarts, and all the other machines being added in. While I’m not a fan, mods like Technic or Tekkit expand the array of basic parts at your disposal.

Multiplayer in Minecraft is an interesting case study of economic theory. Because the system varies so much from the real world, it provides an outside perspective on traditional economic theory. As you teach the basics of microeconomics, you can analyze why Minecraft’s multiplayer economy and identify how to restrict it. The ultimate goal of the class could be to establish a working economic system on a Minecraft server (perhaps through plugins/mods?).

Redstone Schematic Redstone Screenshot

Whether or not any of these are good ideas, it illuminates how games don’t have to be the primary vehicle of learning to be a useful educational tool. Games can merely be a springboard, a point of reference from which lessons emerge. The game keeps the students interested and grounded in the topic, while providing a useful outlet and vector of fortification for the knowledge they are getting in class.

OpenGL and Geometry Generation

Today I was thinking about 3D rendering (in part because of the recent work I’ve been doing with ray tracing). I worked out all the math for drawing a polygon based on a list of vertices and a camera. I was considering coding it up, but then I realized that I was very unfamiliar in working with Windows (because I sure as hell wasn’t going to do this in Java). So I spent the greater portion of the afternoon reading a tutorial on Windows programming and using OpenGL, at which point I abandoned my original. I was just going to finally figure out how to use OpenGL.

I had worked with GLUT before when working on a Parallel Computing lab. However, I only used pixel control in that case; I was rendering subsections of a Mandelbrot set. However, that was easier because all the requisite libraries were already installed in the major lab at school (which has workstations with Gentoo installed). Working at home, I have been confounded. I just can’t get the linker to use all the requisite libraries.

The whole thing that got me thinking about 3D engines was my working on a HL2 level. Often I will import brushwork (pieces of the level) from the game’s campaign levels; it saves time and adds a nice level of detail to the environment. However, I was thinking about common elements such as stairs, doors, windows, and grates. It’s a multi-step process to cut a hole in a brush, unless you use carve (but nobody uses carve because it doesn’t give you control over how the geometry cuts). Doors are tedious to cut out and then line up with the texture. Non-solid stairs are the most painful to make, however. You have to arrange the steps and make sure the sidings match up, and for each new type of turn you have to rework the geometry. The whole idea of hand-making all the geometry in a level is ridiculous. I haven’t seen a single FPS level editor than lets you define procedures for geometry generation.

A screenshot of the Hammer UI

A screenshot of the Hammer UI


I feel like it would be relatively simple to define a generation process for buildings, for example. Each building is spaced a certain distance in from the sidewalk. There are maybe two or three justifications for things like planters and doors. Then windows are spaced evenly apart, with buffer spaces on either side of the building. You could attach balconies or planters on to every windows, awnings above doors, and even outdoor area layouts for cafes. After meticulously defining a couple of building styles, you could almost instantly generate entire blocks. Then come the nested procedures. A street, for example, would have periodic drains and manholes, distributions of building types based on the neighborhood type, and junctions to more streets. Signs, traffic lights, road markings, and crosswalks would all be placed correctly at street corners. Coul-de-sacs could fill up empty space. Interiors could be set as well for buildings. Floor plans could be modular. Rooms with distributions of room types and different layout permutations would combine into floors. A building type could have a sequence of floor types defined, such as bottom level stores and top level apartments. Central structures like stairwells would only need to be made once.

Although the procedural parameter definitions might take a while longer than making regular geometry, it would be a huge time saver. Not only could full geometries be generated, but intricate, custom-designed battle areas could be laid out faster. Common terrain pieces like walls, fortifications, stairs, railings, gates, and hedges could be created with the use of a single spline. Suddenly a task like designing the maps for my strategy game becomes less daunting. The pipeline for map production is shortened. General map layouts can be quickly sketched out and then directly generated. Beta testing would be infinitely easier, as map adjustments could be made in hours, rather than days.