“If a thing’s worth doing, it’s worth doing well” is a nice old saying, but is it true? Cathy’s advice column today reminded me of this question, as regards coding. I think learning to write good code is quite hard. On the other hand, learning to write fairly crappy yet functional code is drastically less hard. Drastically less hard and incredibly useful! For many people, it’s probably the optimal point on the reward/expenditure curve.
It feels somehow wrong to give advice like “Learn to be a crappy programmer” but I think it might actually be good advice.
Totally with you on this. Writing shit code is awesome. It’s like making and eating bacon and eggs naked in your kitchen – a little dangerous if the hot grease spatters you, but super delicious and always worth it.
If a thing’s worth doing, it’s worth doing, and in particular worth doing not well.
I don’t code very often (maybe monthly) but am very glad that I know how, because it lets me guess how other people’s programs must work. In particular, I know whether or not some feature will be there and be worth hunting for.
I’m definitely with you (and Cathy) on this, though perhaps not for the usual reason. As someone who spent the first 15+ years of his programming life as a crappy one, it turned out that it only took two or three years of actually working on programming to turn into a good-enough-to-work-for-Google programmer.
I don’t think that learning to write good code is all that hard. On the other hand, it is better to have fun or do some insightful quick and dirty modeling writing some sloppy code than not writing at all. You only need to go deeper when you begin to have need of flexible preferences/controls, and start accumulating a bunch of routines, algorithms, graphing modules, etc., that all need to interact.
I like Allen’s comment, and would expand it this way: “In particular, I know whether or not some feature will be there and be worth hunting for OR ASKING FOR.”
Learning to be an effective programmer for your purposes will often involve working in a language that “real programmers” don’t particularly like. Something like SAS, Stata, or Mathematica will get you analytical power quickly without bogging down in the weeds of file input and output.
I agree that learning how to code is worth it, even if it’s not elegant top notch code. Though, it might be worth debating what the best outlet to learn that skill is. Coding should definitely be available more in public schools. But, are MOOCs, textbooks, or meet-up style groups the best ways for adult professionals to gain this important skill?
It surprises me that there are many mathematicians who don’t heed this very good advice. I can’t understand why.
I agree too, so long as one is fully aware of the crappiness of one’s own programming skills…
Yes, but be aware of when you need good programming.
Mathematics is already littered with the graves of useful software that could not be maintained or updated after the original authors retired or died because the code was a mess and the documentation nonexistent.
No one has to learn to be a crappy programmer. It’s the default condition since people are crappy thinkers, talkers and actors by nature. Learning how to code well is worthwhile even for those who only produced dashed off crap in practice since it will be better crap.
I agree with Gary except to add: it’s not that difficult to learn to program with a reasonable level of hygiene, and it really only takes a couple of days to get to that point – but you have to start thinking about it.
Just because you can code for crap doesn’t mean you have to leave out the documentation. I tend to code crappily and then happily document my poo in the comments, along the lines of this recent one: “Here I just copied the same command 10 times to do 10 different things because I couldn’t be bothered to figure out how to manage the ten things as variables. If you’re updating this code or trying to do 15 more things, feel free to figure it out yourself.”
Really tempted to write a new post titled “Document your poo” right now.
I shouldn’t have let my dog read all this potty mouth stuff—now she’s hot to sniff every butt on the street when we head out for a walk.