Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Andy Hughes
Andy Hughes
8,479 Points

I would like to start building a Python app, not sure quite where to start.

This feels like a question I should know the answer to and maybe I do but I want to check it out.

So I'm wanting to put my Python skills into action having gone through the Python Basics, Flask with PeeWee and Flask with SQLAlchemy courses. I also have a good working knowledge of html and css.

Where do I start? I don't remember learning anything about how to structure a project other than Flask uses templates and models etc.

I'm asking because I don't want to start building and then find I have to change lots of things because I'm not following a standard architecture pattern.

If someone could help, or point me in the direction of somewhere to understand this, I'd be grateful. :)

1 Answer

There are probably resources out there that address this type of question, but I think the best answer is the quote from Arthur Ashe: "Start where you are. Use what you have. Do what you can." Don't wait to start writing code for fear that you'll have to rewrite it. Rewriting code is part of the process. Every time you go back to code you have written, you'll find areas where you could improve it based on new knowledge and experience you gained since the last time you worked on it. Sometimes you will learn something that makes you want to rewrite entire projects, and that's ok. Sometimes an update is made to the language that makes the way you wrote your code nearly obsolete, and that's also ok. The most important thing is to start creating your project and figure out what works and what doesn't. Figure out what you can do well, what you can do well enough to make it work, and what you still need to learn. You can always go back and make it better. If you're really worried about putting too much work into something and not wanting to re-write it, start with something small. As you add complexity, you'll find that there are different techniques and methods that are needed, and some of those will have nuanced ways of implementing them that make them better or worse for what you're trying to accomplish, but that's part of learning, part of coding, and part of life. Go make the world a better place by adding your code to it, and then in 10 or 20 years come back and complain that you wish you had known the stuff when you started. It may not be the best code, but if it solves a problem or makes life better, it's awesome, and it's an amazing feeling to know that you were the one that is responsible.

Andy Hughes
Andy Hughes
8,479 Points

Thanks for your answer Jason Larson. That is my usual approach, just start typing, building and then worry about the organization later (or if it becomes a problem). I guess I'm trying to learn to follow some best practices so I make it easier on myself later (plus I know I'm not one for rules and patterns!). I'm using Flask with Peewee so I guess I'll follow that pattern for now. Thanks again.