Every new programming project involves choosing a language early in the process. This choice can be exciting and daunting at the same time, as it always involves weighing several conflicting factors. Based on many years of varied programming experience, here is my advice:
-
Pick a language appropriate to the task. Do you need good numerical optimization libraries? Do you need matrix operations? Do you need to parse HTML files? You don’t need the best language, but you don’t want to be stuck with something too slow or that requires you to write a lot of unnecessary support code. This is what John D. Cook is getting at when he says “Don’t be a technical masochist”. I always think of this first even though it’s not always the most important criterion.
-
Take into account the fact that you might have to learn (or relearn) the language. This is the dreaded learning curve and even though I’m a quick learner, I always underestimate the time it takes to achieve proficiency.
-
Think about the future utility of knowing the language. This is harder than it looks. On the one hand Python is broadly popular and winning in scientific computing. Ruby is a similar language but has better libraries for web development. Both seem like good investments, but I haven’t used Python in more than 5 years and I’ve never written anything in Ruby.
-
If you are collaborating, think about what the rest of the team knows. Even if your partner isn’t writing as much code as you, it’s pretty valuable if they can read your code.
-
Don’t forget to have fun. Programming can be a grind–sometimes it’s fun to stretch your brain with something new.
-
Expertise in a language should not be squandered. It’s a lot of work pouring the core of a language (and it’s standard libraries) into your head, but once you do it, you can write a lot of good code very quickly. This knowledge depreciates quickly when you switch to different “better” tools for a given job.
I spend a fair amount of my time analyzing data with Stata, and that involves writing programs in a quirky proprietary language. For example, it has no variables, but it does have local and global macros. To evaluate a local macro, you surround its name with a back quote and a forward quote (`x’). These can be nested. Global variables are prefixed with a dollar sign ($x). That said, it has general file handling and regular expression functions, and you can do interesting programming with it.
Lately, I’ve been trying to maintain and build my expertise in Stata by using it for a broad range of programming tasks even when it’s not the objectively best tool for a job. That was the case a few months ago when I parsed up and analyzed the content on this site. The end result looks a little weird, but it works and my brain is in a better place for it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|