If you’re like me, you enjoy doing lots of quick CRUD (create/read/update/delete) applications that are highly experimental, highly volatile and require low commitment until you know where you want to go with it.
Having worked with various web frameworks (Django, Rails, Sinatra, webpy, Struts, Express, Flask, and probably some other ones I’ve missed), I find that as a coder, one needs a nice balance of getting code up and running on a local machine and not having to organize and plan too much when in “play mode”. By “play mode”, I mean MTAWGSBWATL a.k.a. “Maybe This App Will Go Somewhere But Worry About That Later”.
This kind of mentality is very useful for both beginners and those who are more advanced in their programming career. Think of it as taking a bunch of clay and molding it until you feel that you have the right fit. The last thing the experimental coder needs is to think about is the “ideal organization” of their code and more about getting it running on a local webserver as soon as possible.
I find two frameworks quite efficient at getting this done – Sinatra and Flask. In this post, I’ll be specifically talking about Flask, BrowserID and MongoDB.
Now a quick summary of these three things:
- Flask is a lightweight Python framework
- BrowserID is a secure authentication service
- MongoDB is a nosql database
Why would one use these for an application, especially one that is prototypical? First, because we don’t want to over-engineer our code right now. Second, because we don’t want to write our own or maintain an authentication platform that requires us to either handle anything beyond a user’s session, uses a third-party service (such as Twitter or Facebook) which some people may not feel comfortable in signing in with and we want to get things done as fast as possible. Finally, because there’s no point in planning a relational database with something like MySQL or PostgreSQL when you may not even know what you are designing. You may not even know what you’re doing! So keep it simple and to the point.
For my examples, I started with Lexicrypt. Lexicrypt is a fun, small project that generates encrypted messages as images. It took me about a week to get the first iteration up and running on a publicly accessible server. Your mileage may vary – if you’re experienced in Python, this may take you about the same amount of time or less. If this is your first time, don’t worry about taking longer – you’ll eventually find your comfort zone and your modus operandi for developing personal scaffolds of your projects.
Shortly after I created Lexicrypt, I decided to make a small photo service that enables you to sign in, upload photos, tag and favourite them. Instead of starting from scratch I took the scaffold of Lexicrypt, popped out the encryption functionality and replaced it with the photo functionality. This enabled me to go from idea to deployment for the first iteration within a weekend!
To view the source for these projects and get an idea of their similarities and differences you can check out the Github repositories at https://github.com/ednapiranha/lexicrypt and https://github.com/ednapiranha/snapshots-from-here.
As for your rapid prototyping endeavours, good luck and continue to code and code some more. Remember, the process is not only a way for you to learn how to code more efficiently and collaborate with others as you gain more experience, but it is also a way for you to learn more about yourself in the development of your application.
Here is a video of me giving a lightning talk on the subject:
Mike Morgan wrote on :
Fred Wenzel wrote on :
travis wrote on :
Alex wrote on :
Anderson Cardoso wrote on :
M. wrote on :
Bart J wrote on :
Wouter wrote on :
Jennifer Fong wrote on :
Jennifer Fong wrote on :