My Intro to Coding/Python/Django/AppEngine
When I first learned to write code a few years ago I taught myself PHP. I still contend that was/is the very best choice for someone just starting out as it offers the lowest barrier to entry in making things happen on the web. Between WAMP/MAMP and the fact that most vanilla webhosts support PHP by default, it gives someone just coming into building applications a very simple tool to get started with.
This answer is not the most popular with engineers, who (sometimes fairly) see weaknesses and sloppiness in PHP. The counterpoint I offer is that I’m not suggested it’s a good language, but rather someone who is just getting started needs as few barriers as possible to getting something up and running. PHP I still contend, is the best tool for that job.
The problem was, all that work was leading me to shy away from writing code when I had an idea. Instead of spending time writing code I knew I’d spend it setting up servers and the such. I tried AWS and even Heroku, and both still left me with what felt like an imbalance between setup and coding. What I started to realize is that as someone who doesn’t write code every day, I want tools that optimize the amount of time I actually spend writing code. That, after all, is what I enjoy. (I’m not sure if I’ve ever written it here, but the feeling I get writing code is pretty unique to any of the other work I’ve done. There’s a beauty in the simplicity of code: While something can always be more optimized or elegant, at the end of the day when it works, it works, and when it doesn’t, it tells you why.)
Anyway, though I can’t remember how I got started, I discovered Google AppEngine about six months ago and it’s been a total revelation for me. All of a sudden I’m excited to take idea to Sublime and get busy because I know that I’ll waste 0 time doing anything I don’t want. Google handles data storage, queuing, routing, and pretty much anything else I ever need and while there are certainly limitations (mostly around package management), the pros outweigh the cons by a huge amount.
About two months ago I thought it might be fun to try teaching an introduction to Python class using AppEngine. It would give me a chance to continue to test my theory that the best way to teach people to write code was to start them with GET/POST and, thanks to AppEngine, getting started and getting deployed would be as easy as clicking the buttons in their little OS X app. I made a little repository that I shared with the Percolators who took that class a few months and I thought it might be worth sharing that with everyone else. It’s nothing fancy, but it’s got the basics of GET, POST, URL routing, and using the data store. Ideally it’s a nice little intro to writing code on the web. So, if you’re new to AppEngine, Python, or code in general, here’s how to get started:
- Download AppEngine for Python
- Download my intro files from Github
- Open AppEngine locally and File > Add Existing Application, then Browse and add the folder you just downloaded.
- Hit Run in AppEngine and then Browse, which will open your site (running on your local server) in your browser.
- From there open up the files in your favorite editor (I prefer Sublime) and start playing around. Don’t worry, you can’t really break anything and, when you do, Python will tell you exactly what you did wrong (to the line of code).
That’s it. Good luck, enjoy, and let me know how it goes.