Thinking Out Loud: Fun with maps
Filed in Thinking Out LoudOften I’m to be found eyeball-deep in maps, perusing routes and marking where I want to go. Even if I never used it for anything other than the maps, joining AAA with its unlimited supply of free maps was a great investment for me.
But lately I’ve been embroiled in a different kind of map. I have been learning, learning, learning about Google Maps.
Now, I don’t know a thing about javascript. The way I learned to program was pretty much to take a pre-existing example, find the manual, and play. I’m not a programmer in the sense of “someone who actually understands on a fundamental level the inner workings of programming.” I’m a programmer in the sense of “I needed to learn about it to do certain stuff that I was thinking about.”
My introduction to PHP actually came when, attending a women-in-technology kind of meeting, there was a special interest group attached that I attended. When I learned what PHP could do I grinned widely–I had been needing it, and there it was. I just hadn’t known what it was called, or that it even existed. Isn’t it funny how this often happens? That is to say, you acknowledge a need, and somehow the universe answers?
I don’t know C, or C with pluses, or perl. I learned a bit of BBC Basic when I was a kid: my masterpiece program generated random dungeons using D&D Basic roll-your-own dungeon charts. (Pick a random number between 1 and 6 and see if you get orcs, gnolls, kobolds, goblins, hobgoblins or a Jello cube.) But the older I got the further behind I fell. Logical reasoning, such as that needed for programming, is something that has developed somewhat with age, but it was not my strong point in high school.
If someone were to start talking about objects and pointers and fiddlededees, my eyes would glaze over. Programming for the sake of it, for the joy of it, is not something I’m into. (I do, however, understand what it feels like, because it’s what writing is like for me.) No, if I program, it’s because I have something that I want to do, specifically, with the code, as opposed to just finding out what the code can do, because you can.
Until recently I had thought I was getting my own map server, but that just didn’t work out. So, I started looking to Google. I knew what I wanted: something that would center itself on a particular point, then display markers with coordinates taken out of my database. At the time I started, I found that the Google documentation was missing a crucial step. Yes, I could display one point on one page. But I wanted lots. I wanted my users to be able to see what landmarks were around the area and to give them information on said landmarks.
I figured I’d need to use PHP and mySQL. So I did a search for “Google Maps mysql.” Two things came up: a short tutorial and a reference to the book. One short ride later and after a conversation with a librarian who looked and sounded just like the Oractle in The Matrix, the book was on order. But I was, in fact, impatient. So I sat down with the tutorial and the examples and saved it as “map1.php.”
Each time it worked, I saved a new copy (map2, map3) and changed one detail. This is a technique developed through years of tearing my hair out when I broke my own programs. If the detail worked, great. If it didn’t, and I couldn’t fix it, then I could drop back to the previous version. I don’t actually have any understanding of what the javascript is doing, to the extent where I could program in it myself. But I do know my way around PHP quite well now, and that helped. I could easily figure out if the glitch was with the PHP or with the tweak I’d just made to the mysterious javascript.
Meanwhile, numerous hours disappeared into the great white programming hole in the sky. Numerous other tasks were ignored. My husband patiently indulged me, recognizing the signs of a genius person-who-makes-things-up-as-she-goes-along at work. Even the cats went away (mostly).
And so, over a period of days, I came to a thing of beauty. A map that does exactly what I want it to do, and then some: the more I program, the more ideas I get. Programming is a form of creativity, and creativity begets creativity. It’s like exercise: the more you do the better it feels.
I feel deeply, wholly satisfied–not smug because I made it work, but satisfied in the sense of “I stretched my brain and things happened.” After weeks of admin and tidying and generally doing grunt work, it feels like fresh air just suffused the house.
Mmm, air.
Subscription links
-
If you enjoyed this post, please consider subscribing to the Raven's Roads RSS feed! Click here for the raw feed or links to feed readers.







No Comments, Comment or Ping
Reply to “Thinking Out Loud: Fun with maps”