Suraj Kapoor


Director of Product @Lerer Ventures, Self-taught Python Coder


What I Learnt Building My First 'Large' Web Application

I've built a handful of web applications before but, currently, I'm in the processing of building the largest application I've ever tackled. What constitutes a 'large' application? Of course, 'large' is relative to what I've built in the past. The app has around 1500 lines of server code and is built for three different users. For me, that's large.

So, what have I learnt so far?

1) Architecting the app beforehand is critical - writing out the database models is a great place to start.

2) Name variables properly. I now understand why this is so crucial. Variables start to spread into many different parts of your application (front-end templates, cookies, sessions, DB Models) and start to cause confusion in other places. Even if you are building a tiny helper function, think carefully about naming variables properly.

3) Make your code as modular as possible. Make sure your functions are short and plan ahead as to where the functions and files will be stored. I created a utils.py file that stores all of my helper functions and it's hugely helpful.

4) Build first, refactor later. I learn when I write code not when I think about code. Write it , test it, move on. It will probably need to be written at some point.

5) Stick with technologies your comfortable with. There are always tendencies to use new technologies that can potentially save time but, remember, you need to be skilled with the technologies you are using and learning new ones takes time.

6) Review your code regularly with a mentor. Your mentor will be able to help you think about how you want to refactor your code for later. Inevitably, you'll have to rebuilt parts of the app so planning ahead is part of the game.