Data Structures: a rant

(If you’re curious, the textbook from this class–and the source of the explanatory links I’m using in this post–is available online free here: http://interactivepython.org/runestone/static/pythonds/index.html)

– – –

I just got out of another Data Structures class. I zoned out halfway through, which is somewhat unusual for me. Happens more often in Data Structures, because the class starts at 8AM. (Fortunately, I think I found a less winding route to cut down on my time walking to class–hopefully the shortcut will make me less prone to lateness. I am not a morning person. I tend to dream about waking up and going to class. I’ve even slept through the 10AM labs, which is ridiculous and frustrating–but also kind of understandable, because they’re on the day after the 8AM class, and my brain is trying to get rid of its sleep debt.)

But that’s not really why I started tuning out the professor’s lecture today. It was the result of another impractical implementation on the projector, at which point a thought struck me:

If these data structures are so useful, why aren’t they part of the language already?

Python (which is what we’re using, 3.5 at that) is not a dinosaur, and most of the math for these data structures was done like fifty years ago. I’d understand if the point was to get C to be more efficient, but most people don’t even code in C any more. It’s not the right tool for very many of the jobs we have to do.

In fact, this class seems closer to a language design course than something practical to software development. I know that’s the point of the high-flown “computer science” department, but… come on. Even interviewers are getting the idea that this kind of question doesn’t matter that much in the real world. It seems more to me like something to be learned on the fly, when needed. Which in practice would probably just mean memorizing Cracking the Coding Interview because you need a job.

Why does this theory class have to be so… theoretical?

I wish the teacher would spend some time telling us when to use these structures, rather than just what they are and how they’re implemented. Otherwise I think this course may do more harm than good.

Why in the world would you ever use a singly-linked list? Most languages–and especially the ones most commonly in use–have array or list structures of their own, which are 1) optimized for you, 2) don’t require extra code, 3) have been tested far more thoroughly than your code ever will be and are thus more stable and predictable, and 4) don’t confuse the hell out of other people who come in and read your program!

Why in the world would you bother implementing a doubly-linked list either, unless you’re coding a programming language of your own?! None of this makes sense! We have a dedicated class for language design! We have a dedicated class for C programming! Why isn’t it in there instead?!

Ahem. *deep breath*

Hash tables are kind of cool, and so are binary heaps (although they’re less practical). My affection for their clever hackitude is rather stifled by the suspicion that, again, they’d probably be built-in structures if they were that useful. Like Python dicts–those are hash tables behind the scenes. Use those. Everyone knows what they are and you don’t have to code them yourself.

If you’re working with large amounts of data, hash tables and binary heaps could be useful. But the professor doesn’t talk about when, just how to use them. If you’re not working with big data, chances are you just need a dict or list, and can spare yourself and others the experience of trying to interpret your weird code later.

But the professor doesn’t talk about that kind of thing. I wonder if he’s getting homework assignments that use this stuff unnecessarily. He hasn’t been taking points off mine because my work still does what the spec asks for, as clearly/briefly/user-friendly-ly as possible. I haven’t been looking for ways one might use weird data structures in the assignments, so I don’t know if they’re designed to invite us to use them or what.

He also covered recursion, which I think is very useful–again, if you know when to use it, which depends both on the problem you’re solving and the language you’re using. I will casually use recursion to make my code cleaner-looking even if it isn’t always the most efficient option (in Python). But that’s for readability. Mostly I use it when I’m getting user input, and I stick the prompt in its own method and loop if I get bad input. That lets me put all the lengthy, messy error-checking off somewhere and the main program will get back a good value.

I think this practice is supposed to be kind of evil according to functional programming, because user input functions aren’t pure functions? Or maybe, because I’ve sectioned them off and make sure they return good values, they’re exactly what you’re supposed to do in functional programming. Don’t know yet. It works, anyway.

I still use “else:” almost exclusively for “Can’t Happen” errors. It saves me headaches when I screw up the recursion. That’s a minor change with using recursion, but it’s an issue only while writing; I’ll put in extra effort when I’m writing the program to make sure it’s easier to read later.

What I will not do is write code whose purpose is to make me look or feel clever for writing it a certain way. That’s insane. Sacrificing readability, even efficiency because you think it’s cooler to use some homebrew data structure code rather than a freaking built-in Python list? That’s absolutely insane.

When interviewers select for people who know how to do this, I wonder if they realize they may be selecting for a subset which includes the actual worst candidates: the smug “Of course I know everything, if you lesser mortals don’t, that’s your problem, Google it, and also I have very strong opinions about i++ vs. ++i and will totally correct you if you’re wrong.” Fools and incompetents may eventually learn. This person doesn’t think they have to.

(Of course, sometimes a person like that is useful to look impressive in customer meetings, but in my admittedly limited experience, they’re just as likely to insult your customers as to impress them. Ever seen a bunch of startups pitch? Some of those folks need an attitude adjustment. Of course, they’re going to fail; it’s hard to have enough empathy with customers to produce a good product if you have such scorn and disdain for their intelligence. Then they’ll claim they went under because they “failed to pivot.”)

Oh, one more thing. Big-O notation is pretty useful. Even if your main use for it is understanding what other people are talking about, and/or making yourself look impressive. It’s so you can find out which of two algorithms is more efficient, which will probably be something you’ll need to do eventually. It looks way more complicated than it is.

I could very well be wrong about this, and I’d be pleased to find out if I were. I’d love to find something that’d make me a better programmer. I’d be terribly pleased to find out I wasn’t learning something nearly useless. But I don’t think that’s the case.

The CS math course I have (enigmatically titled “Discrete Structures”… I have yet to find out why, unless the reason is “because it sounds fancy”) seems a little more practical at least. Logical thinking comes pretty naturally to me, but I know it doesn’t to everyone, so it makes sense to cover it. I know there’s also set theory, graph theory, and combinatorics later on in the course, and I’ve heard those are good things to know for programming. I guess I’ll find out.

Oddly enough, it’s my English course that’s the most practical. The professor decided to forego the traditional giant clunky writing textbook and told us to order this list of like eight different short story collections, which we read and then write and talk about. That takes up about half our class periods. The other half (each day is dedicated to one or the other) is the professor talking about writing: elements of stories in general that are important (like what the stakes are–is war at risk, for instance?), writing style (like sentence structure, word choice, voice, POV), what it means to have universal appeal, what it means to capture an audience and how to get their attention–and especially the skills of critical thinking and backing up your claims.

This format is a little odd for a class called “College Writing and Research”–but it isn’t bad. I think it’s more effective than the normal route. No writer I know learned writing out of a big clunky textbook, or by doing essays on symbolism in Dickens or whether school uniforms are a good idea.

Since CS folks often point and laugh at the liberal arts, saying their study is useless bull and all those English majors should be studying something useful and practical (like computer science of course), well… I have an uncomfortable piece of news.

Not that I’m saying majoring in English is more likely to get you a job (although it’s better off than, say, Gender Studies). But knowing how to write effectively, which my English class will teach you, is far more practical than knowing how to invert a binary tree.

Sorry, prof.

Please read the comments.

Advertisements

On impostor syndrome

I’m feeling pretty good about my skills lately. Maybe I’m realizing I didn’t have quite so much “catching up” to do as I thought. The theory stuff I’m learning in my classes is useful, but not as complicated as it looks.

(Well, most of it. Some of it is. Though I’m starting to pick up on the idea that if I don’t understand a recursive algorithm, it probably wasn’t efficient anyway–and if I don’t understand it [I’m usually good at this sort of thing] then it better be a darn good optimization hack for me to use such an unreadable piece of code. My standards may change as I’m learning Clojure, though.)

I dislike the whole “impostor syndrome” craze. If you read tech articles on Medium and Quora and so on, everyone and their dog has impostor syndrome. Saying you have impostor syndrome is like this big, socially-acceptable, self-contradictory humble-brag: “I’m actually a genius but I don’t think I am.”

It makes about as much sense as the girls who listen to “You Don’t Know You’re Beautiful” on repeat:

“You don’t know you’re beautiful, oh oh, / That’s what makes you beautiful”

and then say, “Omigosh, 1D just totally gets me.

First off, the point is that you don’t know, so if you acknowledge the song as something you relate to then you’re canceling out your own point. Second, this song is about how the singer finds it super attractive that you have no self-esteem. Catchy.

When you’re a beginner, of course you’re looking around and thinking, “Wow, everyone else knows so much more than me.” Because they do, duh, you’re a beginner. And you’re going to be a beginner for at least a few months. If you start calling your thoughts “impostor syndrome” at this point, you’re deluding yourself. On the other hand, you need to trust your ability to learn. Just don’t underestimate that it’s going to take some work and you’re not there already.

Impostor syndrome is when you’ve still got this mindset, but you’ve also got concrete evidence that your mindset is flawed, which you then brush off by thinking that everyone else is some kind of idiot you’ve fooled into believing you have way more technical knowledge than you do.

Listen, you have respect for the other techies around you, right? Anyone you talk to on forums, StackOverflow, GitHub, your school/bootcamp/job. (If you’re roughing it alone, try to connect with someone. It helps.) If any of them are actually worthy of that respect, they can smell technical BS from a mile off. That’s a skill we all develop. If they were going to suddenly find out you’re not as skilled as they thought you were, it’d have happened a long time ago.

It’s hard to feel like you’re making progress when you can’t measure your own skill. I get it. Nobody in tech knows how good they are at what they do; we can estimate, or take the judgment of those around us. And the problem with the latter is that most everyone else is as insecure as you are, and some of them will lowball you to feel better about their own skills, while others will try to flatter you so you’ll like them.

Listen. There’s a solution to this. Not a perfect one, but one all the same.

You have to build stuff. You have to solve problems. You have to read code. You have to write code.

Empirical evidence of your own skill grounds you. It puts a lower boundary on where you are. It gives other people something tangible to assess you on. Working on something real will tell you very quickly whether you’re out of your depth or just underestimating yourself.

Here’s how you tell the difference: If you’re super confused and have to look everything up before you can do any real work, you’re just underestimating yourself. If you’re actually out of your depth, you don’t even know where to start. Misleading, I know.

The problem with the advice “just build stuff!” is that it’s really freaking hard to start. You don’t know what to make. The things you want to make are complicated. You don’t have the syntax memorized. You don’t know how to split things up sensibly into different methods or files. That’s a big problem with programmers who are just past the point of doing lots of tutorials. You don’t know where to start, and it seems like you should go back to the tutorials and learn more, because that’s usually how it works. But in this case, it’s doubly misleading. The bigness of open-source and the complexity of many of its projects are also terribly confusing.

In practice, impostor syndrome is a lack of information about your own ability. So do the scientific thing and experiment. Run some tests. And remember that, with more practice, you can change the results.

Related sidenote

Listen, I’ve been thinking about writing some more how-tos. Programming how-tos, not the Linux ones from before.

And I wonder if I might also accept some… I guess students? Mentees? Just informally. If you try to do one of my programming tutorials and you post your code on GitHub, and then drop a line here, I could look at it and help you get unstuck or suggest improvements or that kind of thing.

I can’t promise a specific response time or anything that formal. And I know some of you don’t really qualify to be my students, because you’re legitimately better programmers than I am. But otherwise, I might help you learn something new, and/or feel a little more confident about your skills.

Is that something you might be interested in?

 

Should You Learn To Code?

This happened recently: https://techcrunch.com/2016/05/10/please-dont-learn-to-code/

Then this happened too: https://medium.freecodecamp.com/please-do-learn-to-code-233597dd141c#.ppljou5z1

It’s not new. Exactly the same debate happened in 2012: https://blog.codinghorror.com/please-dont-learn-to-code/

Then: http://decafbad.com/blog/2012/05/16/please-learn-to-code/

Here’s pretty much the conversation that’s going on.

“Not everyone needs to learn to code. It’s a fairly niche technical skill set, used in one kind of career. Insisting that everyone learn to code is like saying everyone needs to know plumbing.” (For some reason, both articles used this analogy; maybe the second one was just ripping off Jeff Atwood’s?)

“But computers are everywhere, they break often, they’re not well understood, and the world runs on them. Even if you don’t want to be a software developer, it might be smart to have a passing knowledge of code.”

“It’s just not necessary; people have other things that require their time and energy. Besides, there are all these newbies coming out of coding bootcamps, thinking they know everything and are entitled to a job. Then they’re either horribly let down, or they go out and write bad code the rest of us have to deal with.”

“Only some bootcamps are like that, and only some students. Often bootcamp students make good open-source contributors, too. Besides, many of these students intend to go into other fields anyway–they just want to kind of know what they’re doing around software.”

“The software field is way too romanticized. People want to be a software developer because they want to look smart and get a high-paying job. In reality you’re often overworked and the job is very stressful. Lots of students enter this field with an overly optimistic idea of what it’s like.”

“True, but we also have a massive lack of coders in America. There are lots of great jobs out there, and a big reason for the overwork is that we don’t have more people in those jobs.”

Yep, that’s about it: people who are already in the field, arguing whether newbies should be encouraged to join the club.

Personally, I think these people need to calm the #%#$ down, if you’ll excuse my cartoon language.

Here’s the question that determines whether you want to code.

It’s not “Are you dedicated?”

It’s not “Do you actually like computers?”

It’s not “You’re not just in this for money or prestige, right?”

It’s this:

Do you want to?

That’s it. That’s literally the only question you should be asking. This pretentious judgment of newcomers based on their “dedication” or “talent” or any other bull as judged by an outsider who has no clue who you even are? That shouldn’t matter to you. At all. If you want to code, code. If you want to learn, learn.

If you don’t, you don’t have to, and you shouldn’t. The people who are trying to pressure you into learning anyway–saying it’s “the new literacy” or whatever–aren’t you, any more than the people who are all like “stay out of our clubhouse.” The idea that either camp can or should tell you what to do is pretentious nonsense.

But if you still want in? Welcome to the clubhouse.

I don’t care if you have kids. I don’t care if you’re not a dev by trade. I don’t care if you start off thinking you know everything–you’ll learn soon enough, unless you’re generally a jerk with no empathy, in which case your interaction with computers doesn’t really matter as to whether I’ll like you.

None of that freaking matters.

If you’re not dedicated, you won’t put in the time to learn.

If you’re bad, someone will tell you and (hopefully) give you hints about how to get better.

If you don’t like computers, there are easier fields for you to get into for money and prestige.

The technology field has enough natural barriers to entry without people building more. In fact, the natural barriers hold too many people back who would otherwise be great coders; that’s why there are so many bootcamps, tutorials, intro-to-programming websites, and even blogs (ahem) to help newbies in this field.

Technology doesn’t need to be only in the hands of this “elite few” that “Please Don’t Learn To Code” article writers seem to be trying to protect. (Ironically? These people are going to be the same people who’ll complain that their manager has no clue about anything they do. At least if the managers knew some basics, the devs would have a language to use to talk to them. If the boss thinks their job is so simple, maybe s/he should look at the bug they’ve been fixing for the past four hours. It’d be more like onboarding a newbie coder, which is something they probably have experience doing. Or should, anyway.)

I do have this to say on the topic.

You know how in schools, we have music classes? Even though most people are not likely to become professional musicians, they’re given a class where they… probably learn to sing better, and take some lessons in music appreciation.

Why?

Because music is an art form, and studying it is its own reward.

Writing good code is making art. It’s not “like” making art. It is making art. You can write beautiful code, and it’s a joy to do so.

So if you agree with taking music lessons in seventh grade in order to better appreciate an art form, you should also agree with learning to code enough to recognize a beautiful piece of software–even if you yourself don’t do so, you shouldn’t condemn others for trying.

Not everyone who takes music ends up a very good singer, and definitely not everyone goes on to sing professionally. They only do if they love it and are good at it.

Isn’t that how it should be?

So

I’m not going to tell you that you should or shouldn’t learn to code. That’s for you to decide–based not on the opinion of some pompous person on the Internet who’s acting like a grumpy black hat and thinks they should decide if you belong in Technology-Claw or Liberal-Arts-Puff–but on one simple factor.

Whether you want to.

That’s enough.

Todo: Go backpacking

I wrote about a todo-list app idea I had in my post “My Idea File.”

DaniS said:

I can think of quite a few todo list websites and apps off the top of my head, and the time-filling aspect looks like it’s heading towards the knapsack problem, so this idea is a bit too big and scary for me right now, I think. Your mention of priory assignment is cool, though, and reminded me of a chapter from Cryptonomicon by Neal Stephenson, which I don’t know whether you’ve read but is great.

I do know of lots of todo apps. I don’t know of any (without having looked) that let other people request additions to your list, or work with prioritization. Anyone can write a todo list app that sits on the phone and everything’s inputted by one person. It’s called a text editor.

I’m thinking of the people whose email inbox looks a lot like a todo list, because that’s how people ask them to do stuff. But that’s a kluge. I know these people exist because they’re usually complaining about it, and email clients are always trying to build in features to accommodate emails that are really todo-list items. What we really need is a new system, preferably one that integrates with the old one–maybe we should come up with a way to parse tasks from emails? That sounds complicated, but maybe it’s not impossible.

I get what you mean about the knapsack thing, but NP-complete problems aren’t generally difficult for small n. I’m talking about filling a few hours with a couple different tasks which might take 15min-1h. It gets way easier if your “specify how long this will take” function works in 15m increments. Then you’re working with, “I have 6 slots before my dentist appointment; find me 6 slots worth of stuff to do.” Also, if you don’t HAVE to fill every bit of time, the problem gets way easier. If the algorithm generally works, people won’t mind if it leaves 15m of free time or whatever–especially since the time estimates are necessarily estimates, and tasks often take longer than people think.

Also, if people have long stretches of time open, you generally want to make sure you get the longer tasks done then. If you have six hours of free time and doing taxes or something takes five hours, you need to prioritize that because big chunks of available time can be hard to come by. If you have a big swath of time and no long tasks, it’s a matter of sorting by priority. You decide which tasks to do to fill the spot, and then you prioritize them.

When it gets tricky is if you offer the user the option to split up big tasks. Say cleaning your kid’s room (which is a disaster) will take three hours. If you have a phone call scheduled early in the day and a hair appointment two hours later and you’re making lunch right after that and then your show is on an hour after that and the kitchen needs to be mopped sometime today… you’re probably not going to clean the room all in one sitting. Plus, you’d be pretty tired if you did it all at once anyway! So if you offer the option to break that up, then you’re approaching knapsack complications.

The solution to that would be to decide the smallest useful chunk of time to work in. 15 minutes is not really enough to pick up all the toys, and people tend to work better in slots of maybe an hour anyway. So if you split it up into 30m or 1h segments, then you’re back to relatively small n and you can work with that.

You also don’t have to use brute force–there are of course better algorithms for this–and you don’t have to get THE optimal solution. You just have to get one that works, and allow the intuitive human brain of the user to make changes to the suggested schedule.

This is a fun problem! Thoughts?

Programmers and writing

Okay, so I started this post a while ago, not entirely sure what I was writing about. I wanted to write about how I’d suddenly realized I’d gotten to the point where I could tell the differences in personality between programmer bloggers, and how some of them posture more than others in order to look logical and educated and authoritative, and how this didn’t actually seem to correlate with whether I agreed with them. I wanted to talk about how readers of programmer writing expect posturing so much that it takes a real effort to sound friendly and welcoming instead, without the help of body language, but that this allows one’s writing to become more convincing, more motivational, and more enjoyable to read.

Then I thought, why am I writing this? If it’s about not writing like a snob, I’m preaching to the choir. You guys don’t do that. My own post sounded like an ironically self-indulgent rant about why how I write is better, or something. (It’s true that I put a lot of energy into not seeming arrogant. I hope it works.) Or, worse, it might sound as though I were accusing you of needing correction in this area. Neither was something I was aiming for.

Rather, I wanted to warn you about these behaviors, because of the effect they’d have on you as you read about your craft. But I didn’t pin this motive down until I read the intro to an online book LucasFF linked to me, and found this couple of paragraphs:

If you look for help you may find people are not patient with you. You may find that, rather than help, they take the time to express how much they know about the subject. Experienced programmers might tell you that you are wrong. The subtext to their tone might be that you should stop now, rather than inflict your bad code on the world.

After a couple of engagements like this you may decide that you are not a programmer, or don’t really like programming, or that you just don’t get it. You may have thought that you once enjoyed the idea of building your own programming language, but now you have realised that it is too abstract and you don’t care any more. You are now concerned with your other passions, and any insight that may have been playful, joyful or interesting will now have become an obstacle.

For this I can only apologise. Programmers can be hostile, macho, arrogant, insecure, and aggressive. There is no excuse for this behaviour. Know that I am on your side. No one gets it at first. Everyone struggles and doubts their abilities. Please don’t give up or let the joy be sucked out of the creative experience. Be proud of what you create no matter what it is. People like me don’t want you to stop programming. We want to hear your voice, and what you have to say.

Realizing why this post had come about, I decided it was worth writing after all.

A friend of mine emailed me a few months back. He was replying to my request for collaboration on an idea I was toying with. The response came late, because he’d been dreading disappointing me with the news that he’d stopped programming. He’d had it with the infighting.

This is something you need to protect yourselves against. Creativity and motivation are fragile creatures and must be guarded.

Three types of writing

Some programmer writing is just kind of awful to read. It goes off on rants. It boasts about the writer’s knowledge and accomplishments. It insults the reader, or the writer’s coworkers or friends. It’s unprofessional, sexual, or discriminatory. Or it’s any of a dozen other things I haven’t listed.

Sometimes that writing has a valid point to get across, and sometimes it doesn’t.

My thesis here is that if you’re not sure of yourself, it’s not worth reading anyway. There’s a wealth of tech writing that doesn’t do these things.

But I’m getting ahead of myself.

Quora demonstrates this divide a lot. Questions get a lot of variety in their answers. About once a day (that I see when I’m on), someone posts this question:

“Hey so I have this HUGE GREAT IDEA and it’s worth $10B but I don’t know how to code it. Can I get a developer and pay him 20% equity to build my great idea? Should I make him sign an NDA so he doesn’t steal it?”

and the answers are, on the whole, predictably snarky. It’s funny to read the first few times you see the question, and then it gets boring. But there’s usually a range of variation, from

“People like you are the reason I never tell anyone I’m a developer. We’re sick of being badgered with people’s ‘billion-dollar’ ideas that usually don’t even make sense or have a market.”

to

“Dude. Execution is everything, the idea is nothing–nobody would buy your idea for $20. Go out and learn to code, or figure out something else you can bring to the table to actually earn your ridiculous 80% share. [then optionally actually answers the question]”

to

“[actually answers question]

“But you’re unlikely to be able to do that, I’m afraid. Most developers have lots of ideas of their own, and they’re more likely to invest their time in their own idea than yours, especially since they’d get all the reward for building their own idea, not just a fifth of it. It’s hard, time-consuming work to build things. If you really believe in your idea, you could start building it on your own by learning to code, and then see if you can get others on board once you’ve made a prototype.”

#3s usually get comments back from the OP, because even though they’re basically saying the same thing as #2, they do the OP the courtesy of actually answering the question first (the order is more important than it seems) and then giving them the benefit of the doubt that they’ve asked out of honest ignorance rather than from a place of superiority and disdain for working devs. In other words, they treat the OP like an adult, even if he’s a 14-year-old boy on a cheap netbook somewhere.

In turn, OP usually listens to them. #1 seems really hostile–an outright declaration of animosity merely for the fact that OP dared to ask such a question (which is never a good approach; if the OP was really so despicable the best thing to do would be to deprive them of an audience)–and #2 is condescending and unapproachable, if somewhat more on topic. #3 is reasonable, diplomatic, and friendly. They’re offering the help OP came for, even if the message they have to deliver is bittersweet.

Be aware of what you’re reading

Joel Spolsky of the blog Joel on Software, as much as I like his posts for other reasons, has a lot of #2 posts on his blog. “If you don’t know this, you’re incompetent!” is a common theme, and to me there are two outcomes to reading that sort of thing: either you know the thing he’s talking about, and you feel smugly superior or think “at least I’m not incompetent at this thing”, or you don’t know it and you think, “oh, great, another thing I don’t understand, I’m farther behind than I thought.” If the latter, maybe you’ll think about learning whatever it is, but now you’re feeling bad about your skills and that doesn’t help anyone.

On the other hand, Jeff Atwood of Coding Horror seems way more approachable, because he’s willing to admit upfront he may not be competent at everything, including the thing he’s talking about. He gets pretty upset when he hears about people who actually can’t write code at all pretending they’re programmers, but I’ve never seen him go off on a wild rant because they didn’t know the difference between UTF-8, ASCII, and Unicode. (For the record, I read both posts all the way through.)

I’m not saying JS’s post on character encoding wasn’t worth reading. I’m saying it was a #2 post, not a #3. It has useful information, but instead of introducing you to it in a friendly way, it kind of beats you over the head with it.

In this article I’ll fill you in on exactly what every working programmer should know. All that stuff about “plain text = ascii = characters are 8 bits” is not only wrong, it’s hopelessly wrong, and if you’re still programming that way, you’re not much better than a medical doctor who doesn’t believe in germs. Please do not write another line of code until you finish reading this article.

It was worth reading, to me, but if his aim was actually to educate people on how to use character sets in code, this was a really roundabout way of doing it and there are several things that are ishy about the post.

  1. I’m not going to infect someone with Ebola if my web site shows up with weird question mark characters. So far, nothing I’ve written has been a matter of life or death depending on if it works in Turkey. This holds for probably most programmers. Ergo, the comparison to a doctor who doesn’t believe in germs is straight-up overdramatic yelling at people who happen to not know this thing you know.
  2. Most of the post is a lecture on the history of character sets and how they work, which, while somewhat interesting, actually doesn’t have much to do with solving the problem JS is complaining about.
  3. His actual message, if his intent was really to stop broken international code, could have been condensed to: “PSA–make sure you declare your character sets, folks! Using UTF-8 will make international users’ lives easier.” This would fit in a Twitter post.

I know I’m kind of picking on Joel, here, but he’s not actually a bad guy. He’s written some really cool software and I think his writing is interesting. This post I’m quoting was written in 2003, and I imagine he’s changed a lot since then. Really I just want to dissect his old writing as an example.

What if you were a new programmer, stumbling upon this post? You’d be really discouraged.

Character sets? What’s a character set and why is it so important? But this guy sounds really impressive and he knows all this history… how am I supposed to know everything I need if there’s really important stuff like this and I’ve never even heard of it? Maybe this is too difficult.

Yeah. No. That’s not a good situation.

Add in the fact that this person, if they have an online presence and are asking for help, is probably hearing from ten different people:

Wait, you’re learning PHP? Why would you put time into learning such a horrible, broken system?

Your design is all off and your conventions are sloppy. Can’t you even indent properly?

You’re going to be horribly ineffective unless you learn how to work with APIs.

Burn that book, you won’t really learn anything effectively in 24 hours like it promises.

You’re not a REAL programmer unless you’ve made something someone will pay you for.

Java is for sissies, here, learn C instead.

That framework does too much for you–you’ll never learn unless you build from scratch!

Why are you still using Notepad++? Let me introduce you to…

Learning Visual Basic first will ruin you as a programmer.

Wait, you don’t know anything about pointers? Seriously? Oh, you’re self-taught, I get it…

…and you’ve got one ex-newbie programmer.

Don’t let that be you–on either end, but particularly not the newbie end. This kind of talk, even if the writers think they mean well, is nothing more than posturing and bullying. It may not be all #1. Some of it may be #2. But unless it’s #3, it’s not something a beginner needs to hear. Even #3 writing is colored by an individual’s specialties and preferences.

Be aware of what you’re reading.

Some writers just posture a lot, without any mind to whether it’s actually justifiable. When you don’t know much about your field, #1 (ranting with no point, or a bad point) and #2 (ranting with a point) are hard to tell apart. Heck, #3 writing can be wildly off target too–but it’s less likely to be if the writer doesn’t need to resort to grandeur to get their point across, and furthermore, #3 writing doesn’t make you feel bad about yourself. Yes, that’s important. You might be thinking this this approach is some crazy feel-good thing where you only read stuff you like, whether it’s true or not.

But how important is it, to a beginning programmer, to have everything right? It’s far easier to realize, “Oh. So that polite guy actually didn’t know quite what he was talking about and it’s really more like this,” than it is to get over the kind of verbal abuse listed above. Your priorities should actually be geared toward protecting your motivation, rather than always getting accurate info. I mean, unless you’re programming kidney dialysis machines first thing, it’s better to be a wrong newbie than a newbie so discouraged that you stop.

Be careful, fellow larvals. Guard your motivation, and be cautious about what you read.

If I ran my community college’s CS department

Here’s what my school’s two-year Programming track would ideally look like if I were the one running it.

General Education Requirements

  • Math: Algebra I (including Boolean logic), Statistics (so your programs don’t misinterpret numbers)
  • English: Comp I (so you can write and look professional)
  • Placement test to see if you need Intro to Computers

Required classes

Semester 1

Intro to Computers (if the test said you needed it) – 3 credits

  • How to use a computer. How to create documents, how to install stuff safely, how to troubleshoot problems–on both Windows and Linux. (Mac OS X is similar enough to Linux that you don’t really need to buy Macs just for this class.)

Programming Bootcamp — 6 credits

  • Using Python to learn basic logic and structures, and what things are called. Python as a first language is not only easy and non-intimidating, but ingrains a habit of neatness with indentation.
  • Also covers what the most common languages are, and what they’re used for.
  • Also covers how to read documentation/APIs.
  • Also covers use of git from the command line.
  • Also covers what open-source is, how to use code from GitHub properly, and how to make your own code open-source (and when it’s appropriate to do so).
  • At the end of the class, your final project is to make something for yourself. It doesn’t have to be big or complicated, but nobody else can tell you what to make. For example, a calculator or tic-tac-toe game with a GUI interface, written in Kivy. Or if you’re ambitious, a simple application to replace your weekly planner. This gets students into the habit of making stuff, and shows them that they can.

One of the three gen. ed requirements

One programming elective  – 3 credits

Semester 2

Web Dev Bootcamp – 6 credits

  • The first class should be about what you’ll be able to do by the end of the class, and the second class should be about what you’d like to build with that. Throughout the class, the students will build that project. If their project doesn’t need to benefit from a particular class’s lesson, there will be a pre-coded web site that the lesson can be applied to. This is the homework for this class: applying the week’s lesson to a project.
  • HTML and CSS would of course be taught. Almost immediately, however, the class should incorporate either PHP or Javascript (one or the other) and a database structure so the site’s structure stays consistent.
  • Emphasize design and aesthetics; they are important! Fonts, colors and layouts may not be technically challenging to learn about, but they make a big difference in what the user sees. If your back-end is flawed, your page is useless; if the front is ugly or unreadable, no one will use it; and if it isn’t pretty and professional looking, your clients will fire you.
  • Introduce a web framework or two–preferably ones that are meant for different purposes. Maybe Drupal and Django, since the students already know Python from the programming bootcamp.
  • Also, cover some stuff about web servers, using Apache, etc.

Hardware and Networks — 3 credits

Note that this is the Programming track. The Hardware and Networks class here is only for the Programming track students, or Networking students who need things explained more simply before they go on to the Network track classes. Similarly, under my watch, the networkers would have a 3-credit scripting class next to a 6-credit networking bootcamp class. This may seem inefficient, but it actually means that people working in an area that isn’t their specialty get to work at a slower pace. That means less of a drop-out rate from these classes. Of course, if your college is ruthlessly money-focused, that may not be what you’re aiming for, but this is the ideal program, remember?

  • General overview of networks and how they work, the TCP/IP stack, basic security, that sort of thing.
  • Taken slowly, as a full 16-week class. Most programmers I know really dislike networking-related stuff and find it difficult, and the networkers feel the same way about programming.
  • Emphasis on what a programmer would need to know to interact with a network while programming. Things like Unix scripting should be part of this class.

 

One of the three gen. ed requirements

One programming elective – 3 credits

Semester 3

C Programming –  3 credits

The quality of classes on languages really doesn’t depend as much on how the class is structured as it does on the textbook and the teacher. A decent teacher using an O’Reilly book–or the classic Ritchie book–is going to do this just fine. If no other languages, I’d want students to leave the school knowing Python and C.

Operating Systems Bootcamp – 6 credits

  • Get into the nitty-gritty of the latest Windows, the latest OS X, and the latest stable build of Debian.
  • Command line, shell scripts in the native shell language and Python, security, major troubleshooting, and how to break into your own computer if you need to.
  • Discuss the differences between the different Linux distros
  • Discuss when it’s appropriate to use each operating system, and its pros and cons
  • Some more networking-related stuff thrown in–this is an appropriate place for it

One of the three gen. ed requirements

One programming elective – 3 credits

Semester 4

Object Oriented Design  – 3 credits

  • This sure looks good on a resume.
  • Design patterns, MVC architecture, whatever the new buzzwords are.
  • The important part is to discuss whether these ideas are useful, in order to get people in the habit of thinking for themselves whether a given fad in programming is worth it or not.

Data Structures – 3 credits

  • I wish my school offered this because I don’t know anything about it.

Senior project – 3 credits

  • Build something cool with what you’ve learned and show us! No papers, no schedules you have to make up. Just make sure you have something neat to your name by the end of this.

Two programming electives – 6 credits


 

This adds up to 60 credits, which is standard for a 2yr degree.


 

Programming electives

Lisp Programming (doesn’t have to be Common Lisp specifically, could be Scheme or Racket or something)

Java Programming

C# .NET Programming (just because I don’t like it doesn’t mean I wouldn’t offer it)

C++ Programming

Ruby Programming

Javascript Programming (more in-depth than what’s included in the web dev bootcamp)

Explaining What You Do

  • How to talk to customers and your parents about what programming is and what you’re doing without using words like “compiler,” “for-loop,” “caching,” or any weird acronyms.
  • Also equips you to teach others about what you know, which is an important professional skill.

3D Modeling

Computer Animation

Game Programming

Audio Programming for Games (I liked this class)

Mobile App Development

Server-Side Scripting

Client-Side Scripting

Robotics with the Arduino

Databases In Depth

Security and Cryptography in Programming

UI/UX Design

Software Testing

Machine Learning and Artificial Intelligence

 

What do you think? Should I immediately be placed in charge of the school? 😛

Of course, many of the problems that would stem from my school trying to adopt this have to do with the fact that they can’t get teachers. My school requires teachers to have a Master’s degree, and most of the people with that kind of credential are working more interesting jobs for more money, unless they happen to like teaching or just got fired from something else or want to teach as a vanity project.

Alas, the plague of academia.

Still, though: I think my school is way too Microsoft-focused. I know MS pays some of the bills for them, but I don’t think it’s worth it to focus on so many things that may be gone in five years.

Since Apple lost Steve Jobs and subsequently has been kinda struggling for air, Microsoft has lost their main company to copy. They’re trying to copy Google instead and it’s working even worse than when they were copying Apple. Microsoft is dying. Slowly, but notice that they don’t have so much of a monopoly as they used to. Perhaps they’re fated to go the same way as IBM.

I think it’s better to be kind of platform agnostic when it comes to schooling. Especially paid platform agnostic. If I were running the school, the school would be running Linux Mint. (You have to run something. Why pay for Windows if you only need it for a few classes?)

Did I miss anything? Let me know in the comments! Also tell me if you have any requests for upcoming posts. I’m always happy to hear from you.

On college degrees

Just some thoughts I’d like to get out of my head. I’ve thought a lot about this (of course) without writing it down. I’ve mentioned before that I don’t intend to finish my bachelor’s degree, but I haven’t really explained why in detail, even though it’s the sort of thing I post about here. So here it is: why formal credentials in general, and college degrees in particular, are not the end-all-be-all of having a stable and successful career in technology.

Hiring hackers

Technology is one field where college is kind of an awkward proposition. Take these classes and you get a piece of paper that will get you a job. Okay.

The main problem is that it’s hard to gauge whether someone knows their stuff without working with them on something, or at least seeing something else they’ve worked on and trying to judge its quality. This makes it really hard to hire good programmers.

But HR departments don’t like either of those options: the point of interviewing is to weed out hopefully all the posers BEFORE they get into your company, and keep the ones who know what they’re doing (that means tricks with at-will employment may be out if they have problems retaining people). And they’re not technical enough to judge whether a portfolio is good quality or not.

The latter situation is why there are more technical people doing interviews for tech positions these days, rather than HR. But HR doesn’t like that either. They want to have standards about who they hire: new employees have to have such-and-such a degree, or certification, or at least they need x years of experience in the field.

The thing is, they’re fighting a losing battle. HR isn’t necessarily evil, but it is ineffective, at least for this purpose. Someone can have more letters after their name than a game of Scrabble, and a whole handful of certifications, and still not know what they’re doing. And a candidate can gain x years of experience at any company–whether they did good work there, or whether that company even knows whether or not they did good work, is still a big question mark. But a technical interviewer looking through someone’s GitHub account can see empirical evidence of whether that person can code, and perhaps even how well they work with other programmers.

(Besides, people with letters after their name are extra expensive, because they’re paying off student loans.)

Whether universities like it or not, the job market is a big part of people’s decision to go to college. Will their degree pay for itself or not? And if it won’t, are they really willing to pay that much for it?

Learning to program ≠ college classes

It’s really hard to teach programming, too. Aside from the fact that programming is just something you have to learn by doing, and programming students are de facto going to be teaching themselves to some degree (no pun intended), it’s hard to keep the classes current. By the time a book on foo is written and then the curriculum is developed, foo might be on its way out of date.

Most universities get around this by saying that they only teach theory, which is an important component of what a programmer needs to know. But it isn’t everything, and teaching theory without teaching its applications means that you might not understand the theory as well. It also means that by the time you get into the workforce, you don’t know half the stuff you need to know unless you’ve been rigorously self-teaching along the way. But the actual degree hasn’t taught you how to do stuff. It’s taught you how to learn how to do stuff, and a lot of degreed people are fooled into thinking that they know everything just by having the degree. Similarly still fooled are a lot of HR departments.

But it doesn’t work that way. And sometimes when you get down the the brass tacks of things, people realize that while they’ve got the theory down pat, they don’t… actually… like coding. Or they have no design sense, and aren’t artistic enough to pick it up; they thought computer science was actually science. Or they’ve become frustrated that after four years and $150,000, they still have a long way to go.

These are not the people you want to hire. These are not people who should be in this career. Programming is not for everyone–it takes a certain kind of personality–and just because there are a lot of programming jobs that are stable and pay well does not mean you should go into it.

A degree will teach you a lot. But it won’t teach you how to program–it’ll teach you how to learn to program–and it may not teach you whether you like it.

(That goes in both directions. Some people who do have the inclinations for programming [patience, ability to focus, love of learning and making things] may find college classes intolerably boring after a while, for much the same reason I haven’t read the last fifty pages of any of my coding books: you usually have something you want to build by then.)

There are other things to do

For the price of a university’s tuition–let’s say 30K a year for four years, which is a rather conservative guess for this–you could bootstrap a startup. 120K would probably last some startups all the way until the stage they needed a Series A round from investors, and for many others it would be all the funding they needed.

If you’re not fond of startups, you could put the money towards rent and food, and become a freelancer. Say you want to be a web designer/web programmer. Spend a year learning what you need to learn on your own (you would have at university anyway) and making friends. Then, if you have the right contacts, or at least the guts to look for companies with outdated websites and call them up with an offer, you can get yourself a pretty stable income not only as designer but as maintainer.

Or you could go to a coding bootcamp rather than a university. They’re becoming more and more of a legitimate option these days, and they’re generally cheaper and more practical than normal schooling.

Or you could spend the time learning and contributing to open source. There are increasingly more companies that would rather see a packed GitHub portfolio than a degree.

Friends

There are reasons to go to university, of course; a degree still carries quite a bit of weight, but there are also reasons to go for just a year or two. The major reason, at least for me, to just attend and take classes you like is the other students.

 

That means people who will build stuff with you.

I don’t know if that means as much to other people as it does to me, but I think it’s really important. I want to work with other ambitious nerds who want to make stuff and tinker with the world as we know it. I think two or three can do a lot more than one, and a lot more than they’d do individually.

Also, the theory is important, as are some classes that are maybe better taught by walking through them with a class. I want to know about data structures. I also want to learn Lisp, but I’m a little intimidated by it; the college-class habit of going through all the tutorials and explaining everything, which I find somewhat tedious in a lot of cases, might really help in the case of learning Lisp. (Or whatever functional language they teach.)

Professors are pretty important to me too, because the right professor can be really interesting to listen to–particularly when you get them talking about something that isn’t strictly what they’re supposed to be teaching. I know a lot of what I know from listening to older programmers. In fact, the opinions I’m talking about in this essay are something I discussed with one of my favorite teachers last night, and he was agreeing with me on all points that I can remember (it was a long discussion).

The price tag

I don’t want to be in debt all the way through my thirties for something that won’t really teach me what I need, particularly when I can learn through books that are 1% of the price, and by the time I need a serious job the piece of paper will mean less than my GitHub account if I’m not lazy.

GitHub is free. Books are cheap. University is neither.

I’ll attend college if that’s how you find people who become collaborators and testers and cofounders. But I won’t pay a fortune to finish it.

If I haven’t made it clear, my plan is to go to university for maybe two years–and probably not the same university or even the same city–take what classes I want while I hold down a part time job or internship, and then just leave. Probably by then I’ll be entrenched in a startup or, if not, can find an employer pretty easily. My skill set is pretty well-rounded right now, even if I don’t have a ton of experience, and I’ll have an Associate’s degree anyway.

These are opinions I’ve held for months, but it’s really easy to get confused about this sort of thing when everyone else has a different opinion about what you should be doing and what’s important. My teacher last night said maybe their advice just reflects what works for them, and the different paths are all valid, at least to some degree. That’s probably true. I, in turn, don’t intend to say that my plan is what everyone should do. Y’all can do whatever you like as long as it works for you, but I’m warning you now that a college education is not going to teach you everything you need to know to build things, whether for yourself or for an employer.

And maybe I’m wrong and my plans to skip the piece of paper will blow up in my face. (In which case I’d just go back and get it… I’m not sure why people are talking about my plan like it’s a permanent, life-ruining mistake.) But if I make a choice about this and I’m wrong, I’d rather have that be because it was my own choice that was wrong, not something someone else convinced me to do. I would rather trust myself and make my own mistakes than end up bitter about someone else’s.